Skip to content

Fix missing gcmt convention keys in pygmt.meca #1611

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

Merged
merged 5 commits into from
Nov 9, 2021
Merged

Fix missing gcmt convention keys in pygmt.meca #1611

merged 5 commits into from
Nov 9, 2021

Conversation

weiji14
Copy link
Member

@weiji14 weiji14 commented Nov 7, 2021

Description of proposed changes

Adds the 'rake1' and 'strike2' keys to the global CMT (gcmt) convention, and add a unit test adapted from https://docs.generic-mapping-tools.org/6.2/supplements/seis/meca.html#examples.

Fixes #1580, Patches #516.

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.

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

Adds the 'rake1' and 'strike2' keys to the global CMT
(gcmt) convention, and add a unit test adapted from
https://docs.generic-mapping-tools.org/6.2/supplements/seis/meca.html#examples.
@weiji14 weiji14 added the bug Something isn't working label Nov 7, 2021
@weiji14 weiji14 added this to the 0.6.0 milestone Nov 7, 2021
@weiji14 weiji14 self-assigned this Nov 7, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2021

Summary of changed images

This is an auto-generated report of images that have changed on the DVC remote

Status Path
added pygmt/tests/baseline/test_meca_gcmt_convention.png

Image diff(s)

Added images

  • pygmt/tests/baseline/test_meca_gcmt_convention.png

Modified images

Path Old New

Report last updated at commit b59c03a

@weiji14 weiji14 marked this pull request as ready for review November 7, 2021 07:06
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.

Looks good to me.

@seisman seisman added the final review call This PR requires final review and approval from a second reviewer label Nov 7, 2021
@seisman
Copy link
Member

seisman commented Nov 7, 2021

Ping @tjnewton and @liamtoney for reviews, since they were the main authors of the original PR #516.

@@ -275,23 +284,21 @@ def update_pointers(data_pointers):
"plot_latitude": plot_latitude,
}

# make a DataFrame copy to check convention if it contains
# other parameters
if isinstance(spec, (dict, pd.DataFrame)):
Copy link
Member Author

Choose a reason for hiding this comment

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

Just noticed that this if-statement is unnecessary, because this code block is already nested under an if isinstance(spec, (dict, pd.DataFrame)) statement at L143 above, and there doesn't seem to be any modifications made to the spec variable in between. Please double-check if this looks ok.

Copy link
Member

Choose a reason for hiding this comment

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

Looks good to me.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice catch. Looks great

@weiji14 weiji14 merged commit 86137ce into main Nov 9, 2021
@weiji14 weiji14 deleted the fix/meca-gcmt branch November 9, 2021 22:06
@weiji14 weiji14 removed the final review call This PR requires final review and approval from a second reviewer label Nov 9, 2021
sixy6e pushed a commit to sixy6e/pygmt that referenced this pull request Dec 21, 2022
)

Adds the 'rake1' and 'strike2' keys to the global CMT
(gcmt) convention, and add a unit test adapted from
https://docs.generic-mapping-tools.org/6.2/supplements/seis/meca.html#examples.

* Remove an unneeded if-statement and pylint disable argument
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problem with GCMT convention in meca.py
4 participants