You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Handling plotting functions that have an inquire (I) only mode #896
How do we want to handle these cases? It seems weird to use fig.histogram(..., inquire=...) if no figure/plot is actually returned. One suggestion made at #794 (review) was:
Ideally, what we might have to do is make two user-facing rose functions:
1. A plotting-only `fig.rose`
2. A non-plotting `pygmt.rose` which will solely use the inquire (I) flag.
Both of these could share a core def _rose() function and live within pygmt/src/rose.py. This is just an idea though, and probably quite hard to implement in one Pull Request. For now, we could implement just the plotting side (1) and raise a NotImplementedError for inquire (I), and perhaps wrap pygmt.rose (2) in a future PR? Or maybe there's a smarter alternative way.
Open to suggestions on how we want the API for this look like.
Are you willing to help implement and maintain this feature? Discuss first
Ideally, what we might have to do is make two user-facing rose functions:
1. A plotting-only `fig.rose`
2. A non-plotting `pygmt.rose` which will solely use the inquire (I) flag.
Both of these could share a core def _rose() function and live within pygmt/src/rose.py. This is just an idea though, and probably quite hard to implement in one Pull Request. For now, we could implement just the plotting side (1) and raise a NotImplementedError for inquire (I), and perhaps wrap pygmt.rose (2) in a future PR? Or maybe there's a smarter alternative way.
Sounds like a good compromise, however, does it make sense for all modules that have the -I flag or only for a few of them?
Sounds like a good compromise, however, does it make sense for all modules that have the -I flag or only for a few of them?
As far as I can tell, it's only 3 modules (rose, solar and histogram) where this applies. For other modules, the -I flag means something else (e.g. spacing) and not 'inquire'.
Activity
michaelgrund commentedon Feb 18, 2021
I totally agree that it feels quite strange if no plotting object is returned when applying these modules.
Sounds like a good compromise, however, does it make sense for all modules that have the
-Iflag or only for a few of them?weiji14 commentedon Feb 28, 2021
As far as I can tell, it's only 3 modules (
rose,solarandhistogram) where this applies. For other modules, the-Iflag means something else (e.g. spacing) and not 'inquire'.seisman commentedon Sep 3, 2021
Please note that there are more plotting modules that can "dump" something to a file without plotting anything:
mask-D optionternary-M optioncoast-M optiongrdcontour-D optioncontour-D optionbasemap-A option