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

Figure.makecpt: Make the 'reverse' parameter more Pythonic #3009

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

yvonnefroehlich
Copy link
Member

Description of proposed changes

I feel it is fair to mention in the docstring that using the reverse parameter of Figure.makecpt also exchanges the background (B) and foreground (F) colors.

Upstream GMT documentation: https://docs.generic-mapping-tools.org/6.5/makecpt.html#i

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 wrapping a new module, open a 'Wrap new GMT module' issue and submit reasonably-sized PRs.
  • If adding new functionality, add an example to docstrings or tutorials.
  • Use underscores (not hyphens) in names of Python files and directories.

Slash Commands

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

  • /format: automatically format and lint the code

@yvonnefroehlich yvonnefroehlich added documentation Improvements or additions to documentation skip-changelog Skip adding Pull Request to changelog labels Jan 16, 2024
@yvonnefroehlich yvonnefroehlich added this to the 0.11.0 milestone Jan 16, 2024
@yvonnefroehlich yvonnefroehlich self-assigned this Jan 16, 2024
@yvonnefroehlich yvonnefroehlich changed the title Figure.makecpt: Mention exchange of background (B) and foreground (F) colors for usage of "reverse" Figure.makecpt: Mention exchange of background (B) and foreground (F) colors for usage of "reverse" parameter Jan 16, 2024
@seisman
Copy link
Member

seisman commented Jan 17, 2024

I feel it's a good time to make the reverse parameter more Pythonic. Instead of using reverse=True, reverse="c" or reverse="z", we may want to use reverse=True, reverse="colors" and reverse="zvalues" instead.

The long argument names colors and zvalues comes from the upstream PR https://github.com/GenericMappingTools/gmt/pull/8280/files (line 45).

pygmt/src/makecpt.py Show resolved Hide resolved
pygmt/src/makecpt.py Outdated Show resolved Hide resolved
Co-authored-by: Michael Grund <23025878+michaelgrund@users.noreply.github.com>
@yvonnefroehlich
Copy link
Member Author

I feel it's a good time to make the reverse parameter more Pythonic. Instead of using reverse=True, reverse="c" or reverse="z", we may want to use reverse=True, reverse="colors" and reverse="zvalues" instead.

The long argument names colors and zvalues comes from the upstream PR https://github.com/GenericMappingTools/gmt/pull/8280/files (line 45).

Sounds fair! Should this be done in this PR or in a separate follow-up PR?

@seisman
Copy link
Member

seisman commented Jan 18, 2024

I feel it's a good time to make the reverse parameter more Pythonic. Instead of using reverse=True, reverse="c" or reverse="z", we may want to use reverse=True, reverse="colors" and reverse="zvalues" instead.
The long argument names colors and zvalues comes from the upstream PR https://github.com/GenericMappingTools/gmt/pull/8280/files (line 45).

Sounds fair! Should this be done in this PR or in a separate follow-up PR?

Better to do it in this PR, since the docstring needs rewritten for the Pythonic reverse parameter.

@yvonnefroehlich yvonnefroehlich changed the title Figure.makecpt: Mention exchange of background (B) and foreground (F) colors for usage of "reverse" parameter Figure.makecpt: Make the 'reverse' parameter more Pythonic Jan 18, 2024
@yvonnefroehlich yvonnefroehlich added enhancement Improving an existing feature and removed skip-changelog Skip adding Pull Request to changelog labels Jan 18, 2024
@yvonnefroehlich yvonnefroehlich modified the milestones: 0.11.0, 0.12.0 Jan 28, 2024
@yvonnefroehlich yvonnefroehlich marked this pull request as draft January 28, 2024 21:48
@seisman seisman removed this from the 0.12.0 milestone Feb 26, 2024
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 enhancement Improving an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants