-
Notifications
You must be signed in to change notification settings - Fork 421
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
Helpful declarative __setattr__
and trait validation
#2016
Comments
Does this issue address the problem described in this notebook? https://gist.github.com/sgdecker/8c90f2300da03de296e1d934b47e1cd1 |
Accomplishing these tasks should ideally a.) tell you that I don't know that this will address the plot parent issue you're having in that notebook. In the mean time it does look like re-creating the |
That notebook is the smallest snippet I have, so by all means, go ahead and open a new issue. Thanks! |
Here's a minimal reproducer: from datetime import datetime
from metpy.cbook import get_test_data
from metpy.io import parse_metar_file
from metpy.plots.declarative import PlotObs, MapPanel, PanelContainer
sfc_obs = parse_metar_file(get_test_data('2020010600_sao.wmo', False))
obs = PlotObs()
obs.data = sfc_obs
obs.time = datetime.utcnow()
panel = MapPanel()
panel.projection = 'lcc'
panel.layers = ['countries','states']
panel.plots = [obs]
try:
pc = PanelContainer()
pc.panels = [panel]
pc.show()
except Exception:
pass
panel = MapPanel()
panel.projection = 'lcc'
panel.plots = [obs] The call to |
Let me know if this is worth a new issue, and I realize the existing inconsistencies are just holdovers from the underlying Cartopy feature names, but a list like Why is My request would be to add aliases ('coastlines' = 'coastline', 'countries' = 'borders', and perhaps others). |
@sgdecker Can you open that as a new feature request? It's reasonable to do for the declarative interface. |
Please let me know if this should be a separate issue, but a student was flummoxed when the following code excerpt: pc = PanelContainer()
pc.panel = [panel1, panel, panel3, panel2]
pc.size = (15,12)
pc.show() generated the error While a savvy debugger can spot the problem pretty quickly, it isn't entirely obvious (especially when there are many lines of code before this). I believe the |
@sgdecker Yeah, we could probably just check that what's passed in passes |
As it was ripped out of #1903 for now, it might be helpful to users to
MetPyHasTraits.__setattr__
to provide errors for users attempting to set traits that don't exist (e.g. misspellings)dir
and tab-completion #1903The text was updated successfully, but these errors were encountered: