Skip to content

Commit

Permalink
remove 3.9 added 3.12 for tests, added testdata files
Browse files Browse the repository at this point in the history
  • Loading branch information
paolap committed Aug 13, 2024
1 parent 13aca23 commit 5534961
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 11 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/mopper-pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ jobs:
strategy:
max-parallel: 5
matrix:
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/[email protected]
- name: Set up Python 3.10
- name: Set up Python 3.10/3.11
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
Expand All @@ -34,10 +34,6 @@ jobs:
environment-file: conda/testenv.yaml
python-version: ${{ matrix.python-version }}
channels: conda-forge
#- name: Add conda to system path
# run: |
# # $CONDA is an environment variable pointing to the root of the miniconda directory
# echo $CONDA/bin >> $GITHUB_PATH
- name: Lint with ruff
shell: bash -el {0}
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/mopper-test-conda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.10", "3.11"i, "3.12"]
steps:
- uses: actions/[email protected]
with:
Expand All @@ -26,12 +26,12 @@ jobs:
uses: conda-incubator/[email protected]
with:
python-version: ${{ matrix.python-version }}
activate-environment: mopper_env
environment-file: conda/environment.yaml # Path to the build conda environment
auto-update-conda: false
auto-activate-base: false
show-channel-urls: true #
- name: Build but do not upload the conda packages
uses: uibcdf/[email protected]
shell: bash -el {0}
with:
meta_yaml_dir: conda
python-version: ${{ matrix.python-version }} # Values previously defined in `matrix`
Expand Down
1 change: 1 addition & 0 deletions conda/environment.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name: mopper_env
channels:
- conda-forge
- coecms
Expand Down
5 changes: 3 additions & 2 deletions tests/test_mopdb_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,14 @@ def test_get_file_frq(caplog):
global dsmulti, dsmulti2, dsonestep, dsonestep2
caplog.set_level(logging.DEBUG, logger='mopdb_log')
umfrq = {'time': 'day', 'time_0': '1hr', 'time_1': '30min'}
int2frq = {'day': 1.0, '1hr': 0.041667, '30min': 0.020833}
# multi time axes in file
ds = xr.open_dataset(dsmulti, decode_times=False)
out = get_file_frq(ds, dsmulti2)
out = get_file_frq(ds, dsmulti2, int2frq)
assert umfrq == out
# only one time axis in file with 1 value
ds = xr.open_dataset(dsonestep, decode_times=False)
out = get_file_frq(ds, dsonestep2)
out = get_file_frq(ds, dsonestep2, int2frq)
umfrq = {'time': 'day'}
assert umfrq == out

Binary file added tests/testdata/multitime.nc
Binary file not shown.
Binary file added tests/testdata/multitime_next.nc
Binary file not shown.
Binary file added tests/testdata/onetstep.nc
Binary file not shown.
Binary file added tests/testdata/onetstep_next.nc
Binary file not shown.

0 comments on commit 5534961

Please sign in to comment.