Fix ArtistInspector.get_aliases. #12037
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The docstring parsing in get_aliases was brittle and didn't handle the
final dot that cbook._define_aliases added to the docstring, so as of
master it would return the keys with an additional dot. Instead, use a
regex which will loudly error out if the format is incorrect.
Also replace {key: None, ...} mapping simulating a set to, well, a set.
(The use of sets instead of lists was added in ed9c2b5 apparently to
handle the case where the same alias is added twice.)
(Yes, the whole alias machinery could now be simplified e.g. by adding
an
is_mpl_alias
attribute on the aliases instead.)At least the parsing fix should be considered RC as the issue came in in
#9475.
PR Summary
PR Checklist