Skip to content
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

Add projection and region to grdview docstring #1295

Merged
merged 3 commits into from
May 26, 2021
Merged

Conversation

maxrjones
Copy link
Member

Description of proposed changes

The projection parameter is included in the list of aliases but not the docstring for grdview. This PR adds the projection description to the docstring.

Fixes #

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

Copy link
Member

@weiji14 weiji14 left a comment

Choose a reason for hiding this comment

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

Oh wait, actually, we're missing the region (R) docstring as well for this!

pygmt/src/grdview.py Show resolved Hide resolved
Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
Copy link
Member

@weiji14 weiji14 left a comment

Choose a reason for hiding this comment

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

So region (-R) isn't actually a required argument for grdview according to https://docs.generic-mapping-tools.org/6.2.0rc2/grdview.html, but using {R} in the docstring here says that it is:

image

Wondering if we should edit the wording slightly at

"R": r"""
region : str or list
*Required if this is the first plot command*.
*xmin/xmax/ymin/ymax*\ [**+r**][**+u**\ *unit*].
Specify the :doc:`region </tutorials/regions>` of interest.""",

Can open a separate issue/PR for this.

@weiji14 weiji14 added the documentation Improvements or additions to documentation label May 25, 2021
@maxrjones
Copy link
Member Author

Wondering if we should edit the wording slightly

I think the current wording is accurate for most plotting modules, so maybe I can just not use the replacement text for grdview but keep the wording from decorators.py as is to not affect other method docs?

@maxrjones
Copy link
Member Author

Is the latest version OK with you, @weiji14?

@weiji14
Copy link
Member

weiji14 commented May 26, 2021

Is the latest version OK with you, @weiji14?

Yep, looks good! I like that it explicitly specifies zmin/zmax too. Remember to change the PR title to include 'region' before merging.

@maxrjones maxrjones changed the title Add projection to grdview docstring Add projection and region to grdview docstring May 26, 2021
@maxrjones
Copy link
Member Author

Sounds good. One more question - when the checks fail for reasons clearly unrelated to the PR (like now), do you prefer for me to re-run all checks or admin merge the PR?

@weiji14
Copy link
Member

weiji14 commented May 26, 2021

when the checks fail for reasons clearly unrelated to the PR (like now), do you prefer for me to re-run all checks or admin merge the PR?

I would just admin merge in this case to conserve CI resources.

@maxrjones maxrjones merged commit 823b3cd into master May 26, 2021
@maxrjones maxrjones deleted the grdview-proj branch May 26, 2021 02:10
sixy6e pushed a commit to sixy6e/pygmt that referenced this pull request Dec 21, 2022
)

Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants