Skip to content

Add area_thresh to COMMON_OPTIONS #1426

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

Merged
merged 6 commits into from
Aug 10, 2021
Merged

Add area_thresh to COMMON_OPTIONS #1426

merged 6 commits into from
Aug 10, 2021

Conversation

michaelgrund
Copy link
Member

Description of proposed changes

While working on #1423 I recognized that the -A alias already implemented in coast as area_thresh is also used in several other modules like grdlandmask, grdmath and gmtselect. This PR adds area_thresh to the common options list.

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

@michaelgrund michaelgrund added the enhancement Improving an existing feature label Aug 9, 2021
@michaelgrund michaelgrund self-assigned this Aug 9, 2021
@michaelgrund michaelgrund added this to the 0.5.0 milestone Aug 9, 2021
@seisman
Copy link
Member

seisman commented Aug 9, 2021

It sounds reasonable to me. Two thoughts:

  1. Also update the area_thresh docstring of coast in this PR?
  2. Although these options (e.g, area_thresh, cmap, pen) are used in many modules, they are not real common options. I think it's OK to list the common and "non-common" options in the same COMMON_OPTIONS dictionary, but it would be better to add a few comments explaining that the dictionary contains both common and non-common options, and it would be better to organize them in two groups (separated by a few comment lines). This could be done in a separate PR if agreed.

@seisman
Copy link
Member

seisman commented Aug 9, 2021

2. Although these options (e.g, area_thresh, cmap, pen) are used in many modules, they are not real common options. I think it's OK to list the common and "non-common" options in the same COMMON_OPTIONS dictionary, but it would be better to add a few comments explaining that the dictionary contains both common and non-common options, and it would be better to organize them in two groups (separated by a few comment lines). This could be done in a separate PR if agreed.

Or we can define two separate dicts (e.g., COMMON_OPTIONS and NONCOMMON_OPTIONS) and another dict that is the combination of both.

@michaelgrund
Copy link
Member Author

It sounds reasonable to me. Two thoughts:

1. Also update the `area_thresh` docstring of `coast` in this PR?

Will do that!

2. Although these options (e.g, `area_thresh`, `cmap`, `pen`) are used in many modules, they are not real common options. I think it's OK to list the common and "non-common" options in the same `COMMON_OPTIONS` dictionary, but it would be better to add a few comments explaining that the dictionary contains both common and non-common options, and it would be better to organize them in two groups (separated by a few comment lines). This could be done in a separate PR if agreed.

I would go with this option @seisman. Maybe a good first issue to add some comments explaining that the dictionary contains both, common and non-common options?

Copy link
Member

@seisman seisman left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@seisman seisman added the final review call This PR requires final review and approval from a second reviewer label Aug 9, 2021
Copy link
Member

@maxrjones maxrjones left a comment

Choose a reason for hiding this comment

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

Just missing one close bracket, otherwise looks good. Thanks!

@weiji14 weiji14 mentioned this pull request Aug 10, 2021
19 tasks
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.

😀

@seisman
Copy link
Member

seisman commented Aug 10, 2021

I think this PR is ready to merge. Feel free to merge it when you have time @michaelgrund

@michaelgrund michaelgrund merged commit 975ab3b into main Aug 10, 2021
@michaelgrund michaelgrund deleted the comm-ops-area-thresh branch August 10, 2021 16:48
@seisman seisman removed the final review call This PR requires final review and approval from a second reviewer label Aug 10, 2021
sixy6e pushed a commit to sixy6e/pygmt that referenced this pull request Dec 21, 2022
* update pygmt/helpers/decorators.py
* update docstring in coast

Co-authored-by: Meghan Jones <[email protected]>
Co-authored-by: Wei Ji <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improving an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants