Skip to content

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).

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
@seisman seisman changed the title Figure.makecpt: Make the 'reverse' parameter more Pythonic Figure.makecpt: Improve the docstring of the 'reverse' parameter Jun 11, 2025
@seisman
Copy link
Member

seisman commented Jun 11, 2025

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).

I prefer to have this PR merged first, and will revisit the issue above later, when we have time focusing on improving the makecpt wrapper.

@seisman seisman added skip-changelog Skip adding Pull Request to changelog and removed enhancement Improving an existing feature labels Jun 11, 2025
@seisman seisman added this to the 0.16.0 milestone Jun 11, 2025
@seisman seisman marked this pull request as ready for review June 11, 2025 00:44
@seisman seisman added the final review call This PR requires final review and approval from a second reviewer label Jun 11, 2025
@seisman seisman removed the final review call This PR requires final review and approval from a second reviewer label Jun 11, 2025
@seisman seisman merged commit 7778bc0 into main Jun 11, 2025
23 of 24 checks passed
@seisman seisman deleted the add-reverse-FB-makecpt branch June 11, 2025 08:36
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 skip-changelog Skip adding Pull Request to changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants