Skip to content

Deprecate support for dash-offset = None. #15828

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 1 commit into from
Mar 10, 2020

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Dec 4, 2019

PR Summary

e.g. plot([1, 2], ls=(None, (4, 4))) which was previously a synonym
for plot([1, 2], ls=(0, (4, 4))) which means "dash-pattern of
4pt-long dashes separated by 4pt spaces, with an offset of 0pt at
start".

Passing None instead of 0 was already not (likely, never) supported for
pdf, ps, or svg (an exception is raised at savefig() time for ps/svg, an
invalid pdf is generated). There isn't much of a point in supporting
None (this also makes e.g. mplcairo more complex because of static
typing in C++ extensions), so just deprecate it.

Goes on top of #15827.
Edit: closes #14996, which is basically the issue described here.

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@anntzer anntzer force-pushed the dashoffset-none branch 2 times, most recently from 87e9acf to 9300485 Compare December 5, 2019 01:02
@tacaswell tacaswell added this to the v3.3.0 milestone Dec 5, 2019
@tacaswell
Copy link
Member

Could we normalize None as input to 0 instead?

The failures look real, but did not dig into them....

@anntzer
Copy link
Contributor Author

anntzer commented Dec 5, 2019

The failures are real, need to look into it.
I think the (small) cleanup to Line2D from not normalizing (allowing to remove a few checks for None) is also nice to have. Again note that this has (likely) never worked for pdf/ps/svg so I doubt there are many people who rely on it...

@anntzer
Copy link
Contributor Author

anntzer commented Jan 26, 2020

figured out the failure, now fixed, should be good to go.

Copy link
Member

@QuLogic QuLogic left a comment

Choose a reason for hiding this comment

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

Rebase and maybe small tweak to a sentence.

e.g. `plot([1, 2], ls=(None, (4, 4)))` which was previously a synonym
for `plot([1, 2], ls=(0, (4, 4)))` which means "dash-pattern of
4pt-long dashes separated by 4pt spaces, with an offset of 0pt at
start".

Passing None instead of 0 was already not (likely, never) supported for
pdf, ps, or svg (an exception is raised at savefig() time for ps/svg, an
invalid pdf is generated).  There isn't much of a point in supporting
None (this also makes e.g. mplcairo more complex because of static
typing in C++ extensions), so just deprecate it.
@anntzer
Copy link
Contributor Author

anntzer commented Mar 10, 2020

edited accordingly, and rebased.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

format error saving eps figure using custom linestyle
4 participants