Skip to content

Conversation

@yvonnefroehlich
Copy link
Member

Description of proposed changes

Related to PR #2662, this PR aims to use the code block separator # %% in the gallery example "Choropleth map".

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 commands are:

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

@yvonnefroehlich yvonnefroehlich added documentation Improvements or additions to documentation skip-changelog Skip adding Pull Request to changelog labels Nov 11, 2023
@yvonnefroehlich yvonnefroehlich added this to the 0.11.0 milestone Nov 11, 2023
@yvonnefroehlich yvonnefroehlich self-assigned this Nov 11, 2023
@seisman
Copy link
Member

seisman commented Nov 12, 2023

perhaps we should add a check to make sure that examples must have at least one # %% separators

@seisman seisman merged commit 6ae2072 into main Nov 12, 2023
@seisman seisman deleted the fix-typos-48-gallery-choropleth branch November 12, 2023 12:35
@yvonnefroehlich
Copy link
Member Author

perhaps we should add a check to make sure that examples must have at least one # %% separators

If this is something that can be added easily, I feel we should add such a check, as it's likely that we'll forget adding #%% also in upcoming examples. But if this is more complicated, I am not sure whether the effort is worth it.

@weiji14
Copy link
Member

weiji14 commented Nov 12, 2023

perhaps we should add a check to make sure that examples must have at least one # %% separators

If this is something that can be added easily, I feel we should add such a check, as it's likely that we'll forget adding #%% also in upcoming examples. But if this is more complicated, I am not sure whether the effort is worth it.

Could try to find a regex statement that checks for the presence of at least one # %% in the examples/**/*.py files, and add it to https://github.com/GenericMappingTools/pygmt/blob/v0.10.0/.github/workflows/style_checks.yaml? Or just add it under Reminders in the PR template.

@seisman
Copy link
Member

seisman commented Nov 13, 2023

Could try to find a regex statement that checks for the presence of at least one # %% in the examples/**/*.py files, and add it to https://github.com/GenericMappingTools/pygmt/blob/v0.10.0/.github/workflows/style_checks.yaml?

This one-line command can be used to detect example files that don't have # %%:

grep -L '# %%' $(find examples -name '*.py')

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.

4 participants