From f7472b467018d8a3bd22c6489e4318f5df8b4268 Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Wed, 2 Oct 2024 15:02:13 -0600 Subject: [PATCH 01/25] Remove duplicate install of testing dependencies --- .github/workflows/test.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index aafd94d..f265a0f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -56,9 +56,6 @@ jobs: run: | pip install -e . - - name: Install testing dependencies - run: mamba install --file=requirements-testing.txt - - name: Test run: | python -c 'import pymt; print(pymt.__version__)' From 748605a7510c9dd7d1fe054a39dec177443ec793 Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Wed, 2 Oct 2024 15:52:14 -0600 Subject: [PATCH 02/25] Require latest version of model_metadata --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 2476dac..11a32bd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ gimli.units>=0.3.2 jinja2 landlab>=2 matplotlib -model_metadata>=0.7 +model_metadata>=0.8 netcdf4 pyyaml scipy<1.9 # see #162 From e6d10fa271d9f8414e0cb4ffc21733fb48e34e05 Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Wed, 2 Oct 2024 15:54:40 -0600 Subject: [PATCH 03/25] Remove obsolete esmpy requirement --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f265a0f..c061c1b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -49,7 +49,6 @@ jobs: - name: Install Unix requirements if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' run: | - mamba install esmpy mamba install pymt_cem pymt_child pymt_hydrotrend pymt_permamodel - name: Build and install package From bfb47fcc99a15f4431b01cb892dc4de64b30b849 Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Wed, 2 Oct 2024 16:08:42 -0600 Subject: [PATCH 04/25] Don't install components for testing The subsequent call to `mamba install` updates *shapely* to 2.0, which breaks the <1.9 requirement from #164. --- .github/workflows/test.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c061c1b..ac7474b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,15 +41,15 @@ jobs: mamba install --file=requirements.txt --file=requirements-testing.txt mamba list - - name: Install Windows requirements - if: matrix.os == 'windows-latest' - run: | - mamba install pymt_child pymt_hydrotrend pymt_permamodel + # - name: Install Windows requirements + # if: matrix.os == 'windows-latest' + # run: | + # mamba install pymt_child pymt_hydrotrend pymt_permamodel - - name: Install Unix requirements - if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' - run: | - mamba install pymt_cem pymt_child pymt_hydrotrend pymt_permamodel + # - name: Install Unix requirements + # if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' + # run: | + # mamba install pymt_cem pymt_child pymt_hydrotrend pymt_permamodel - name: Build and install package run: | From 3a0c43b41176fb181a3f09c937a7abda4d4908af Mon Sep 17 00:00:00 2001 From: mcflugen Date: Wed, 2 Oct 2024 23:28:06 -0600 Subject: [PATCH 05/25] import UnitSystem from gimli.units --- pymt/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pymt/__init__.py b/pymt/__init__.py index 7f79f3f..fd150e8 100644 --- a/pymt/__init__.py +++ b/pymt/__init__.py @@ -1,4 +1,4 @@ -from gimli import UnitSystem +from gimli.units import UnitSystem from ._version import __version__ from .model_collection import ModelCollection From ce9508fce73928ae9240f2e5891f2397e8c115e9 Mon Sep 17 00:00:00 2001 From: mcflugen Date: Wed, 2 Oct 2024 23:30:39 -0600 Subject: [PATCH 06/25] remove redundant gimli.units unit tests --- tests/test_units.py | 213 -------------------------------------------- 1 file changed, 213 deletions(-) diff --git a/tests/test_units.py b/tests/test_units.py index 61066a1..945e082 100644 --- a/tests/test_units.py +++ b/tests/test_units.py @@ -1,222 +1,9 @@ -import os -import random - import numpy as np import pytest -from gimli import IncompatibleUnitsError, UnitFormatting, UnitNameError, UnitStatus -from pymt import UnitSystem from pymt.units import transform_azimuth_to_math, transform_math_to_azimuth -@pytest.fixture -def system(): - os.environ.pop("UDUNITS2_XML_PATH", None) - return UnitSystem() - - -def test_get_xml(): - os.environ.pop("UDUNITS2_XML_PATH", None) - path, status = UnitSystem.get_xml_path() - assert path.is_file() - assert status == UnitStatus.OPEN_DEFAULT - - path, status = UnitSystem.get_xml_path(path) - assert path.is_file() - assert status == UnitStatus.OPEN_ARG - - os.environ["UDUNITS2_XML_PATH"] = str(path) - path, status = UnitSystem.get_xml_path() - assert path.is_file() - assert status == UnitStatus.OPEN_ENV - - -def test_default_system(): - os.environ.pop("UDUNITS2_XML_PATH", None) - system = UnitSystem() - assert system.status == "default" - assert system.database.is_file() - - -def test_user_system(): - path = UnitSystem().database - system = UnitSystem(path) - assert system.status == "user" - assert system.database.is_file() - assert system == UnitSystem() - assert UnitSystem(path) == UnitSystem(str(path)) - - -def test_env_system(system): - os.environ["UDUNITS2_XML_PATH"] = str(system.database) - env_system = UnitSystem() - - assert env_system.status == "env" - assert env_system.database.is_file() - assert str(env_system) == str(system) - assert env_system.database.samefile(system.database) - assert env_system == system - - -def test_system_dimensionless(system): - assert system.dimensionless_unit() == system.Unit("1") - assert str(system.dimensionless_unit()) == "1" - - -def test_system_unit_by_name(system): - assert system.unit_by_name("meter") == system.Unit("m") - assert system.unit_by_name("meters") == system.Unit("m") - assert system.unit_by_name("m") is None - assert system.unit_by_name("meter2") is None - assert system.unit_by_name("not_a_name") is None - - -def test_system_unit_by_symbol(system): - assert system.unit_by_symbol("m") == system.Unit("m") - assert system.unit_by_symbol("km") is None - assert system.unit_by_symbol("meter") is None - assert system.unit_by_symbol("m s-2") is None - assert system.unit_by_symbol("not_a_symbol") is None - - -def test_unit_formatting(system): - unit = system.Unit("0.1 lg(re m/(5 s)^2) @ 50") - assert ( - unit.format(encoding="ascii", formatting=UnitFormatting.NAMES) - == "0.1 lg(re 0.04 meter-second^-2) from 50" - ) - assert ( - unit.format(encoding="ascii", formatting=UnitFormatting.DEFINITIONS) - == "0.1 lg(re 0.04 m.s-2) @ 50" - ) - - assert ( - unit.format(encoding="iso-8859-1", formatting=UnitFormatting.NAMES) - == "0.1 lg(re 0.04 meter/second²) from 50" - ) - assert ( - unit.format(encoding="iso-8859-1", formatting=UnitFormatting.DEFINITIONS) - == "0.1 lg(re 0.04 m/s²) @ 50" - ) - - assert ( - unit.format(encoding="latin-1", formatting=UnitFormatting.NAMES) - == "0.1 lg(re 0.04 meter/second²) from 50" - ) - assert ( - unit.format(encoding="latin-1", formatting=UnitFormatting.DEFINITIONS) - == "0.1 lg(re 0.04 m/s²) @ 50" - ) - - assert ( - unit.format(encoding="utf-8", formatting=UnitFormatting.NAMES) - == "0.1 lg(re 0.04 meter·second⁻²) from 50" - ) - assert ( - unit.format(encoding="utf-8", formatting=UnitFormatting.DEFINITIONS) - == "0.1 lg(re 0.04 m·s⁻²) @ 50" - ) - - -@pytest.mark.parametrize( - ("lhs", "cmp_", "rhs"), - [ - ("m", "lt", "km"), - ("m", "le", "km"), - ("m", "le", "m"), - ("m", "eq", "m"), - ("m", "ne", "km"), - ("km", "ge", "m"), - ("km", "ge", "km"), - ("km", "gt", "m"), - ], -) -def test_unit_comparisons(system, lhs, cmp_, rhs): - compare = getattr(system.Unit(lhs), f"__{cmp_}__") - assert compare(system.Unit(rhs)) - with pytest.raises(TypeError): - compare(rhs) - - -def test_unit_symbol(system): - meters = system.Unit("m") - assert meters.symbol == "m" - - km = system.Unit("km") - assert km.symbol is None - - -def test_unit_name(system): - meters = system.Unit("m") - assert meters.name == "meter" - - km = system.Unit("km") - assert km.name is None - - -def test_unit_is_dimensionless(system): - assert not system.Unit("m").is_dimensionless - assert system.Unit("1").is_dimensionless - assert system.Unit("rad").is_dimensionless - - -def test_unit_is_convertible(system): - assert system.Unit("m").is_convertible_to(system.Unit("km")) - assert not system.Unit("m").is_convertible_to(system.Unit("kg")) - - with pytest.raises(TypeError): - system.Unit("m").is_convertible_to("km") - - -def test_unit_converter_length(system): - meters = system.Unit("m") - km = system.Unit("km") - - assert meters.to(km)(1.0) == pytest.approx(1e-3) - with pytest.raises(TypeError): - meters.to("km") - - m_to_km = meters.to(km) - assert m_to_km(1.0) == pytest.approx(1e-3) - - -def test_unit_converter_time(system): - hours = system.Unit("h") - seconds = system.Unit("s") - hours_to_seconds = hours.to(seconds) - assert hours_to_seconds(1.0) == pytest.approx(3600.0) - - with pytest.raises(TypeError): - hours.to("s") - - -def test_unit_converter_same_units(system): - hours = system.Unit("h") - hours_to_hours = hours.to(system.Unit("h")) - assert hours_to_hours(1.0) == pytest.approx(1.0) - - -@pytest.mark.parametrize( - ("to_", "from_"), - [("not_a_unit", "m"), ("m", "not_a_unit"), ("not_a_unit", "not_a_unit")], -) -def test_unit_converter_bad_from_units(system, to_, from_): - with pytest.raises(UnitNameError): - system.Unit(from_).to(system.Unit(to_)) - - -def test_unit_converter_incompatible_units(system): - with pytest.raises(IncompatibleUnitsError): - system.Unit("s").to(system.Unit("m")) - - -def test_unit_converter_inverse(system): - val = random.random() - seconds_to_hours = system.Unit("s").to(system.Unit("h")) - hours_to_seconds = system.Unit("h").to(system.Unit("s")) - assert hours_to_seconds(seconds_to_hours(val)) == pytest.approx(val) - - def test_math_to_azimuth(): angle = transform_math_to_azimuth(np.pi * 0.5, "rad") assert angle == pytest.approx(0.0) From 556183d688ac22cdfa88a09256449503214c16f8 Mon Sep 17 00:00:00 2001 From: mcflugen Date: Wed, 2 Oct 2024 23:52:12 -0600 Subject: [PATCH 07/25] checkout gimli.units raises UdunitsError --- tests/framework/test_bmi_var_units.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/framework/test_bmi_var_units.py b/tests/framework/test_bmi_var_units.py index d3d5a98..bd85015 100644 --- a/tests/framework/test_bmi_var_units.py +++ b/tests/framework/test_bmi_var_units.py @@ -1,6 +1,6 @@ import numpy as np import pytest -from gimli import IncompatibleUnitsError, UnitNameError +from gimli._udunits2 import UdunitsError from numpy.testing import assert_array_equal from pymt.framework.bmi_bridge import BmiTimeInterpolator, GridMapperMixIn, _BmiCap @@ -64,12 +64,12 @@ def test_unit_conversion(): def test_incompatible_units(): """Test wrapping BMI time methods.""" bmi = Bmi() - with pytest.raises(IncompatibleUnitsError): + with pytest.raises(UdunitsError): bmi.get_value("elevation", units="kg") def test_bad_units(): """Test wrapping BMI time methods.""" bmi = Bmi() - with pytest.raises(UnitNameError): + with pytest.raises(UdunitsError): bmi.get_value("elevation", units="not_real_units") From 4d00331f4443986acb4128abd4789e16675de652 Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Mon, 7 Oct 2024 13:45:18 -0600 Subject: [PATCH 08/25] Consolidate requirements in one install step --- .github/workflows/test-notebooks.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-notebooks.yml b/.github/workflows/test-notebooks.yml index 2654532..19c028e 100644 --- a/.github/workflows/test-notebooks.yml +++ b/.github/workflows/test-notebooks.yml @@ -38,18 +38,16 @@ jobs: - name: Install requirements run: | - mamba install --file=requirements.txt + mamba install \ + --file=requirements.txt + --file=requirements-testing.txt + --file=requirements-notebooks.txt mamba list - name: Build and install package run: | pip install -e . - - name: Install testing dependencies - run: | - mamba install --file=requirements-testing.txt - mamba install --file=requirements-notebooks.txt - - name: Test jupyter notebooks timeout-minutes: 30 run: | From dcc0514b25a6fe75f145cd50d9d630b8d062b530 Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Mon, 7 Oct 2024 13:49:49 -0600 Subject: [PATCH 09/25] Fix typos --- .github/workflows/test-notebooks.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-notebooks.yml b/.github/workflows/test-notebooks.yml index 19c028e..670d7a1 100644 --- a/.github/workflows/test-notebooks.yml +++ b/.github/workflows/test-notebooks.yml @@ -39,8 +39,8 @@ jobs: - name: Install requirements run: | mamba install \ - --file=requirements.txt - --file=requirements-testing.txt + --file=requirements.txt \ + --file=requirements-testing.txt \ --file=requirements-notebooks.txt mamba list From 55ea7d1df9bbc430fd56fb41fbd49b6218b56477 Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Mon, 7 Oct 2024 19:07:23 -0600 Subject: [PATCH 10/25] Roll back model_metadata for older models --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 11a32bd..77c11d1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ gimli.units>=0.3.2 jinja2 landlab>=2 matplotlib -model_metadata>=0.8 +model_metadata<0.8 netcdf4 pyyaml scipy<1.9 # see #162 From 4209cb2307d38ae799b62ff3134296d0f4697f8a Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Tue, 8 Oct 2024 12:54:35 -0600 Subject: [PATCH 11/25] Remove shapely version cap --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 77c11d1..73d38ea 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,7 @@ model_metadata<0.8 netcdf4 pyyaml scipy<1.9 # see #162 -shapely<2 # see #164 +shapely xarray # cfunits # esmpy From 93519d56cd3282791db9f5e60e2dcd897ba1bd7c Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Tue, 8 Oct 2024 13:13:00 -0600 Subject: [PATCH 12/25] Convert shapely proxy object to geometries See https://shapely.readthedocs.io/en/stable/migration.html#other-deprecated-functionality --- pymt/grids/map.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pymt/grids/map.py b/pymt/grids/map.py index ad4d463..61afb1f 100644 --- a/pymt/grids/map.py +++ b/pymt/grids/map.py @@ -46,7 +46,7 @@ """ -from shapely.geometry import Point, asLineString, asPoint, asPolygon +from shapely.geometry import Point, LineString, Polygon from pymt.grids import ( Rectilinear, @@ -84,11 +84,11 @@ def __init__(self, *args, **kwargs): (x, y) = (point_x.take(cell), point_y.take(cell)) if len(x) > 2: - self._polys.append(asPolygon(zip(x, y))) + self._polys.append(Polygon(zip(x, y))) elif len(x) == 2: - self._polys.append(asLineString(zip(x, y))) + self._polys.append(LineString(zip(x, y))) else: - self._polys.append(asPoint(zip(x, y))) + self._polys.append(Point(zip(x, y))) def get_shared_cells(self, point_id): """ From 54db6abcb7eb38d4e5e1e071be2fcc215cc370dd Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Tue, 8 Oct 2024 16:33:03 -0600 Subject: [PATCH 13/25] Remove scipy version cap --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 73d38ea..eb9d65e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,7 +7,7 @@ matplotlib model_metadata<0.8 netcdf4 pyyaml -scipy<1.9 # see #162 +scipy shapely xarray # cfunits From ac77490f56297abc1bcae2c469c7acd272b4e10e Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Tue, 8 Oct 2024 16:34:40 -0600 Subject: [PATCH 14/25] Mark fail when extrapolating with previous and next methods See https://github.com/scipy/scipy/issues/16997#issuecomment-1242811394 --- tests/framework/test_timeinterp.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/framework/test_timeinterp.py b/tests/framework/test_timeinterp.py index ebfcf3c..4c4a838 100644 --- a/tests/framework/test_timeinterp.py +++ b/tests/framework/test_timeinterp.py @@ -81,6 +81,7 @@ def test_interp_between_points(method): @pytest.mark.parametrize("method", TimeInterpolator.METHODS) +@pytest.mark.xfail(condition="pytest.param('next')", raises=AssertionError) def test_interp_outside_range(method): interp = TimeInterpolator( ((0.0, 1.0), (1.0, 2.0), (2.0, 3.0), (3.0, 4.0)), method=method @@ -89,6 +90,7 @@ def test_interp_outside_range(method): @pytest.mark.parametrize("method", TimeInterpolator.METHODS) +@pytest.mark.xfail(condition="pytest.param('previous')", raises=AssertionError) def test_interp_below_range(method): interp = TimeInterpolator( ((0.0, 4.0), (1.0, 3.0), (2.0, 2.0), (3.0, 1.0)), method=method From feef80ef56480b3244f5a5613439bde44a559e52 Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Tue, 8 Oct 2024 16:36:40 -0600 Subject: [PATCH 15/25] Check for AssertionError instead of ValueError --- tests/framework/test_timeinterp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/framework/test_timeinterp.py b/tests/framework/test_timeinterp.py index 4c4a838..acfcfd4 100644 --- a/tests/framework/test_timeinterp.py +++ b/tests/framework/test_timeinterp.py @@ -13,7 +13,7 @@ def test_timeinterp(): def test_timeinterp_with_scalars(): interp = TimeInterpolator(((0.0, 1.0),)) - with raises(ValueError): + with raises(AssertionError): assert interp(0.5) == approx(1.5) interp.add_data(((1.0, 2.0),)) assert interp(0.5) == approx(1.5) From e68392b094e84ab9b8a74638946ef05e8e774976 Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Tue, 8 Oct 2024 17:05:34 -0600 Subject: [PATCH 16/25] Revert "Don't install components for testing" This reverts commit bfb47fcc99a15f4431b01cb892dc4de64b30b849. The shapely version issue is resolved. --- .github/workflows/test.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ac7474b..c061c1b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,15 +41,15 @@ jobs: mamba install --file=requirements.txt --file=requirements-testing.txt mamba list - # - name: Install Windows requirements - # if: matrix.os == 'windows-latest' - # run: | - # mamba install pymt_child pymt_hydrotrend pymt_permamodel + - name: Install Windows requirements + if: matrix.os == 'windows-latest' + run: | + mamba install pymt_child pymt_hydrotrend pymt_permamodel - # - name: Install Unix requirements - # if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' - # run: | - # mamba install pymt_cem pymt_child pymt_hydrotrend pymt_permamodel + - name: Install Unix requirements + if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' + run: | + mamba install pymt_cem pymt_child pymt_hydrotrend pymt_permamodel - name: Build and install package run: | From 9e8e33189f87eebd8eb8660d0c13db46fdf1965d Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Thu, 10 Oct 2024 11:25:21 -0600 Subject: [PATCH 17/25] Limit numpy<2 See #173. --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index eb9d65e..f622fda 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,6 +6,7 @@ landlab>=2 matplotlib model_metadata<0.8 netcdf4 +numpy<2 # see #173 pyyaml scipy shapely From ad59ace47585862f409d99ddbe608913afe5ee10 Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Thu, 10 Oct 2024 11:26:19 -0600 Subject: [PATCH 18/25] Set numpy print options to legacy=1.21 Without this setting, the value of legacy=1.25 was being inherited from Landlab, which isn't allowed in the installed version of numpy<2 (currently 1.26.4). --- pymt/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pymt/__init__.py b/pymt/__init__.py index fd150e8..2758874 100644 --- a/pymt/__init__.py +++ b/pymt/__init__.py @@ -1,8 +1,11 @@ +import numpy as np from gimli.units import UnitSystem from ._version import __version__ from .model_collection import ModelCollection +np.set_printoptions(legacy="1.21") + MODELS = ModelCollection() __all__ = ["__version__", "UnitSystem", "MODELS"] From 4d00e8db0b0a43b36a3ee3edab75cae43d13f2a2 Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Thu, 10 Oct 2024 12:50:38 -0600 Subject: [PATCH 19/25] Add python=3.11 to tests --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c061c1b..b804adb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,7 +20,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ["3.10"] + python-version: ["3.10", "3.11"] steps: - uses: actions/checkout@v4 From 18c4cde9e74b3975aa5c29ccd533ae85981e2851 Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Thu, 10 Oct 2024 13:46:57 -0600 Subject: [PATCH 20/25] Switch from Mambaforge to Miniforge --- .github/workflows/docs.yml | 1 - .github/workflows/test-notebooks.yml | 1 - .github/workflows/test.yml | 1 - 3 files changed, 3 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index db81f91..d541269 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -37,7 +37,6 @@ jobs: - uses: actions/checkout@v2 - uses: conda-incubator/setup-miniconda@v2 with: - miniforge-variant: Mambaforge miniforge-version: latest python-version: 3.8 diff --git a/.github/workflows/test-notebooks.yml b/.github/workflows/test-notebooks.yml index 670d7a1..097f11c 100644 --- a/.github/workflows/test-notebooks.yml +++ b/.github/workflows/test-notebooks.yml @@ -27,7 +27,6 @@ jobs: - uses: conda-incubator/setup-miniconda@v3 with: - miniforge-variant: Mambaforge miniforge-version: latest python-version: ${{ matrix.python-version }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b804adb..4a7ea51 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,7 +27,6 @@ jobs: - uses: conda-incubator/setup-miniconda@v3 with: - miniforge-variant: Mambaforge miniforge-version: latest python-version: ${{ matrix.python-version }} From 3958c95f1a649357590800706a21ea475f1123c2 Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Thu, 10 Oct 2024 13:49:01 -0600 Subject: [PATCH 21/25] Switch from mamba to conda --- .github/workflows/docs.yml | 6 +++--- .github/workflows/test-notebooks.yml | 8 ++++---- .github/workflows/test.yml | 12 ++++++------ 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index d541269..1f1a899 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -42,12 +42,12 @@ jobs: - name: Show conda installation info run: | - mamba info - mamba list + conda info + conda list - name: Install dependencies run: | - mamba install --file=requirements.txt --file=requirements-docs.txt gimli.units + conda install --file=requirements.txt --file=requirements-docs.txt gimli.units pip install -e . - name: Build documentation diff --git a/.github/workflows/test-notebooks.yml b/.github/workflows/test-notebooks.yml index 097f11c..b7361e1 100644 --- a/.github/workflows/test-notebooks.yml +++ b/.github/workflows/test-notebooks.yml @@ -32,16 +32,16 @@ jobs: - name: Show conda installation info run: | - mamba info - mamba list + conda info + conda list - name: Install requirements run: | - mamba install \ + conda install \ --file=requirements.txt \ --file=requirements-testing.txt \ --file=requirements-notebooks.txt - mamba list + conda list - name: Build and install package run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4a7ea51..69c1804 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,23 +32,23 @@ jobs: - name: Show conda installation info run: | - mamba info - mamba list + conda info + conda list - name: Install requirements run: | - mamba install --file=requirements.txt --file=requirements-testing.txt - mamba list + conda install --file=requirements.txt --file=requirements-testing.txt + conda list - name: Install Windows requirements if: matrix.os == 'windows-latest' run: | - mamba install pymt_child pymt_hydrotrend pymt_permamodel + conda install pymt_child pymt_hydrotrend pymt_permamodel - name: Install Unix requirements if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' run: | - mamba install pymt_cem pymt_child pymt_hydrotrend pymt_permamodel + conda install pymt_cem pymt_child pymt_hydrotrend pymt_permamodel - name: Build and install package run: | From 3b50477ff37f67a06ad803a23af36e5dc9c0d6d0 Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Thu, 10 Oct 2024 13:51:26 -0600 Subject: [PATCH 22/25] Update versions of packaged actions --- .github/workflows/black.yml | 4 ++-- .github/workflows/docs.yml | 4 ++-- .github/workflows/flake8.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml index 3eaed36..3344d3e 100644 --- a/.github/workflows/black.yml +++ b/.github/workflows/black.yml @@ -15,8 +15,8 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 - uses: psf/black@stable with: options: "--check --verbose --diff" diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 1f1a899..2210c46 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -34,8 +34,8 @@ jobs: shell: bash -l {0} steps: - - uses: actions/checkout@v2 - - uses: conda-incubator/setup-miniconda@v2 + - uses: actions/checkout@v4 + - uses: conda-incubator/setup-miniconda@v3 with: miniforge-version: latest python-version: 3.8 diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml index 5cb05e1..6e09165 100644 --- a/.github/workflows/flake8.yml +++ b/.github/workflows/flake8.yml @@ -14,9 +14,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python 3.8 - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: 3.8 From 94faa804ef35d152a651acd2418cfd4244461925 Mon Sep 17 00:00:00 2001 From: mcflugen Date: Fri, 11 Oct 2024 10:03:11 -0600 Subject: [PATCH 23/25] install requirements with pip --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 69c1804..99d919f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,7 +37,7 @@ jobs: - name: Install requirements run: | - conda install --file=requirements.txt --file=requirements-testing.txt + pip install -r requirements.txt -r requirements-testing.txt conda list - name: Install Windows requirements From 8c8664be3c2614f2b007651eb24abedbd12f8c41 Mon Sep 17 00:00:00 2001 From: mcflugen Date: Fri, 11 Oct 2024 10:14:17 -0600 Subject: [PATCH 24/25] turn off fail-fast --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 99d919f..c1f4ddd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,6 +18,7 @@ jobs: shell: bash -l {0} strategy: + fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] python-version: ["3.10", "3.11"] From 481f678f4d3fdb21985059be9bccbb8384cc2624 Mon Sep 17 00:00:00 2001 From: mcflugen Date: Fri, 11 Oct 2024 11:00:35 -0600 Subject: [PATCH 25/25] switch back to conda to install requirements --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c1f4ddd..14cfed6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,7 +38,7 @@ jobs: - name: Install requirements run: | - pip install -r requirements.txt -r requirements-testing.txt + conda install --file=requirements.txt --file=requirements-testing.txt conda list - name: Install Windows requirements