You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use vendored check_figures_equal decorator function #579
This is a medium to long term maintenance issue with the check_figures_equal function at pygmt/helpers/testing.py, which is pretty much an exact copy of matplotlib's check_figures_equal function. Ideally, we would just use a vendored function from matplotlib or pytest-mpl instead of writing our own.
Yes, which was partly why I opened up the issue at matplotlib/pytest-mpl#94, to get all of that pytest-mpl goodness (e.g. not having a hardcoded result_dir). I'll try to make a Pull Request to pytest-mpl for that, so we can just use a proper @pytest.mark.mpl_check_equal decorator in the future (will open a new issue after this one is merged). For now though, since we don't have many tests using check_figures_equal yet, we can probably just leave it like so.
@weiji14 It looks like Option 2 at over your pytest-mpl pull request is the same syntax as what we currently use for @check_figures_equal. Assuming your pull request is merged, would the only real change for PyGMT tests be different import statements to use the decorator?
I would probably keep check_figures_equal until we fix #390, and can be confident that plotting from a NetCDF file vs an xarray.DataArray is always the same.
Activity
willschlitzer commentedon Dec 18, 2020
@weiji14 It looks like Option 2 at over your pytest-mpl pull request is the same syntax as what we currently use for
@check_figures_equal. Assuming your pull request is merged, would the only real change for PyGMT tests be different import statements to use the decorator?seisman commentedon Nov 26, 2024
Currently,
check_figures_equalis only used in thetest_grdimage.pyfile (https://github.com/search?q=repo%3AGenericMappingTools%2Fpygmt%20check_figures_equal&type=code). I'm wondering if we can fully get rid ofcheck_figures_equaland always usempl_image_compareinstead.weiji14 commentedon Nov 26, 2024
I would probably keep
check_figures_equaluntil we fix #390, and can be confident that plotting from a NetCDF file vs anxarray.DataArrayis always the same.