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

pin cf-units, remove github actions test for Python 3.6 and fix test_access1_0 and test_access1_3 to use cf-units for comparisons #1197

Merged
merged 9 commits into from
Jul 7, 2021
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
2 changes: 1 addition & 1 deletion .github/workflows/action-conda-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'macos-latest']
python-version: ["3.6", "3.7", "3.8", "3.9"]
python-version: ["3.7", "3.8", "3.9"]
runs-on: ${{ matrix.os }}
needs: publish
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/action-install-from-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: [3.7, 3.8, 3.9]
# fail-fast set to False allows all other tests
# in the worflow to run regardless of any fail
fail-fast: false
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
runs-on: "macos-latest"
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: [3.7, 3.8, 3.9]
fail-fast: false
name: OSX Python ${{ matrix.python-version }}
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/action-install-from-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: [3.7, 3.8, 3.9]
# fail-fast set to False allows all other tests
# in the worflow to run regardless of any fail
fail-fast: false
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
runs-on: "macos-latest"
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: [3.7, 3.8, 3.9]
fail-fast: false
name: OSX Python ${{ matrix.python-version }}
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/action-install-from-source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: [3.7, 3.8, 3.9]
fail-fast: false
name: Linux Python ${{ matrix.python-version }}
steps:
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
runs-on: "macos-latest"
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: [3.7, 3.8, 3.9]
fail-fast: false
name: OSX Python ${{ matrix.python-version }}
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/action-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: [3.7, 3.8, 3.9]
fail-fast: false
name: Linux Python ${{ matrix.python-version }}
steps:
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
runs-on: "macos-latest"
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: [3.7, 3.8, 3.9]
fail-fast: false
name: OSX Python ${{ matrix.python-version }}
steps:
Expand Down
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ channels:

dependencies:
- cftime # iris=3.0.1 needs <=1.2.1; >=1.3.0 - years<999 get a 0 instead of empty space
- cf-units>=3.0.0
- compilers
- fiona # 1.8.18/py39, they seem weary to build manylinux wheels and pypi ver built with older gdal
- esmpy
Expand Down
2 changes: 1 addition & 1 deletion package/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ requirements:
- scipy<1.6 # until ESMValGroup/ESMValCore/issues/927 gets resolved
# Normally installed via pip:
- cftime # iris=3.0.1 needs <=1.2.1; >=1.3.0 years<999 get a 0 instead of empty space
- cf-units>=2.1.5
- cf-units>=3.0.0
- cython # required by cf-units but not automatically installed
- esmpy
- fiona
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# Installation dependencies
# Use with pip install . to install from source
'install': [
'cf-units>=2.1.5',
'cf-units>=3.0.0',
'dask[array]',
'fiona',
'fire',
Expand Down
6 changes: 4 additions & 2 deletions tests/integration/cmor/_fixes/cmip5/test_access1_0.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ def test_fix_metadata(self):
time = cube.coord('time')
dates = num2date(time.points, time.units.name, time.units.calendar)
self.assertEqual(time.units.calendar, 'gregorian')
self.assertEqual(dates[0], datetime(300, 1, 16, 12, 0))
self.assertEqual(dates[1], datetime(1850, 1, 16, 12, 0))
u = Unit('days since 300-01-01 12:00:00', calendar='gregorian')
self.assertEqual(dates[0], u.num2date(15))
u = Unit('days since 1850-01-01 12:00:00', calendar='gregorian')
self.assertEqual(dates[1], u.num2date(15))

def test_fix_metadata_if_not_time(self):
"""Test calendar fix do not fail if no time coord present."""
Expand Down
6 changes: 4 additions & 2 deletions tests/integration/cmor/_fixes/cmip5/test_access1_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ def test_fix_metadata(self):
time = cube.coord('time')
dates = num2date(time.points, time.units.name, time.units.calendar)
self.assertEqual(time.units.calendar, 'gregorian')
self.assertEqual(dates[0], datetime(300, 1, 16, 12, 0))
self.assertEqual(dates[1], datetime(1850, 1, 16, 12, 0))
u = Unit('days since 300-01-01 12:00:00', calendar='gregorian')
self.assertEqual(dates[0], u.num2date(15))
u = Unit('days since 1850-01-01 12:00:00', calendar='gregorian')
self.assertEqual(dates[1], u.num2date(15))

def test_fix_metadata_if_not_time(self):
"""Test calendar fix do not fail if no time coord present."""
Expand Down