| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
Minor comments, do with them as you like.
Sorry, something went wrong.
| cbook.warn_deprecated( | ||
| "3.1", message="Passing the drawstyle with the linestyle " | ||
| "as a single string is deprecated since Matplotlib " | ||
| "%(since)s and support will be removed %(removal)s; " |
There was a problem hiding this comment.
removed in
Sorry, something went wrong.
There was a problem hiding this comment.
%(removal)s includes it.
Sorry, something went wrong.
| "3.1", message="Passing the drawstyle with the linestyle " | ||
| "as a single string is deprecated since Matplotlib " | ||
| "%(since)s and support will be removed %(removal)s; " | ||
| "please pass the drawstyle separately ('drawstyle=...' or " |
There was a problem hiding this comment.
-0.5 on quoting 'drawstyle=...'. Might lead to confusion with strings. Alternative:
please pass the drawstyle separately using the drawstyle (or ds) keyword arguments.
Sorry, something went wrong.
There was a problem hiding this comment.
done
Sorry, something went wrong.
Instead of `plt.plot(..., linestyle="steps--")`, use `plt.plot(..., linestyle="--", drawstyle="steps")`. `ds` is now an alias for `drawstyle`. Note that `plt.plot(..., "steps--")` already doesn't work (due to confusion as to whether "steps" is a color, a marker or a drawstyle). The end goal is to simplify and rationalize linestyle specification as rcParams vs. as arguments.
|
Why are we adding an alias to keywords? I'm 👎 on the ds alias and 👍 on the rest. |
Sorry, something went wrong.
|
@NelleV I understand your argument against aliases, and have been on the same page. However, when working interactively a lot, I've come to appreciate, being able to write ls instead of linestyle. OTOH, the drawstyle is likely rare enough that an alias is not really neccessary. So -0.5 on ds, but +1 on keeping existing aliases. |
Sorry, something went wrong.
|
I’m good w the alias. Even if you script, not typing “linestyle” each time would be a nice convenience. |
Sorry, something went wrong.
|
Whether we should fully get rid of aliases is a good question (I agree with @jklymak that they have their usefulness) but I think it's better to be consistent and provide aliases for everything for now rather than have an inconsistent alias system. Adding ds=drawstyle is not going to make the whole alias system harder to deprecate if we really choose to go that route. |
Sorry, something went wrong.
|
👍 on the separation of drawstyle and linestyle/other params. I don't know how often a construct like "steps--" is currently used; so a long enough deprecation period makes sense. Is removal == since +0.2 always? I don't have a strong opinion on the alias. I was wondering if it would be good to add tests for deprecations like this? I.e. a test that the intended use case (linestyle="--", drawstyle="steps") works fine (such test might exist already?) and a test that the still supported, but deprecated case throws a warning. At the end of the deprecation this should then test if the correct error is thrown. This way you would ensure not allow for this kind of mini-language API to be reintroduced in a couple of years. |
Sorry, something went wrong.
I don't think any of the current maintainers would allow such a thing to pass review. Our test suite is already huge enough that I wouldn't bother (there are better parts where to improve the coverage, and that doesn't necessarily mean strict numerical improvements, but rather combos of kwargs which don't work well together, see e.g. the discussion on hist/align...). |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Instead of plt.plot(..., linestyle="steps--"), use plt.plot(..., linestyle="--", drawstyle="steps"). ds is now an alias for
drawstyle.
Note that plt.plot(..., "steps--") already doesn't work (due to
confusion as to whether "steps" is a color, a marker or a drawstyle).
The end goal is to simplify and rationalize linestyle specification as
rcParams vs. as arguments (#11797).
PR Summary
PR Checklist