Skip to content
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

Clean up declarative dir and tab-completion #1903

Merged
merged 7 commits into from Aug 6, 2021

Conversation

dcamron
Copy link
Member

@dcamron dcamron commented Jun 8, 2021

Patches the __dir__ inheritance of traitlets.HasTraits so that our classes in declarative.py hide any inherited names as well as any _ or __ names for users of declarative classes hoping for more helpful tab completion. These can still be discovered with the underlying types if necessary. Results:

image

image

@dcamron dcamron changed the title Declarative tabbing Clean up declarative dir and tab-completion Jun 8, 2021
@dcamron dcamron added Area: Plots Pertains to producing plots Type: Enhancement Enhancement to existing functionality labels Jun 8, 2021
@dcamron dcamron added this to the 1.1.0 milestone Jun 10, 2021
src/metpy/plots/declarative.py Outdated Show resolved Hide resolved
src/metpy/plots/declarative.py Outdated Show resolved Hide resolved
@dopplershift
Copy link
Member

Can you also fix the message here to remove "string" while you're here?

if not (valid_west and valid_east and valid_south and valid_north):
raise TraitError(f'"{area}" is not a valid string area.')

@dcamron dcamron force-pushed the declarative-tabbing branch 2 times, most recently from a53900a to b7ca6cc Compare August 6, 2021 19:21
@dopplershift dopplershift merged commit 42a8bec into Unidata:main Aug 6, 2021
@dcamron dcamron deleted the declarative-tabbing branch August 6, 2021 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Plots Pertains to producing plots Type: Enhancement Enhancement to existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Declarative Plotting Tab Completion
2 participants