-
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
Expand table-like input options for sphdistance #1491
Conversation
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.
Could you also:
- Rename
table
todata
at 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
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 <[email protected]>
@seisman Doesn't |
I've never used |
So should I then remove |
Yes, please. Sorry for misleading you. |
Co-authored-by: Dongdong Tian <[email protected]>
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.
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
@@ -22,7 +22,7 @@ | |||
V="verbose", | |||
) | |||
@kwargs_to_strings(I="sequence", R="sequence") | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
@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 <[email protected]>
…1491) *Add parameter and tests for x/y inputs *Rename "table" parameter to "data" *Improve docstring for new parameters Co-authored-by: Wei Ji <[email protected]> Co-authored-by: Dongdong Tian <[email protected]>
This pull request adds
data
to the parameter list in the docstring and moves thesphdistance
function to the tabular data section in the index.Fixes #
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