-
Notifications
You must be signed in to change notification settings - Fork 224
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
WIP: Add inline example for pygmt.datasets.list_sample_data #1814
Conversation
{'bathymetry': 'Table of ship bathymetric observations off Baja California', | ||
'fractures': 'Table of hypothetical fracture lengths and azimuths', | ||
'hotspots': 'Table of locations, names, and symbol sizes of hotpots from Mueller et al., 1993', | ||
'japan_quakes': 'Table of earthquakes around Japan from NOAA NGDC database', | ||
'mars_shape': 'Table of topographic signature of the hemispheric dichotomy of Mars from Smith and Zuber (1996)', | ||
'ocean_ridge_points': 'Table of ocean ridge points for the entire world', | ||
'usgs_quakes': 'Table of global earthquakes from the USGS'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this list only 2-3 dataset names, and maybe use ...
to indicate that this is an incomplete list? I don't want users to think the output in the example is the complete list.
{'bathymetry': 'Table of ship bathymetric observations off Baja California',
'fractures': 'Table of hypothetical fracture lengths and azimuths',
...
'usgs_quakes': 'Table of global earthquakes from the USGS'}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #1774. The idea of this PR is to better document the available sample data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the goal is to document the complete list. Not sure if this is the best way to do that though, I'm open to other ideas.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still prefer a list in the load_sample_data
function. The reasons are:
- It's more likely that people will read the documentation of
load_sample_data
first, then realize that they need to read thelist_sample_data
documentation to know what datasets are available - Because the maximum length is 79 (or 80) for docstrings, a long description for a dataset must be split into two lines (e.g., description for
mars_shape
), otherwise the style check fails.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you proposing deprecating list_sample_data?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, list_sample_data
is still useful to show the available datasets in interactive presentations.
Superseded by #2342 |
Description of proposed changes
This PR adds an inline example for pygmt.datasets.list_sample_data. It is a possible solution to #1774 and would be easier to maintain than table/list in the docstring since the output from the example could be easily updated.
It is listed as WIP because the style checks fail with line-too-long errors.
Addresses #1774
Reminders
make format
andmake check
to make sure the code follows the style guide.doc/api/index.rst
.Slash Commands
You can write slash commands (
/command
) in the first line of a comment to performspecific operations. Supported slash commands are:
/format
: automatically format and lint the code/test-gmt-dev
: run full tests on the latest GMT development version