Skip to content

Commit

Permalink
Same again for benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
SolarDrew committed Feb 10, 2025
1 parent 4b455c0 commit 8ba86f6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:
with:
python-version: '3.12'
- run: python -m pip install .[tests] pytest-codspeed 'numpy<2'
- run: python -c "from dkist.data.sample import download_all_sample_data; download_all_sample_data()"
- name: Run benchmarks
uses: CodspeedHQ/action@v3
with:
Expand Down
8 changes: 6 additions & 2 deletions dkist/tests/test_benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,27 @@ def plot_and_save_fig(ds=visp_dataset_no_headers, axes=axes):


@pytest.mark.benchmark
@pytest.mark.remote_data
def test_dataset_compute_data_full_files(benchmark):
"""
Note that although this will load all the files to compute the data, the
file IO overhead is *not* included in codspeed's timing of the benchmark,
because it doesn't support that. This test therefore only assesses the
performance of the compute step.
"""
from dkist.data.sample import VISP_BKPLX
from dkist.data.sample import VISP_BKPLX, download_all_sample_data
download_all_sample_data()

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

View check run for this annotation

Codecov / codecov/patch

dkist/tests/test_benchmarks.py#L52-L53

Added lines #L52 - L53 were not covered by tests
ds = load_dataset(VISP_BKPLX)[0, :15]
benchmark(ds.data.compute)

assert not np.isnan(ds.data.compute()).any()


@pytest.mark.benchmark
@pytest.mark.remote_data
def test_dataset_compute_data_partial_files(benchmark):
from dkist.data.sample import VISP_BKPLX
from dkist.data.sample import VISP_BKPLX, download_all_sample_data
download_all_sample_data()

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

View check run for this annotation

Codecov / codecov/patch

dkist/tests/test_benchmarks.py#L63-L64

Added lines #L63 - L64 were not covered by tests
ds = load_dataset(VISP_BKPLX)[0, :15, :100, :100]
benchmark(ds.data.compute)

Expand Down

0 comments on commit 8ba86f6

Please sign in to comment.