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

Add a gallery example showing different vector heads and tails #890

Merged
merged 31 commits into from
Feb 20, 2021

Conversation

michaelgrund
Copy link
Member

@michaelgrund michaelgrund commented Feb 14, 2021

Here's a gallery example that highlights different vector heads and tails (related to #493). Parts of the docs are still missing and I assume there are open points to discuss, so I think it's better to hold it back for the 0.4.0 release.

Reminders

  • Run make format and make check to make sure the code follows the style guide.
  • Write detailed docstrings for all functions/methods.

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

@michaelgrund michaelgrund added the documentation Improvements or additions to documentation label Feb 14, 2021
@michaelgrund michaelgrund added this to the 0.4.0 milestone Feb 14, 2021
@seisman
Copy link
Member

seisman commented Feb 14, 2021

@michaelgrund Just have a quick look at your example. It looks good. I see you added it to the "0.4.0" milestone, if you're willing to get it merged into v0.3.0 (planned to be released today or tomorrow), please ask me or any other maintainers to have a formal review.

@michaelgrund
Copy link
Member Author

@michaelgrund Just have a quick look at your example. It looks good. I see you added it to the "0.4.0" milestone, if you're willing to get it merged into v0.3.0 (planned to be released today or tomorrow), please ask me or any other maintainers to have a formal review.

I modified some parts and it would be great if you @seisman or any other of the maintainers could have a look at it to merge it before the v0.3.0 release.

@seisman
Copy link
Member

seisman commented Feb 14, 2021

According to the contributing guides:

Examples should highlight a single feature/command. Good: how to add a label to a colorbar. Bad: how to add a label to the colorbar and use two different CPTs and use subplots.

I feel that this gallery example contains at least two topics:

  1. How to plot vectors with different arrow heads and tails
  2. How to plot Cartesian, circular and geographic vectors/arrows.

It would be good if you can split it into two gallery examples (in two separate PRs) to keep each gallery example small.

Based on my experience, reviewing tutorials and gallery examples may take more time than expected, and we have some other high-priority PRs to work on. This example may be delayed to v0.4.0. Sorry for that.

@seisman seisman modified the milestones: 0.3.0, 0.4.0 Feb 14, 2021
@michaelgrund
Copy link
Member Author

michaelgrund commented Feb 14, 2021

According to the contributing guides:

Examples should highlight a single feature/command. Good: how to add a label to a colorbar. Bad: how to add a label to the colorbar and use two different CPTs and use subplots.

I feel that this gallery example contains at least two topics:

1. How to plot vectors with different arrow heads and tails

2. How to plot Cartesian, circular and geographic vectors/arrows.

It would be good if you can split it into two gallery examples (in two separate PRs) to keep each gallery example small.

Based on my experience, reviewing tutorials and gallery examples may take more time than expected, and we have some other high-priority PRs to work on. This example may be delayed to v0.4.0. Sorry for that.

Fine for me @seisman. You're right that the example, as is, is quite a bit overloaded. Will prepare the separate examples the next few days.

Edit: @seisman I added an example in which different vector heads and tails are shown. The example in which it is shown how to plot different types of vectors (cartesian, circular and geographic) will be comitted in a separate PR.

@michaelgrund michaelgrund changed the title Create gallery example for plotting vectors and math angle arcs Create gallery example showing different vector heads and tails Feb 16, 2021
examples/gallery/line/vector-heads-tails.py Outdated Show resolved Hide resolved
examples/gallery/line/vector-heads-tails.py Outdated Show resolved Hide resolved
examples/gallery/line/vector-heads-tails.py Outdated Show resolved Hide resolved
Copy link
Member

@seisman seisman left a comment

Choose a reason for hiding this comment

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

The example looks good to me. Hopefully, @GenericMappingTools/python and @GenericMappingTools/python-maintainers can give it a final review.

We will keep this PR unmerged for two more days.

@seisman seisman changed the title Create gallery example showing different vector heads and tails Add a gallery example showing different vector heads and tails Feb 19, 2021
@maxrjones
Copy link
Member

Should the trailing whitespaces be removed in the docstring? My interpretation of PEP8 is that they should be avoided everywhere, but I noticed that it's not something that's flagged by make format, make check or make lint.

@seisman
Copy link
Member

seisman commented Feb 19, 2021

Should the trailing whitespaces be removed in the docstring?

Yes.

My interpretation of PEP8 is that they should be avoided everywhere, but I noticed that it's not something that's flagged by make format, make check or make lint.

I'm not sure if the formatting tools (black, blackdoc, docformatter) have the flags.

@maxrjones
Copy link
Member

Should the trailing whitespaces be removed in the docstring?

Yes.

My interpretation of PEP8 is that they should be avoided everywhere, but I noticed that it's not something that's flagged by make format, make check or make lint.

I'm not sure if the formatting tools (black, blackdoc, docformatter) have the flags.

@michaelgrund, can you please remove the trailing whitespaces? Many IDEs have tools for doing this automatically if you don't want to remove them all manually.

@michaelgrund
Copy link
Member Author

Should the trailing whitespaces be removed in the docstring?

Yes.

My interpretation of PEP8 is that they should be avoided everywhere, but I noticed that it's not something that's flagged by make format, make check or make lint.

I'm not sure if the formatting tools (black, blackdoc, docformatter) have the flags.

@michaelgrund, can you please remove the trailing whitespaces? Many IDEs have tools for doing this automatically if you don't want to remove them all manually.

Removed all the spaces, thought this happens automatically in Spyder but it didn't. However, if possible, it would be good to have any notification about trailing white spaces when running our tests.

Copy link
Member

@maxrjones maxrjones left a comment

Choose a reason for hiding this comment

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

Looks great, thanks @michaelgrund!

@seisman seisman marked this pull request as ready for review February 20, 2021 15:36
@seisman seisman merged commit 9a63274 into master Feb 20, 2021
@seisman seisman deleted the michaelgrund-example-vectors branch February 20, 2021 18:48
@weiji14 weiji14 mentioned this pull request Mar 14, 2021
9 tasks
sixy6e pushed a commit to sixy6e/pygmt that referenced this pull request Dec 21, 2022
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants