| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
Fixes the original issue.
Sorry, something went wrong.
|
This looks OK and I wouldn't block it, but I wonder whether it would be cleaner to move dates._rcParam_helper into rcsetup. It would require importing units in rcsetup, but it would put _rcParam_helper in the only module that actually uses it and it would eliminate importing the dates module inside methods. (If it were moved, it would be renamed to something like _date_converter_helper.) This reorganization could be done in a separate PR for 3.4; it looks like the present PR needs to go into 3.3 ASAP. |
Sorry, something went wrong.
|
My concern wth that is it becomes even more mysterious how the units registry works for dates. I also am not sure that the import can happen at the beginning of rcsetup.py. But I get confused by the import order to be honest. |
Sorry, something went wrong.
| @classmethod | ||
| def set_converter(cls, s): | ||
| """Called by validator for rcParams date.converter""" | ||
| if s not in ['concise', 'auto']: |
There was a problem hiding this comment.
Use cbook._check_in_list()?
Sorry, something went wrong.
There was a problem hiding this comment.
s is just a string, not a dict.
Sorry, something went wrong.
There was a problem hiding this comment.
_check_in_list doesn't check dicts?
Sorry, something went wrong.
There was a problem hiding this comment.
It would work:
cbook._check_in_list(['concise', 'auto'], s=s)The example in the docstring is misleading; as far as I can see, this would rarely if ever be called with more than one keyword argument. The reason it requires a keyword argument is that this supplies a name for the variable when reporting the error.
Sorry, something went wrong.
There was a problem hiding this comment.
It looks good enough for now. My refactoring suggestion can be deferred or ignored.
Sorry, something went wrong.
|
Yeah, its not necessarily a bad suggestion - I just didn't fully grok it. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Summary
Closes #17867
#17022 introduced new rcparams for dates. However, this changed the registration mechanism for dates and broke date plotting if the entry was not in the users matplotlibrc.
This new version fixes that logic (and adds a bit more argument checking)
PR Checklist