Skip to content

Commit afe2a18

Browse files
committed
Initial commit of basic testing pipeline
1 parent 2bf570e commit afe2a18

15 files changed

+43
-1
lines changed

.github/workflows/ci.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: CI
2+
# Specify which GitHub events will trigger a CI build
3+
4+
on: push
5+
# Define a single job, build
6+
7+
jobs:
8+
build:
9+
# Specify an OS for the runner
10+
runs-on: ubuntu-latest
11+
12+
#Define steps
13+
steps:
14+
15+
# Firstly, checkout repo
16+
- name: Checkout repository
17+
uses: actions/checkout@v2
18+
# Set up Python env
19+
- name: Setup Python
20+
uses: actions/setup-python@v2
21+
with:
22+
python-version: 3.11
23+
# Install dependencies
24+
- name: Install Python dependencies
25+
run: |
26+
python3 -m pip install --upgrade pip
27+
pip3 install -r requirements_dev.txt
28+
pip3 install -e .
29+
# Test with pytest
30+
- name: Run pytest
31+
run: |
32+
pytest

requirements_dev.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ netCDF4==1.6.5
33
h5py==3.11.0
44
dask==2024.7.0
55
cftime==1.6.4
6-
cfunits==3.3.7
6+
cfunits==3.3.7
7+
pytest==7.2.0

tests/__init__.py

Whitespace-only changes.

tests/rain/example0.nc

1 MB
Binary file not shown.

tests/rain/example1.nc

1 MB
Binary file not shown.

tests/rain/example2.nc

1 MB
Binary file not shown.

tests/rain/example3.nc

1 MB
Binary file not shown.

tests/rain/example4.nc

1 MB
Binary file not shown.

tests/rain/example5.nc

1 MB
Binary file not shown.

tests/rain/example6.nc

1 MB
Binary file not shown.

tests/rain/example7.nc

1 MB
Binary file not shown.

tests/rain/example8.nc

1 MB
Binary file not shown.

tests/rain/example9.nc

1 MB
Binary file not shown.

tests/rain/rainmaker.nca

22.6 KB
Binary file not shown.

tests/test_cfa.py

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# All routines for testing CFA general methods.
2+
import xarray as xr
3+
4+
def test_simple():
5+
6+
ds = xr.open_dataset('rain/rainmaker.nca', engine='CFA',
7+
cfa_options={'substitutions':"/home/users/dwest77/Documents/cfa_python_dw/testfiles/:"})
8+
9+
assert 'p' in ds

0 commit comments

Comments
 (0)