Expand table-like input options for sphdistance#1491
Conversation
weiji14
left a comment
There was a problem hiding this comment.
Could you also:
- Rename
tabletodataat L25, L61, and also inpygmt/tests/test_sphdistance.py - At L52: Insert blank line between:
Return type depends on whether the ``outgrid`` parameter is set:
- :class:`xarray.DataArray` if ``outgrid`` is not set
to prevent a Sphinx warning pygmt/pygmt/src/sphdistance.py:docstring of pygmt.src.sphdistance.sphdistance:67: WARNING: Unexpected indentation
Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
|
Do you want to add "xyz" input support (like #1531) in this PR or a separate PR? |
I can give it a try. |
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
|
@seisman Doesn't |
I've never used |
So should I then remove |
Yes, please. Sorry for misleading you. |
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
weiji14
left a comment
There was a problem hiding this comment.
The docstring description reads: sphdistance reads one or more ASCII [or binary] files (or standard input), but 'standard input' (stdin) doesn't make sense in the Python world, suggest rewording it to use just 'table', similar to #1418 (comment).
pygmt/src/sphdistance.py
Outdated
| def sphdistance(table, **kwargs): | ||
| def sphdistance(data=None, x=None, y=None, **kwargs): | ||
| r""" | ||
| Create Voroni polygons from lat/lon coordinates. |
There was a problem hiding this comment.
Typo here. Also, just noticed that this summary doesn't seem correct. It seems to suggest Voronoi polygons are created, but the output is a raster grid, not a vector polygon. Maybe follow https://docs.generic-mapping-tools.org/6.2/sphdistance.html.
| Create Voroni polygons from lat/lon coordinates. | |
| Create Voronoi polygons from lat/lon coordinates. |
Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
|
@willschlitzer The tests fail because the Windows server cannot download the cache file Please trigger the |
@seisman How do I do this? |
You need to uncomment the following line (removing the leading |
Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
…1491) *Add parameter and tests for x/y inputs *Rename "table" parameter to "data" *Improve docstring for new parameters Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com> Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
This pull request adds
datato the parameter list in the docstring and moves thesphdistancefunction to the tabular data section in the index.Fixes #
Reminders
make formatandmake checkto 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