Skip to content

Change invalid input conditions in grdtrack - #1376

Merged
weiji14 merged 4 commits into
masterfrom
grdtrack-newcolname
Jul 8, 2021
Merged

weiji14 merged 4 commits into
masterfrom
grdtrack-newcolname

Conversation

@willschlitzer

Copy link
Copy Markdown
Contributor

As discussed in #1344, the documentation for grdtrack states that an argument for newcolname is required for DataFrame inputs. However, GMTInvalidInput is raised if a list or numpy array is passed in. This changes the if statement to only raise the error if the input type is a DataFrame.

Fixes #1344

Reminders

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst.
  • Write detailed docstrings for all functions/methods.
  • If adding new functionality, add an example to docstrings or tutorials.

Slash Commands

You can write slash commands (/command) in the first line of a comment to perform
specific operations. Supported slash commands are:

  • /format: automatically format and lint the code
  • /test-gmt-dev: run full tests on the latest GMT development version

@weiji14 weiji14 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @willschlitzer, just one minor point.

Comment thread pygmt/src/grdtrack.py Resolved
@weiji14 weiji14 added the bug Something isn't working label Jul 7, 2021
@weiji14
weiji14 merged commit 10dcad9 into master Jul 8, 2021
@weiji14
weiji14 deleted the grdtrack-newcolname branch July 8, 2021 22:03
@seisman seisman added this to the 0.5.0 milestone Jul 8, 2021
@seisman seisman modified the milestones: 0.5.0, 0.4.1 Jul 25, 2021
sixy6e pushed a commit to sixy6e/pygmt that referenced this pull request Dec 21, 2022
Change if statement to raise GMTInvalidInput if a DataFrame
is passed in with no arguments to the newcolname parameter.

Co-authored-by: Wei Ji <[email protected]>

This branch was previously deployed

1 inactive deployment
Preview — 2dc7c4a7 Deployed Jul 8, 2021 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

grdtrack raises an input error when points are not a DataFrame and no column name is specified

4 participants