Skip to content

Commit

Permalink
Rework pixel_to_world benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
SolarDrew committed May 15, 2024
1 parent 9ba4964 commit 50eaa92
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions dkist/tests/test_benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@ def test_load_asdf(benchmark, large_visp_dataset_file):


@pytest.mark.benchmark
def test_pixel_to_world(benchmark, large_visp_dataset):
ds = large_visp_dataset
pxcoords = []
for size in ds.wcs.pixel_shape:
pxcoords.append(np.arange(size))

pxcoords = np.mgrid[:ds.wcs.pixel_shape[0]:5,
:ds.wcs.pixel_shape[1]:5,
:ds.wcs.pixel_shape[2]:5]

benchmark(ds.wcs.pixel_to_world_values, *pxcoords, 0)
def test_pixel_to_world(benchmark, visp_dataset_no_headers, large_visp_dataset):
ds = visp_dataset_no_headers

Check warning on line 15 in dkist/tests/test_benchmarks.py

View check run for this annotation

Codecov / codecov/patch

dkist/tests/test_benchmarks.py#L15

Added line #L15 was not covered by tests
# pxcoords2 = []
# for size in ds2.wcs.pixel_shape:
# pxcoords2.append(np.arange(size))

pxcoords = np.mgrid[:ds.wcs.pixel_shape[0]:50,

Check warning on line 20 in dkist/tests/test_benchmarks.py

View check run for this annotation

Codecov / codecov/patch

dkist/tests/test_benchmarks.py#L20

Added line #L20 was not covered by tests
:ds.wcs.pixel_shape[1]:50,
:ds.wcs.pixel_shape[2]:50,
:ds.wcs.pixel_shape[3]:5]

benchmark(ds.wcs.pixel_to_world_values, *pxcoords)

Check warning on line 25 in dkist/tests/test_benchmarks.py

View check run for this annotation

Codecov / codecov/patch

dkist/tests/test_benchmarks.py#L25

Added line #L25 was not covered by tests


@pytest.mark.benchmark(min_rounds=1)
Expand Down

0 comments on commit 50eaa92

Please sign in to comment.