Figure.meca: Refactor tests for plotting a single focal mechanism#2533
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.
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)DetailsAdded images
Modified images
Report last updated at commit 0c6bc53 |
weiji14
left a comment
There was a problem hiding this comment.
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
| while IFS= read -r line; do | ||
| echo -e "- $line \n" >> report.md | ||
| cml-publish --title $line --md "$line" >> report.md < /dev/null | ||
| echo -e "" >> report.md |
There was a problem hiding this comment.
The generated markdown for this is  which doesn't show up since it points to a local path. Need to update this somehow?
There was a problem hiding this comment.
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 ""
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.
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.mecatests 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 formatandmake checkto 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