-
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
Figure.meca: Refactor tests for plotting a single focal mechanism #2533
Conversation
def test_meca_spec_single_focalmecha(inputtype): | ||
""" | ||
Test passing a single focal mechanism to the spec parameter. | ||
""" |
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.
Different inputtype
are different ways to passing a single focal mechanism to the spec
parameter.
This reverts commit 0a773bb.
This reverts commit f789117.
9bd66b8
to
0c6bc53
Compare
Summary of changed imagesThis is an auto-generated report of images that have changed on the DVC remote
Image diff(s)Report last updated at commit 0c6bc53 |
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.
The updated unit test test_meca_spec_single_focalmecha
looks good, but the dvc-diff.yml workflow seems broken. Do you think it would be better to fix the dvc workflow in a separate PR?
.github/workflows/dvc-diff.yml
Outdated
@@ -66,35 +73,23 @@ jobs: | |||
echo -e "### Added images\n" >> report.md | |||
while IFS= read -r line; do | |||
echo -e "- $line \n" >> report.md | |||
cml-publish --title $line --md "$line" >> report.md < /dev/null | |||
echo -e "![](${line/baseline/baseline-new})" >> report.md |
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.
The generated markdown for this is ![](pygmt/tests/baseline-new/test_meca_spec_single_focalmecha.png)
which doesn't show up since it points to a local path. Need to update this somehow?
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.
There's this deprecation warning on https://github.com/GenericMappingTools/pygmt/actions/runs/5107768299/jobs/9180964772#step:6:55:
Warning: "cml publish" is deprecated since "cml comment" now supports "![inline](./asset.png)"
Looks like we should be using cml comment --publish=true
instead now, xref https://cml.dev/doc/ref/comment?
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.
Ah wait, just noticed you did try to use cml comment
in 0c6bc53. Nevermind then.
This reverts commit 0c6bc53.
The changes to the dvc-diff workflow file was reverted in commit abe334e. I'll open a separate PR to fix the dvc-diff workflow. |
Description of proposed changes
The
Figure.meca
tests are a little messy and difficult to maintain because each test uses different focal mechanisms and event information.I plan to refactor the tests. This PR focuses on testing passing a single focal mechanism to the spec parameter using different data types (dict, file, 1darray and DataFrame). Note that all tests now single a single baseline image test_meca_spec_dict.png.
Changes in this PR:
This PR is a rework of PR #2219.
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