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

Wrap rose #794

Merged
merged 124 commits into from
Apr 1, 2021
Merged

Wrap rose #794

merged 124 commits into from
Apr 1, 2021

Conversation

michaelgrund
Copy link
Member

@michaelgrund michaelgrund commented Jan 17, 2021

Description of proposed changes

As discussed in #786 this is wrapping the GMT function rose. Would be happy to receive any kind of feedback.

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.

Notes

  • You can write /format in the first line of a comment to lint the code automatically

As discussed in GenericMappingTools#786 this is wrapping the GMT function **rose**.
Tests for wrapping rose.
@michaelgrund
Copy link
Member Author

/format

@michaelgrund michaelgrund added the feature Brand new feature label Jan 17, 2021
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.

Hi @michaelgrund, this is looking excellent! I've had a quick skim and you're ticking off all the right boxes so far (well documented keyword arguments, top notch unit tests). Will try and give this a proper review once I have time (just busy right now finishing a thesis and preparing for a conference) so I'll ping the other devs @GenericMappingTools/python-maintainers to get some more eyes on this.

Oh, and this is optional, but you can also add a gallery example for rose here in this PR or in a separate Pull Request 😉 I see you're making a few minor changes still, so keep up the good work! Feel free to let us know if you encounter any trouble with anything too.

@weiji14 weiji14 requested a review from a team January 17, 2021 21:47
@willschlitzer
Copy link
Contributor

Why isn't @check_figures_equal used in more of the tests? Per the contributing guidelines, that is the recommended method to use for testing plots, if possible. As far as I can tell (I'm still relatively new to this), @check_figures_equal would work in all of the tests that currently use @pytest.mark.mpl_image_compare.

@michaelgrund
Copy link
Member Author

Why isn't @check_figures_equal used in more of the tests? Per the contributing guidelines, that is the recommended method to use for testing plots, if possible. As far as I can tell (I'm still relatively new to this), @check_figures_equal would work in all of the tests that currently use @pytest.mark.mpl_image_compare.

I thought providing a mixture would be a good choice @willschlitzer. However, I'm fine with adding a few more tests using @check_figures_equal .

@michaelgrund
Copy link
Member Author

/format

@michaelgrund michaelgrund marked this pull request as draft January 18, 2021 18:47
@seisman
Copy link
Member

seisman commented Jan 18, 2021

I thought providing a mixture would be a good choice @willschlitzer. However, I'm fine with adding a few more tests using @check_figures_equal .

We're trying our best to avoid using @pytest.mark.mpl_image_compare, as it stores big image files in the git repository.

pygmt/src/rose.py Outdated Show resolved Hide resolved
@maxrjones
Copy link
Member

In case you are interested in including an alias for this option (not necessary before merging IMO), GenericMappingTools/gmt#5056 will add documentation to the GMT reST files for a rose option (-N) that was previously only documented in the command line usage info.

Co-authored-by: Dongdong Tian <[email protected]>
@michaelgrund
Copy link
Member Author

In case you are interested in including an alias for this option (not necessary before merging IMO), GenericMappingTools/gmt#5056 will add documentation to the GMT reST files for a rose option (-N) that was previously only documented in the command line usage info.

I would do it after merging, potentially together with implementing the inquire option.

pygmt/tests/test_rose.py Outdated Show resolved Hide resolved
@@ -0,0 +1,44 @@
"""
Copy link
Member

@seisman seisman Apr 1, 2021

Choose a reason for hiding this comment

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

According to this comment: #876 (comment), the rose example should be put into the "Histogram" category.

Edit: As the "Historagm" category is not created yet, it's OK to leave the example here now. We can create the category and move the example later.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok fine, to keep track will open a new issue regarding that point.

pygmt/tests/test_rose.py Outdated Show resolved Hide resolved
pygmt/tests/test_rose.py Outdated Show resolved Hide resolved
pygmt/src/rose.py Outdated Show resolved Hide resolved
pygmt/src/rose.py Outdated Show resolved Hide resolved
pygmt/src/rose.py Outdated Show resolved Hide resolved
pygmt/src/rose.py Outdated Show resolved Hide resolved
@seisman
Copy link
Member

seisman commented Apr 1, 2021

The PR looks good. I just made some suggestions. The two comments about refactoring the tests can be addressed in a separate PR.

Co-authored-by: Dongdong Tian <[email protected]>
pygmt/tests/test_rose.py Outdated Show resolved Hide resolved
pygmt/tests/test_rose.py Outdated Show resolved Hide resolved
pygmt/tests/test_rose.py Outdated Show resolved Hide resolved
pygmt/tests/test_rose.py Outdated Show resolved Hide resolved
pygmt/tests/test_rose.py Outdated Show resolved Hide resolved
pygmt/tests/test_rose.py Outdated Show resolved Hide resolved
@michaelgrund
Copy link
Member Author

Thanks for the thorough review and all the comments and improvements @weiji14 and @seisman.

@weiji14
Copy link
Member

weiji14 commented Apr 1, 2021

Thanks for the thorough review and all the comments and improvements @weiji14 and @seisman.

No, thank you for your patience and doing all the side tasks like adding a new tutorial dataset! Feel free to Squash and Merge this PR in yourself @michaelgrund, be sure to change the commit message by summarizing what was done (and remove all those lines with "* Update base_plotting.py" or similar). You can also keep just a single instance of the "Co-authored-by ..." for every single person that helped. Let me know if it's unclear.

@michaelgrund
Copy link
Member Author

Some tests still fail, are there any obvious reasons for that @seisman @weiji14 ?

@seisman
Copy link
Member

seisman commented Apr 1, 2021

Something wrong with the GitHub macOS hosts. I think they're unrelated. This PR is good to merge.

@seisman seisman removed the final review call This PR requires final review and approval from a second reviewer label Apr 1, 2021
@seisman seisman merged commit e131d26 into GenericMappingTools:master Apr 1, 2021
@seisman
Copy link
Member

seisman commented Apr 1, 2021

I just merged the PR using my admin privileges.

@michaelgrund michaelgrund deleted the patch-2 branch April 20, 2021 06:04
sixy6e pushed a commit to sixy6e/pygmt that referenced this pull request Dec 21, 2022
* Wrap rose
* Add tests
* Add a gallery example

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

Successfully merging this pull request may close these issues.

Wrap rose
6 participants