Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 4 additions & 7 deletions .github/workflows/apptainer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,9 @@ jobs:
with:
python-version: "3.12"

- name: Resolve zenodo checksum for cache key
id: zenodo-record
run: |
DOI=$(grep -oP 'DOI="\K[^"]+' download_data_for_tests.sh)
uv run zenodo_get --doi "${DOI}" --md5 --output-dir /tmp/zenodo-md5
echo "id=$(md5sum /tmp/zenodo-md5/md5sums.txt | cut -d' ' -f1)" >> "$GITHUB_OUTPUT"
- name: Resolve test data revision for cache key
id: test-data-revision
run: echo "id=$(grep -oP 'REVISION="\K[^"]+' download_data_for_tests.sh)" >> "$GITHUB_OUTPUT"

- name: Cache test data
id: cache-test-data
Expand All @@ -62,7 +59,7 @@ jobs:
tests/io/omni/data
tests/io/RBMDataSet/data
tests/io/solar_wind/data
key: zenodo-test-data-${{ steps.zenodo-record.outputs.id }}
key: hf-test-data-${{ steps.test-data-revision.outputs.id }}

- name: Download test data
if: steps.cache-test-data.outputs.cache-hit != 'true'
Expand Down
13 changes: 5 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
enable-cache: true

- name: Set up Python
run: uv python install
run: uv python install 3.12

- name: Install project and ty
run: |
Expand Down Expand Up @@ -66,12 +66,9 @@ jobs:
uv sync --locked
uv pip install coveralls coverage pytest-cov

- name: Resolve zenodo checksum for cache key
id: zenodo-record
run: |
DOI=$(grep -oP 'DOI="\K[^"]+' download_data_for_tests.sh)
uv run zenodo_get --doi "${DOI}" --md5 --output-dir /tmp/zenodo-md5
echo "id=$(md5sum /tmp/zenodo-md5/md5sums.txt | cut -d' ' -f1)" >> "$GITHUB_OUTPUT"
- name: Resolve test data revision for cache key
id: test-data-revision
run: echo "id=$(grep -oP 'REVISION="\K[^"]+' download_data_for_tests.sh)" >> "$GITHUB_OUTPUT"

- name: Cache test data
id: cache-test-data
Expand All @@ -85,7 +82,7 @@ jobs:
tests/io/omni/data
tests/io/RBMDataSet/data
tests/io/solar_wind/data
key: zenodo-test-data-${{ steps.zenodo-record.outputs.id }}
key: hf-test-data-${{ steps.test-data-revision.outputs.id }}

- name: Download test data
if: steps.cache-test-data.outputs.cache-hit != 'true'
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,4 @@ All the above `uv` commands assume you have `uv` installed, if not then remove `

## Test Data

The data used by the test suite is hosted on Zenodo and is not tracked in this repository. Install the `dev` dependency group (`uv sync --group dev`), which pulls in `zenodo_get`, then run `./download_data_for_tests.sh` to fetch and unpack it.
The data used by the test suite is hosted on Hugging Face ([spsw/SWVO-Test-Data](https://huggingface.co/datasets/spsw/SWVO-Test-Data)) and is not tracked in this repository. Run `./download_data_for_tests.sh` (requires `uv`) to fetch it into `tests/io`.
14 changes: 10 additions & 4 deletions download_data_for_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@

set -euo pipefail

DOI="10.5281/zenodo.22983305"
REPO="spsw/SWVO-Test-Data"
REVISION="ee8e705c77d4a80c3895f79466c0c47f3ee6c523"
OUTPUT_DIR="."

uv run zenodo_get --doi "${DOI}" --output-dir "${OUTPUT_DIR}"
unzip -o "${OUTPUT_DIR}/swvo-test-data.zip" -d "${OUTPUT_DIR}"
rm "${OUTPUT_DIR}/swvo-test-data.zip"
uvx --from huggingface_hub hf download "${REPO}" --repo-type dataset --revision "${REVISION}" --local-dir "${OUTPUT_DIR}"

# hf leaves its own bookkeeping behind in the output dir
rm -rf "${OUTPUT_DIR}/.cache"
rm -f "${OUTPUT_DIR}/.gitattributes"

# Hugging Face cannot store empty directories
mkdir -p "${OUTPUT_DIR}/tests/io/kp/data/tmp"
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# SPDX-FileCopyrightText: 2025 GFZ Helmholtz Centre for Geosciences
#
# SPDX-License-Identifier: Apache-2.0
Expand Down Expand Up @@ -135,7 +135,6 @@
"coverage>=7.14.0",
"pytest>=9.0.2",
"pytest-mock>=3.15.1",
"zenodo-get>=3.1.0",
]
docs = [
"sphinx-copybutton",
Expand Down
Loading
Loading