Skip to content

Commit c550f83

Browse files
authored
Mark unit tests with @pytest.mark.benchmark part 1 (#2911)
* Benchmark test_geopandas_info_geodataframe * Benchmark test_select_input_dataframe * Benchmark test_grdfill_dataarray * Benchmark test_grdimage_image_dataarray * Benchmark test_meca_spec_multiple_focalmecha * Benchmark test_grdimage_grid_and_shading_with_xarray * Benchmark test_grdinfo * Benchmark test_x2sys_cross_input_dataframe_output_dataframe * Benchmark test_grdview_drapegrid_dataarray * Benchmark test_solar_set_terminator_datetime * Benchmark test_tilemap_ogc_wgs84 * Benchmark test_grd2cpt * Benchmark test_grd2xyz * Benchmark test_grdclip_no_outgrid * Benchmark test_grdcontour_labels * Benchmark test_grdcut_dataarray_in_dataarray_out * Benchmark test_grdfilter_dataarray_in_dataarray_out * Benchmark test_grdgradient_no_outgrid * Benchmark test_equalize_grid_no_outgrid and test_compute_bins_no_outfile * Benchmark test_grdlandmask_no_outgrid * Benchmark test_grdproject_no_outgrid * Benchmark test_grdsample_dataarray_out * Benchmark test_grdtrack_input_dataframe_and_dataarray * Benchmark test_grdvolume_no_outgrid * Benchmark test_histogram * Benchmark test_info_pandas_dataframe_date_column and test_info_xarray_dataset_time_column * Benchmark test_inset_aliases * Benchmark test_io_load_dataarray * Benchmark test_legend_entries * Benchmark test_logo * Benchmark test_makecpt_output_cpt_file * Benchmark test_nearneighbor_input_xyz * Benchmark test_plot_vectors * Benchmark test_plot3d_vectors * Benchmark test_project_input_matrix * Benchmark test_psconvert * Benchmark test_rose_plot_data_using_cpt * Benchmark test_begin_end * Benchmark test_sph2grd_no_outgrid * Benchmark test_sphdistance_no_outgrid * Benchmark test_sphinterpolate_no_outgrid * Benchmark test_subplot_basic_frame * Benchmark test_surface_input_xyz * Benchmark test_ternary_3_labels * Benchmark test_text_multiple_lines_of_text * Benchmark test_timestamp_font * Benchmark test_delaunay_triples_input_xyz and test_regular_grid_no_outgrid * Benchmark test_velo_pandas_dataframe * Benchmark test_which_multiple * Benchmark test_wiggle_data_incols * Benchmark test_x2sys_init_units_gap * Benchmark test_xyz2grd_input_array
1 parent 3076ddc commit c550f83

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+59
-2
lines changed

.github/workflows/benchmarks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
echo $CONDA/bin >> $GITHUB_PATH
6262
conda install --solver=libmamba gmt=6.4.0 python=3.12 \
6363
numpy pandas xarray netCDF4 packaging \
64-
pytest pytest-benchmark pytest-mpl
64+
geopandas pytest pytest-benchmark pytest-mpl
6565
python -m pip install -U pytest-codspeed setuptools
6666
6767
# Install the package that we want to test

pygmt/tests/test_geopandas.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ def fixture_gdf_ridge():
6161
return gdf
6262

6363

64+
@pytest.mark.benchmark
6465
def test_geopandas_info_geodataframe(gdf):
6566
"""
6667
Check that info can return the bounding box region from a

pygmt/tests/test_grd2cpt.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ def fixture_grid():
1818
return load_static_earth_relief()
1919

2020

21+
@pytest.mark.benchmark
2122
@pytest.mark.mpl_image_compare
2223
def test_grd2cpt(grid):
2324
"""

pygmt/tests/test_grd2xyz.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ def fixture_grid():
2020
return load_static_earth_relief()
2121

2222

23+
@pytest.mark.benchmark
2324
def test_grd2xyz(grid):
2425
"""
2526
Make sure grd2xyz works as expected.

pygmt/tests/test_grdclip.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ def test_grdclip_outgrid(grid, expected_grid):
5555
xr.testing.assert_allclose(a=temp_grid, b=expected_grid)
5656

5757

58+
@pytest.mark.benchmark
5859
def test_grdclip_no_outgrid(grid, expected_grid):
5960
"""
6061
Test the below and above parameters for grdclip with no set outgrid.

pygmt/tests/test_grdcontour.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def test_grdcontour(grid):
3333
return fig
3434

3535

36+
@pytest.mark.benchmark
3637
@pytest.mark.mpl_image_compare
3738
def test_grdcontour_labels(grid):
3839
"""

pygmt/tests/test_grdcut.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def test_grdcut_dataarray_in_file_out(grid, expected_grid, region):
5353
xr.testing.assert_allclose(a=temp_grid, b=expected_grid)
5454

5555

56+
@pytest.mark.benchmark
5657
def test_grdcut_dataarray_in_dataarray_out(grid, expected_grid, region):
5758
"""
5859
Test grdcut on an input DataArray, and output as DataArray.

pygmt/tests/test_grdfill.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ def fixture_expected_grid():
7171
)
7272

7373

74+
@pytest.mark.benchmark
7475
def test_grdfill_dataarray_out(grid, expected_grid):
7576
"""
7677
Test grdfill with a DataArray output.

pygmt/tests/test_grdfilter.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def fixture_expected_grid():
3939
)
4040

4141

42+
@pytest.mark.benchmark
4243
def test_grdfilter_dataarray_in_dataarray_out(grid, expected_grid):
4344
"""
4445
Test grdfilter with an input DataArray, and output as DataArray.

pygmt/tests/test_grdgradient.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def test_grdgradient_outgrid(grid, expected_grid):
5353
xr.testing.assert_allclose(a=temp_grid, b=expected_grid)
5454

5555

56+
@pytest.mark.benchmark
5657
def test_grdgradient_no_outgrid(grid, expected_grid):
5758
"""
5859
Test the azimuth and direction parameters for grdgradient with no set

0 commit comments

Comments
 (0)