-
Notifications
You must be signed in to change notification settings - Fork 224
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
Correct and consistent usage of 'function, 'method', and 'class' #2043
Conversation
Thanks for working on this! While there could be exceptions, I think the use of module anywhere in PyGMT's docs likely comes from GMT-centric language and not from any Python-related definition. So unless specifically referring to GMT, these could be updated to "function" or "method". You are correct that |
I am happy to contribute, and at least partly I feel I learn more than I bring to the project 😉
Thanks @maxrjones for your explanation! 🙂
I have made the changes in b313a67 as well as 0b13099 and 80339eb. Try to continue with the remaining examples in the next days. |
I have now updated all examples listed above. |
@yvonnefroehlich Please resolve the conflicts first. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
In first_figure.py:
I am unsure about the formulations in this part. Should we keep |
I think it originally means "GMT's modules". Because this is the first PyGMT tutorial and the potential PyGMT users may have never used GMT before, I think it makes very little sense to mention any GMT concepts (e.g., modules) here. So, it's OK to say "without any other methods or external data." |
I also feel that this sentence is a little confusing, because "the PyGMT module" actually means "GMT modules". |
Done in 3e91e11.
I agree. I already have tried to reformulate this sentence, but I was unsure. Thanks @seisman for this explanation! I have made a suggestion in 3db83c8. Of course, I am totally open for changes and improvements on this. |
@yvonnefroehlich Reviewing big PRs is more challenging and takes more time than small PRs. I think this PR already has a lot of good changes and should be merged into the main branch after reviewing. If you think there are still many files that need to be updated, you can open separate PRs later, like what we did in PRs #1857, #1862, #1872. |
Thanks for your understanding @seisman!
That's fine for me! 😉 I added the last two changes I had on my list for now. |
Description of proposed changes
Fixes #2029
Overview of affected files
Examples which use 'function' for the methods of the
pygmt.Figure
classExamples which use 'method' for the tabular and raster data processing functions
API documentation (list is incomplete and was not continued)
I am unsure about the usage of the term 'module'. I remember issue #1828 and PR #1858 which are about whether
pygmt.Figure.coast
is a 'module' or 'method'.pygmt.set_display
pygmt.grd2cpt
pygmt.makecpt
I am definitely not a Python expert! Probably 'module' is inferred from GMT, but the three listed above do not appear to be 'modules' in the Pythonic-sense
from xy_module import xy_function
(see also second paragraph of issue #1828 (comment)). Maybe it was overlook to also change the API doc table in PR #1858. But why they are 'methods', as changed in PR #1858, despite they do not belong to a class or called on an object? I would be very happy about an explanation for understanding (: In case they are neither 'modules' nor 'methods', it appears that they are 'functions'. Ping @seisman, @maxrjones, @michaelgrund, @willschlitzer (, and @weiji14) for thoughts and help on this, please.Reminders
make format
andmake check
to make sure the code follows the style guide.doc/api/index.rst
.Slash Commands
You can write slash commands (
/command
) in the first line of a comment to performspecific operations. Supported slash commands are:
/format
: automatically format and lint the code/test-gmt-dev
: run full tests on the latest GMT development version