E5B6 The Artist property rasterized cannot be None anymore by timhoffm · Pull Request #18989 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

The Artist property rasterized cannot be None anymore #18989

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 22, 2020

Conversation

timhoffm
Copy link
Member

PR Summary

It is now a bool only. Before the default was None and
Artist.set_rasterized documented to accept None. However, None
did not have a special meaning and was treated as False.

This is:

  • partly a documentation change: We don't document set_rasterized to accept None. However as with most bools, we just check the truthiness, so None is further accepted implicitly.
  • a change of the default value from None to False. Technically, this is an API change. But it's very unlikely that a user will have queried get_rasterized() is None because None has no special meaning.

Because of the above I dare go without deprecation.

It is now a bool only. Before the default was non and
`Artist.set_rasterized` documented to accept *None*. However, *None*
did not have a special meaning and was treated as *False.
Copy link
Contributor
@dopplershift dopplershift left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once CI passes. I agree about the lack of need to deprecate.

Copy link
Member
@tacaswell tacaswell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

anyone can merge when doc CI passes.

@tacaswell
Copy link
Member

@timhoffm I took the liberty of fixing the rst typo.

@timhoffm
Copy link
Member Author

Please squash-merge after CI pass.

Copy link
Member
@jklymak jklymak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I don't quite understand this PR. None usually means default, and the default is False. Why is all this necessary?

@@ -0,0 +1,5 @@
The Artist property *rasterized* cannot be *None* anymore
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It is now a bool only. Before the default was non and `.Artist.set_rasterized`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
It is now a bool only. Before the default was non and `.Artist.set_rasterized`
It is now a bool only. Before the default was *None* and `.Artist.set_rasterized`

Copy link
Member Author
@timhoffm timhoffm Nov 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only use None as a default, if that default is not a simple data type (e.g. depends on rcParams or is an object; e.g. a Norm). If the default is a bool like here, we use that directly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you merge with the typo?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woops. I was so distracted by your confusion 😃. Corrected in #18996.

@timhoffm timhoffm merged commit 87119ea into matplotlib:master Nov 22, 2020
@timhoffm
Copy link
Member Author

Self-merged based on 2 positive reviews.

@timhoffm timhoffm deleted the rasterized-no-none branch November 22, 2020 17:50
timhoffm added a commit to timhoffm/matplotlib that referenced this pull request Nov 23, 2020
- Use correct issue number in filename
- Fix typo `non` -> `None`
jklymak added a commit that referenced this pull request Nov 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0