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

Fix the example codes in the contributors guides #2929

Merged
merged 5 commits into from
Dec 29, 2023

Conversation

seisman
Copy link
Member

@seisman seisman commented Dec 28, 2023

@seisman seisman added documentation Improvements or additions to documentation skip-changelog Skip adding Pull Request to changelog labels Dec 28, 2023
@seisman seisman added this to the 0.11.0 milestone Dec 28, 2023
@seisman seisman added the needs review This PR has higher priority and needs review. label Dec 28, 2023
Copy link
Member

@yvonnefroehlich yvonnefroehlich left a comment

Choose a reason for hiding this comment

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

To be consistent, we also may want to update:

pygmt/doc/contributing.md

Lines 580 to 587 in bb82345

```python
@pytest.mark.mpl_image_compare
def test_my_plotting_case():
"Test that my plotting method works"
fig = Figure()
fig.basemap(region=[0, 360, -90, 90], projection="W15c", frame=True)
return fig
```

to

@pytest.mark.mpl_image_compare 
def test_my_plotting_case(): 
    """
    Test that my plotting method works.
    """ 
    fig = Figure() 
    fig.basemap(region=[0, 360, -90, 90], projection="W15c", frame=True) 
    return fig 

Copy link
Member

@yvonnefroehlich yvonnefroehlich left a comment

Choose a reason for hiding this comment

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

And maybe it makes sense to use code highlighting (```python .... ```) for the following code block:

pygmt/doc/contributing.md

Lines 334 to 340 in bb82345

Example
-------
>>> import pygmt
>>> # Comment describing what is happening
>>> Code example

@seisman seisman changed the title doc: Fix the example using '@check_figures_equal' in the contributors guides Fix the example codes in the contributors guides Dec 28, 2023
@seisman
Copy link
Member Author

seisman commented Dec 28, 2023

Thanks. They all make sense. Now fixed in 98b4331.

Co-authored-by: Yvonne Fröhlich <[email protected]>
Copy link
Member

@yvonnefroehlich yvonnefroehlich left a comment

Choose a reason for hiding this comment

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

Should be fine now 🙂.

Co-authored-by: Yvonne Fröhlich <[email protected]>
@seisman seisman merged commit 75e56e5 into main Dec 29, 2023
7 checks passed
@seisman seisman deleted the doc/fix-check_figures_equal-example branch December 29, 2023 12:23
@seisman seisman removed the needs review This PR has higher priority and needs review. label Dec 29, 2023
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.

2 participants