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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
32 changes: 32 additions & 0 deletions .github/workflows/apptainer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
- "pyproject.toml"
- "uv.lock"
- "download_daily_files.py"
- "download_data_for_tests.sh"
- ".github/workflows/apptainer.yml"
pull_request:
branches: [main]
Expand All @@ -22,6 +23,7 @@ on:
- "pyproject.toml"
- "uv.lock"
- "download_daily_files.py"
- "download_data_for_tests.sh"
- ".github/workflows/apptainer.yml"
workflow_dispatch:

Expand All @@ -36,6 +38,36 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v7

- name: Install uv
uses: astral-sh/setup-uv@v7
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: Cache test data
id: cache-test-data
uses: actions/cache@v6
with:
path: |
tests/io/dst/data
tests/io/f10_7/data
tests/io/hp/data
tests/io/kp/data
tests/io/omni/data
tests/io/RBMDataSet/data
tests/io/solar_wind/data
key: zenodo-test-data-${{ steps.zenodo-record.outputs.id }}

- name: Download test data
if: steps.cache-test-data.outputs.cache-hit != 'true'
run: ./download_data_for_tests.sh

- name: Get SWVO package version
id: swvo_version
run: |
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,31 @@ 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: Cache test data
id: cache-test-data
uses: actions/cache@v6
with:
path: |
tests/io/dst/data
tests/io/f10_7/data
tests/io/hp/data
tests/io/kp/data
tests/io/omni/data
tests/io/RBMDataSet/data
tests/io/solar_wind/data
key: zenodo-test-data-${{ steps.zenodo-record.outputs.id }}

- name: Download test data
if: steps.cache-test-data.outputs.cache-hit != 'true'
run: ./download_data_for_tests.sh

- name: Run tests
run: uv run python -m coverage run --source swvo -m pytest -rf tests

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ docs/api/*
.nfs*
.env

tests/io/*/data/


**/.DS_Store
*.sif
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,7 @@ uv pip install swvo
```

All the above `uv` commands assume you have `uv` installed, if not then remove `uv` prefix from the commands and run them directly.

## 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.
14 changes: 14 additions & 0 deletions download_data_for_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash
# SPDX-FileCopyrightText: 2026 GFZ Helmholtz Centre for Geosciences
# SPDX-FileContributor: Sahil Jhawar
#
# SPDX-License-Identifier: Apache-2.0

set -euo pipefail

DOI="10.5281/zenodo.22983305"
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"
1 change: 1 addition & 0 deletions 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,6 +135,7 @@
"coverage>=7.14.0",
"pytest>=9.0.2",
"pytest-mock>=3.15.1",
"zenodo-get>=3.1.0",
]
docs = [
"sphinx-copybutton",
Expand Down
Binary file not shown.

This file was deleted.

97 changes: 0 additions & 97 deletions tests/io/dst/data/OMNI_LOW_RES_2012.csv

This file was deleted.

4 changes: 0 additions & 4 deletions tests/io/dst/data/OMNI_LOW_RES_2012.csv.license

This file was deleted.

26 changes: 0 additions & 26 deletions tests/io/dst/data/OMNI_LOW_RES_2013.csv

This file was deleted.

4 changes: 0 additions & 4 deletions tests/io/dst/data/OMNI_LOW_RES_2013.csv.license

This file was deleted.

Loading
Loading