Skip to content

Commit 04b3f41

Browse files
committed
Reorder parameters and add docstring note on code origin from matplotlib
1 parent 3e0d3fb commit 04b3f41

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

pygmt/helpers/decorators.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,20 +408,25 @@ def remove_bools(kwargs):
408408
return new_kwargs
409409

410410

411-
def check_figures_equal(*, result_dir="result_images", tol=0.0):
411+
def check_figures_equal(*, tol=0.0, result_dir="result_images"):
412412
"""
413413
Decorator for test cases that generate and compare two figures.
414414
415415
The decorated function must take two arguments, *fig_ref* and *fig_test*,
416416
and draw the reference and test images on them. After the function
417417
returns, the figures are saved and compared.
418418
419+
This decorator is practically identical to matplotlib's check_figures_equal
420+
function, but adapted for PyGMT figures. See also the original code at
421+
https://matplotlib.org/3.3.1/api/testing_api.html#
422+
matplotlib.testing.decorators.check_figures_equal
423+
419424
Parameters
420425
----------
421-
result_dir : str
422-
The directory where the figures will be stored.
423426
tol : float
424427
The RMS threshold above which the test is considered failed.
428+
result_dir : str
429+
The directory where the figures will be stored.
425430
426431
Examples
427432
--------

0 commit comments

Comments
 (0)