After #1036, we start to use the new dvc based workflow for baseline images. We need to migrate existing baseline images to dvc, and also rewrite some tests. Please read the Testing Plots section in the contributing guides for the details of the new dvc based workflow. (Related to #963)
This issue tracks the progress of the migration.
Main Tasks
- Migrate existing baseline images to dvc
- Migrate
@check_figures_equal tests to @pytest.mark.mpl_image_compare
Migrate existing baseline images to dvc
For each item, you should see the test file pygmt/tests/test_xxx.py and baseline images pygmt/tests/baseline/test_xxx_*.png.
Migrate @check_figures_equal tests to @pytest.mark.mpl_image_compare
Some tests in the following files use @check_figures_equal, and should be migrated to @pytest.mark.mpl_image_compare.
Here are some notes for the migration based on my own experience. These are all open for comments and suggestions:
- Tests should focus on testing PyGMT-specific codes. Some tests that test wrapper aliases can be removed.
- Use SI units and long-form parameters, unless there is a special reason
- Each test should focus on testing one feature/bug.
- Although we no longer store baseline images in the git repository, please try to generate smaller images if possible (e.g., set the figure width to 15c, not 30c, use a simpler dataset, use low-resolution coastline or earth relief data).
- Think about how to generated baseline images that are easy to verify their correctness. For example, when plotting a data point on a figure, it's easier to verify that the data is plotted at the correct position when frame and gridlines are also shown.
- You don't have to migrate all tests in one test file in one PR. Adding/updating too many baseline images also makes the PR difficult to review. Try to change no more than 5 tests in one PR.
After #1036, we start to use the new
dvcbased workflow for baseline images. We need to migrate existing baseline images to dvc, and also rewrite some tests. Please read the Testing Plots section in the contributing guides for the details of the newdvcbased workflow. (Related to #963)This issue tracks the progress of the migration.
Main Tasks
@check_figures_equaltests to@pytest.mark.mpl_image_compareMigrate existing baseline images to dvc
For each item, you should see the test file
pygmt/tests/test_xxx.pyand baseline imagespygmt/tests/baseline/test_xxx_*.png.pygmt/tests/test_figure.py) (Migrate test_figure_shift_origin to dvc #1133, @seisman)Migrate
@check_figures_equaltests to@pytest.mark.mpl_image_compareSome tests in the following files use
@check_figures_equal, and should be migrated to@pytest.mark.mpl_image_compare.Here are some notes for the migration based on my own experience. These are all open for comments and suggestions: