Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes related to sample data updates #523

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()"
Cadair marked this conversation as resolved.
Show resolved Hide resolved
- 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 @@


@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
SolarDrew marked this conversation as resolved.
Show resolved Hide resolved
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
Loading