FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Make unit converters also handle instances of subclasses. by anntzer · Pull Request #13536 · matplotlib/matplotlib · GitHub

Repository navigation

Make unit converters also handle instances of subclasses. - #13536

Merged
dstansby merged 1 commit into
matplotlib:masterfrom
anntzer:unit-subclasses
Jun 11, 2019
Merged

dstansby merged 1 commit into
matplotlib:masterfrom
anntzer:unit-subclasses

Conversation

anntzer commented Feb 27, 2019 •
edited
Loading

Copy link
Copy Markdown
Contributor

PR Summary

Closes #11275.

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

Copy link
Copy Markdown
Contributor

Would it be better to make the cache subclass dict and encapsulate the behavior there?

anntzer commented Mar 2, 2019

Copy link
Copy Markdown
Contributor Author

It already subclasses dict and the "dict" interface is used for registering converters, which does not go through this logic; so keeping the entire get_converter logic in a separate method looks better to me.

mhvk commented Jun 10, 2019

Copy link
Copy Markdown
Contributor

Just ran into this bug in astropy and have created astropy/astropy#8818 to work around it by registering all subclasses of our Quantity class. It would be nice to have this fix instead. Beyond the rebase, is there something that can be done to help get it in?

anntzer commented Jun 11, 2019

Copy link
Copy Markdown
Contributor Author

rebased

dstansby added this to the v3.2.0 milestone Jun 11, 2019
dstansby merged commit 8e57e5d into matplotlib:master Jun 11, 2019
anntzer deleted the unit-subclasses branch June 11, 2019 11:29
anntzer mentioned this pull request Jan 13, 2020
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

A "TypeError" is raised if subclass inherited from "datetime" is used

5 participants


Back | FazBrowse Home | New Git URL