From ee11725198a3d46df70136685f378dc9886ee289 Mon Sep 17 00:00:00 2001 From: Pascal Bourgault Date: Fri, 10 Jan 2025 15:02:15 -0500 Subject: [PATCH 01/18] Clean added units, publish registry to pint --- src/xclim/core/dataflags.py | 3 +-- src/xclim/core/units.py | 24 ++++++++++++------------ src/xclim/indices/_threshold.py | 6 +++--- src/xclim/indices/fire/_cffwis.py | 2 +- src/xclim/indices/fire/_ffdi.py | 2 +- tests/test_indices.py | 6 +++--- tests/test_units.py | 13 ++----------- 7 files changed, 23 insertions(+), 33 deletions(-) diff --git a/src/xclim/core/dataflags.py b/src/xclim/core/dataflags.py index eb574b91d..54bcba821 100644 --- a/src/xclim/core/dataflags.py +++ b/src/xclim/core/dataflags.py @@ -8,7 +8,6 @@ from __future__ import annotations from collections.abc import Callable, Sequence -from decimal import Decimal from functools import reduce from inspect import signature @@ -674,7 +673,7 @@ def _get_variable_name(function, _kwargs): format_args[arg] = "array" else: val = str2pint(val).magnitude - if Decimal(val) % 1 == 0: + if val == int(val): val = str(int(val)) else: val = str(val).replace(".", "point") diff --git a/src/xclim/core/units.py b/src/xclim/core/units.py index 2bdb233a4..db2797de7 100644 --- a/src/xclim/core/units.py +++ b/src/xclim/core/units.py @@ -64,28 +64,26 @@ units = deepcopy(cf_xarray.units.units) # Changing the default string format for units/quantities. # CF is implemented by cf-xarray, g is the most versatile float format. -# The following try/except logic can be removed when xclim drops support numpy <2.0. +# The following try/except logic can be removed when xclim drops support for pint < 0.24 (i.e. numpy <2.0). try: units.formatter.default_format = "gcf" except UndefinedUnitError: units.default_format = "gcf" -# Switch this flag back to False. Not sure what that implies, but it breaks some tests. -units.force_ndarray_like = False # noqa: F841 -# Another alias not included by cf_xarray -units.define("@alias percent = pct") -# Default context. -null = pint.Context("none") -units.add_context(null) +# CF-xarray forces numpy arrays even for scalar values, not sure why. +# We don't want that in xclim, the magnitude of a scalar is a scalar (float). +units.force_ndarray_like = False # Precipitation units. This is an artificial unit that we're using to verify that a given unit can be converted into -# a precipitation unit. Ideally this could be checked through the `dimensionality`, but I can't get it to work. +# a precipitation unit. It is essentially added for convenience when writing `declare_units` decorators. units.define("[precipitation] = [mass] / [length] ** 2 / [time]") -units.define("mmday = 1 kg / meter ** 2 / day") - units.define("[discharge] = [length] ** 3 / [time]") -units.define("cms = meter ** 3 / second") +# Default context. This is essentially a convenience, so that we can pass a context systemtically to pint's methods. +null = pint.Context("none") +units.add_context(null) + +# Convenience context for common transformation involving liquid water hydro = pint.Context("hydro") hydro.add_transformation( "[mass] / [length]**2", @@ -109,6 +107,8 @@ ) units.add_context(hydro) +# Set as application registry +pint.set_application_registry(units) with (files("xclim.data") / "variables.yml").open() as variables: CF_CONVERSIONS = safe_load(variables)["conversions"] diff --git a/src/xclim/indices/_threshold.py b/src/xclim/indices/_threshold.py index 9f11be29c..90f4c6f30 100644 --- a/src/xclim/indices/_threshold.py +++ b/src/xclim/indices/_threshold.py @@ -2958,7 +2958,7 @@ def maximum_consecutive_tx_days( @declare_units(siconc="[]", areacello="[area]", thresh="[]") def sea_ice_area( - siconc: xarray.DataArray, areacello: xarray.DataArray, thresh: Quantified = "15 pct" + siconc: xarray.DataArray, areacello: xarray.DataArray, thresh: Quantified = "15 %" ) -> xarray.DataArray: """ Total sea ice area. @@ -2989,7 +2989,7 @@ def sea_ice_area( "What is the difference between sea ice area and extent?" - :cite:cts:`nsidc_frequently_2008` """ t = convert_units_to(thresh, siconc) - factor = convert_units_to("100 pct", siconc) + factor = convert_units_to("100 %", siconc) sia = xarray.dot(siconc.where(siconc >= t, 0), areacello) / factor sia = sia.assign_attrs(units=areacello.units) return sia @@ -2997,7 +2997,7 @@ def sea_ice_area( @declare_units(siconc="[]", areacello="[area]", thresh="[]") def sea_ice_extent( - siconc: xarray.DataArray, areacello: xarray.DataArray, thresh: Quantified = "15 pct" + siconc: xarray.DataArray, areacello: xarray.DataArray, thresh: Quantified = "15 %" ) -> xarray.DataArray: """ Total sea ice extent. diff --git a/src/xclim/indices/fire/_cffwis.py b/src/xclim/indices/fire/_cffwis.py index e59dc2cb6..bb2c3a0c6 100644 --- a/src/xclim/indices/fire/_cffwis.py +++ b/src/xclim/indices/fire/_cffwis.py @@ -1397,7 +1397,7 @@ def cffwis_indices( tas = convert_units_to(tas, "C") pr = convert_units_to(pr, "mm/day") sfcWind = convert_units_to(sfcWind, "km/h") - hurs = convert_units_to(hurs, "pct") + hurs = convert_units_to(hurs, "%") if snd is not None: snd = convert_units_to(snd, "m") diff --git a/src/xclim/indices/fire/_ffdi.py b/src/xclim/indices/fire/_ffdi.py index 5c06ee0b2..f8ba04bb1 100644 --- a/src/xclim/indices/fire/_ffdi.py +++ b/src/xclim/indices/fire/_ffdi.py @@ -394,7 +394,7 @@ def mcarthur_forest_fire_danger_index( :cite:cts:`ffdi-noble_1980,ffdi-dowdy_2018,ffdi-holgate_2017` """ tasmax = convert_units_to(tasmax, "C") - hurs = convert_units_to(hurs, "pct") + hurs = convert_units_to(hurs, "%") sfcWind = convert_units_to(sfcWind, "km/h") ffdi = drought_factor**0.987 * np.exp( diff --git a/tests/test_indices.py b/tests/test_indices.py index 22978b49d..3f19466c5 100644 --- a/tests/test_indices.py +++ b/tests/test_indices.py @@ -3255,19 +3255,19 @@ def test_simple(self): np.arange(4).reshape(1, 2, 2), dims=["time", "lat", "lon"], coords={"time": [1], "lat": [-45, 45], "lon": [30, 60]}, - attrs={"units": "mmday"}, + attrs={"units": "mm/day"}, ) tas_baseline = xr.DataArray( np.arange(4).reshape(1, 2, 2), dims=["time", "lat", "lon"], coords={"time": [1], "lat": [-45, 45], "lon": [30, 60]}, - attrs={"units": "C"}, + attrs={"units": "degC"}, ) tas_future = xr.DataArray( np.arange(40).reshape(10, 2, 2), dims=["time_fut", "lat", "lon"], coords={"time_fut": np.arange(10), "lat": [-45, 45], "lon": [30, 60]}, - attrs={"units": "C"}, + attrs={"units": "degC"}, ) delta_tas = tas_future - tas_baseline delta_tas.attrs["units"] = "delta_degC" diff --git a/tests/test_units.py b/tests/test_units.py index a0781ad4e..9307673df 100644 --- a/tests/test_units.py +++ b/tests/test_units.py @@ -43,7 +43,6 @@ def test_hydro(self): with units.context("hydro"): q = 1 * units.kg / units.m**2 / units.s assert q.to("mm/day") == q.to("mm/d") - assert q.to("mmday").magnitude == 24 * 60**2 def test_lat_lon(self): assert 100 * units.degreeN == 100 * units.degree @@ -58,16 +57,13 @@ def test_dimensionality(self): with units.context("hydro"): fu = 1 * units.parse_units("kg / m**2 / s") tu = 1 * units.parse_units("mm / d") - fu.to("mmday") - tu.to("mmday") + fu.to("mm/day") + tu.to("mm/day") def test_fraction(self): q = 5 * units.percent assert q.to("dimensionless") == 0.05 - q = 5 * units.parse_units("pct") - assert q.to("dimensionless") == 0.05 - class TestConvertUnitsTo: def test_deprecation(self, tas_series): @@ -135,9 +131,6 @@ def test_pint2cfunits(self): u = units("percent") assert pint2cfunits(u.units) == "%" - u = units("pct") - assert pint2cfunits(u.units) == "%" - def test_units2pint(self, pr_series): u = units2pint(pr_series([1, 2])) assert pint2cfunits(u) == "kg m-2 s-1" @@ -168,11 +161,9 @@ def test_str2pint(self): class TestCheckUnits: def test_basic(self): check_units("%", "[]") - check_units("pct", "[]") check_units("mm/day", "[precipitation]") check_units("mm/s", "[precipitation]") check_units("kg/m2/s", "[precipitation]") - check_units("cms", "[discharge]") check_units("m3/s", "[discharge]") check_units("m/s", "[speed]") check_units("km/h", "[speed]") From 954bf20c805d0c36b98d7c914bedb6f87ba1fd1f Mon Sep 17 00:00:00 2001 From: Pascal Bourgault Date: Fri, 10 Jan 2025 16:44:11 -0500 Subject: [PATCH 02/18] remove unneeded try-except - ensure cf units are written to cf attributes --- src/xclim/core/indicator.py | 2 +- src/xclim/core/units.py | 17 ++++------------- tests/test_indicators.py | 8 ++++---- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/src/xclim/core/indicator.py b/src/xclim/core/indicator.py index 7d417e2e1..37543fec6 100644 --- a/src/xclim/core/indicator.py +++ b/src/xclim/core/indicator.py @@ -1311,7 +1311,7 @@ def _format( # Add formatting {} around values to be able to replace them with _attrs_mapping using format. for k, v in args.items(): if isinstance(v, units.Quantity): - mba[k] = f"{v:g~P}" + mba[k] = f"{v:gcf}" elif isinstance(v, int | float): mba[k] = f"{v:g}" # TODO: What about InputKind.NUMBER_SEQUENCE diff --git a/src/xclim/core/units.py b/src/xclim/core/units.py index db2797de7..036835d3e 100644 --- a/src/xclim/core/units.py +++ b/src/xclim/core/units.py @@ -22,7 +22,6 @@ import pint import xarray as xr from boltons.funcutils import wraps -from pint import UndefinedUnitError from yaml import safe_load from xclim.core._exceptions import ValidationError @@ -64,20 +63,15 @@ units = deepcopy(cf_xarray.units.units) # Changing the default string format for units/quantities. # CF is implemented by cf-xarray, g is the most versatile float format. -# The following try/except logic can be removed when xclim drops support for pint < 0.24 (i.e. numpy <2.0). -try: - units.formatter.default_format = "gcf" -except UndefinedUnitError: - units.default_format = "gcf" - +units.formatter.default_format = "gcf" # CF-xarray forces numpy arrays even for scalar values, not sure why. # We don't want that in xclim, the magnitude of a scalar is a scalar (float). units.force_ndarray_like = False -# Precipitation units. This is an artificial unit that we're using to verify that a given unit can be converted into -# a precipitation unit. It is essentially added for convenience when writing `declare_units` decorators. +# Define dimensionalities for convenience with the `declare_units` decorator units.define("[precipitation] = [mass] / [length] ** 2 / [time]") units.define("[discharge] = [length] ** 3 / [time]") +units.define("[radiation] = [power] / [length]**2") # Default context. This is essentially a convenience, so that we can pass a context systemtically to pint's methods. null = pint.Context("none") @@ -110,6 +104,7 @@ # Set as application registry pint.set_application_registry(units) + with (files("xclim.data") / "variables.yml").open() as variables: CF_CONVERSIONS = safe_load(variables)["conversions"] _CONVERSIONS = {} @@ -136,10 +131,6 @@ def _func_register(func: Callable) -> Callable: return _func_register -# Radiation units -units.define("[radiation] = [power] / [length]**2") - - def units2pint( value: xr.DataArray | units.Unit | units.Quantity | dict | str, ) -> pint.Unit: diff --git a/tests/test_indicators.py b/tests/test_indicators.py index 8df70f4dd..20f71fdac 100644 --- a/tests/test_indicators.py +++ b/tests/test_indicators.py @@ -564,18 +564,18 @@ def test_formatting(pr_series): # pint 0.10 now pretty print day as d. assert ( out.attrs["long_name"] - == "Number of days with daily precipitation at or above 1 mm/d" + == "Number of days with daily precipitation at or above 1 mm d-1" ) assert out.attrs["description"] in [ - "Annual number of days with daily precipitation at or above 1 mm/d." + "Annual number of days with daily precipitation at or above 1 mm d-1." ] out = atmos.wetdays(pr_series(np.arange(366)), thresh=1.5 * units.mm / units.day) assert ( out.attrs["long_name"] - == "Number of days with daily precipitation at or above 1.5 mm/d" + == "Number of days with daily precipitation at or above 1.5 mm d-1" ) assert out.attrs["description"] in [ - "Annual number of days with daily precipitation at or above 1.5 mm/d." + "Annual number of days with daily precipitation at or above 1.5 mm d-1." ] From d3c24ee9d8eb9b0c02b28651b1a5534ef8dc2813 Mon Sep 17 00:00:00 2001 From: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com> Date: Mon, 13 Jan 2025 16:52:38 -0500 Subject: [PATCH 03/18] Update eco-ci metric badges, use a table, make pr-comments Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com> --- .github/workflows/main.yml | 39 ++++++++++--------- .github/workflows/upstream.yml | 8 ++-- README.rst | 70 +++++++++++++++++++++++++++++++--- 3 files changed, 89 insertions(+), 28 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 353a0014c..e4acb1f18 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -56,7 +56,7 @@ jobs: pypi.org:443 sum.golang.org:443 - name: Start Measurement - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: start-measurement branch: ${{ github.head_ref || github.ref_name }} @@ -74,7 +74,7 @@ jobs: run: | python -m pip install --require-hashes -r CI/requirements_ci.txt - name: Setup Python Measurement - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: get-measurement label: 'Environment setup (Python${{ matrix.python-version }}, lint)' @@ -93,13 +93,13 @@ jobs: run: | python -m tox -e lint - name: Tests measurement - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: get-measurement label: 'Lint (Python${{ matrix.python-version }})' continue-on-error: true - name: Show Energy Results - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: display-results continue-on-error: true @@ -133,7 +133,7 @@ jobs: raw.githubusercontent.com:443 sum.golang.org:443 - name: Start Energy Measurement - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: start-measurement branch: ${{ github.head_ref || github.ref_name }} @@ -151,7 +151,7 @@ jobs: run: | python -m pip install --require-hashes -r CI/requirements_ci.txt - name: Environment Setup Energy Measurement - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: get-measurement label: 'Environment setup (Python${{ matrix.python-version }}, standard)' @@ -171,13 +171,13 @@ jobs: COVERALLS_FLAG_NAME: run-${{ matrix.python-version }}-ubuntu-latest-preliminary COVERALLS_PARALLEL: true - name: Tests measurement - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: get-measurement label: 'Testing with tox (Python${{ matrix.python-version }})' continue-on-error: true - name: Show Energy Results - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: display-results continue-on-error: true @@ -260,7 +260,7 @@ jobs: sum.golang.org:443 - name: Start Energy Measurement if : ${{ matrix.os == 'ubuntu-latest' }} - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: start-measurement branch: ${{ github.head_ref || github.ref_name }} @@ -284,7 +284,7 @@ jobs: python -m pip install --require-hashes -r CI/requirements_ci.txt - name: Environment Setup Energy Measurement if : ${{ matrix.os == 'ubuntu-latest' }} - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: get-measurement label: 'Environment setup (Python${{ matrix.python-version }}, ${{ matrix.tox-env }})' @@ -316,14 +316,14 @@ jobs: COVERALLS_PARALLEL: true - name: Tests measurement if : ${{ matrix.os == 'ubuntu-latest' }} - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: get-measurement label: 'Testing with tox (Python${{ matrix.python-version }}, ${{ matrix.tox-env }})' continue-on-error: true - name: Show Energy Results if : ${{ matrix.os == 'ubuntu-latest' }} - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: display-results continue-on-error: true @@ -366,7 +366,7 @@ jobs: raw.githubusercontent.com:443 sum.golang.org:443 - name: Start Energy Measurement - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: start-measurement branch: ${{ github.head_ref || github.ref_name }} @@ -398,7 +398,7 @@ jobs: xclim show_version_info python -m pip check || true - name: Environment Setup Energy Measurement - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: get-measurement label: 'Environment setup (conda, Python${{ matrix.python-version }})' @@ -414,13 +414,13 @@ jobs: COVERALLS_FLAG_NAME: run-{{ matrix.python-version }}-conda COVERALLS_PARALLEL: true - name: Tests measurement - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: get-measurement label: 'Testing with pytest (conda, Python${{ matrix.python-version }})' continue-on-error: true - name: Show Energy Results - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: display-results continue-on-error: true @@ -454,7 +454,7 @@ jobs: pypi.org:443 sum.golang.org:443 - name: Start Energy Measurement - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: start-measurement branch: ${{ github.head_ref || github.ref_name }} @@ -464,13 +464,14 @@ jobs: with: parallel-finished: true - name: Finish measurement - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: get-measurement label: 'Finish Run' continue-on-error: true - name: Show Energy Results - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: display-results + pr-comment: true continue-on-error: true diff --git a/.github/workflows/upstream.yml b/.github/workflows/upstream.yml index 3d21ebaa6..9651cff98 100644 --- a/.github/workflows/upstream.yml +++ b/.github/workflows/upstream.yml @@ -61,7 +61,7 @@ jobs: repo.anaconda.com:443 sum.golang.org:443 - name: Start Measurement - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: start-measurement branch: ${{ github.head_ref || github.ref_name }} @@ -98,7 +98,7 @@ jobs: xclim show_version_info python -m pip check || true - name: Setup Python Measurement - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: get-measurement label: 'Environment Setup (Upstream, Python${{ matrix.python-version }})' @@ -125,13 +125,13 @@ jobs: issue-title: "⚠️ Nightly upstream-dev CI failed for Python${{ matrix.python-version }} ⚠️" log-path: output-${{ matrix.python-version }}-log.jsonl - name: Tests measurement - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: get-measurement label: 'Testing and Reporting (Upstream, Python${{ matrix.python-version }})' continue-on-error: true - name: Show Energy Results - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: display-results continue-on-error: true diff --git a/README.rst b/README.rst index b56a3ff32..21eac466f 100644 --- a/README.rst +++ b/README.rst @@ -11,9 +11,21 @@ xclim: Climate services library |logo| |logo-dark| |logo-light| +----------------------------+-----------------------------------------------------+ | Coding Standards | |black| |ruff| |pre-commit| |ossf-bp| |fossa| | +----------------------------+-----------------------------------------------------+ -| Development Status | |status| |build| |coveralls| |energy| | +| Development Status | |status| |build| |coveralls| | +----------------------------+-----------------------------------------------------+ ++----------------------------------------------------------------------------------------------+ +| `ECO-CI`_ Energy Consumption and Carbon Emissions from CI (since November 2024) | ++------------------+----------------+----------------------------------------------------------+ +| Energy Usage | (main.yml) | |energy-last-mn| |energy-average-mn| |energy-total-mn| | +| +----------------+----------------------------------------------------------+ +| | (upstream.yml) | |energy-last-up| |energy-average-up| |energy-total-up| | ++------------------+----------------+----------------------------------------------------------+ +| Carbon Emissions | (main.yml) | |carbon-last-mn| |carbon-average-mn| |carbon-total-mn| | +| (estimated) +----------------+----------------------------------------------------------+ +| | (upstream.yml) | |carbon-last-up| |carbon-average-up| |carbon-total-up| | ++------------------+----------------+----------------------------------------------------------+ + `xclim` is an operational Python library for climate services, providing numerous climate-related indicator tools with an extensible framework for constructing custom climate indicators, statistical downscaling and bias adjustment of climate model simulations, as well as climate model ensemble analysis tools. @@ -120,6 +132,7 @@ This package was created with Cookiecutter_ and the `audreyfeldroy/cookiecutter- .. _CFI: https://www.innovation.ca/ .. _Cookiecutter: https://github.com/cookiecutter/cookiecutter/ .. _ECCC: https://www.canada.ca/en/environment-climate-change.html +.. _ECO-CI: https://www.green-coding.io/ .. _FECC: https://www.environnement.gouv.qc.ca/ministere/fonds-electrification-changements-climatiques/index.htm .. _Fonds vert: https://www.environnement.gouv.qc.ca/ministere/fonds-vert/index.htm .. _FRQ: https://frq.gouv.qc.ca/ @@ -169,10 +182,6 @@ This package was created with Cookiecutter_ and the `audreyfeldroy/cookiecutter- :target: https://bestpractices.coreinfrastructure.org/projects/6041 :alt: Open Source Security Foundation Best Practices -.. |energy| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=47013755 - :target: https://metrics.green-coding.io/ci.html?repo=Ouranosinc/xclim&branch=main&workflow=47013755 - :alt: Energy Consumption - .. |ossf-score| image:: https://api.securityscorecards.dev/projects/github.com/Ouranosinc/xclim/badge :target: https://securityscorecards.dev/viewer/?uri=github.com/Ouranosinc/xclim :alt: Open Source Security Foundation Scorecard @@ -215,3 +224,54 @@ This package was created with Cookiecutter_ and the `audreyfeldroy/cookiecutter- .. |versions| image:: https://img.shields.io/pypi/pyversions/xclim.svg :target: https://pypi.python.org/pypi/xclim :alt: Supported Python Versions + +.. + Energy Metrics by https://github.com/green-coding-solutions/eco-ci-energy-estimation + +.. |energy-total-mn| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=5828641&mode=totals + :target: https://metrics.green-coding.io/ci.html?repo=Ouranosinc/xclim&branch=main&workflow=5828641 + :alt: Energy Consumption (Total) + +.. |energy-last-mn| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=5828641 + :target: https://metrics.green-coding.io/ci.html?repo=Ouranosinc/xclim&branch=main&workflow=5828641 + :alt: Energy Consumption (Last run) + +.. |energy-average-mn| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=5828641&mode=avg&duration_days=90 + :target: https://metrics.green-coding.io/ci.html?repo=Ouranosinc/xclim&branch=main&workflow=5828641 + :alt: Energy Consumption (Last 90 days moving average) + +.. |carbon-total-mn| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=5828641&mode=totals&metric=carbon + :target: https://metrics.green-coding.io/ci.html?repo=Ouranosinc/xclim&branch=festive-indices&workflow=5828641 + :alt: Carbon Emissions (Total) + +.. |carbon-last-mn| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=5828641&metric=carbon + :target: https://metrics.green-coding.io/ci.html?repo=Ouranosinc/xclim&branch=main&workflow=5828641 + :alt: Carbon Emissions (Last run) + +.. |carbon-average-mn| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=5828641&mode=avg&duration_days=90&metric=carbon + :target: https://metrics.green-coding.io/ci.html?repo=Ouranosinc/xclim&branch=main&workflow=5828641 + :alt: Carbon Emissions (Last 90 days moving average) + +.. |energy-total-up| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=51773173&mode=totals + :target: https://metrics.green-coding.io/ci.html?repo=Ouranosinc/xclim&branch=main&workflow=51773173 + :alt: Energy Consumption (Total) + +.. |energy-last-up| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=51773173 + :target: https://metrics.green-coding.io/ci.html?repo=Ouranosinc/xclim&branch=main&workflow=51773173 + :alt: Energy Consumption (Last run) + +.. |energy-average-up| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=51773173&mode=avg&duration_days=90 + :target: https://metrics.green-coding.io/ci.html?repo=Ouranosinc/xclim&branch=main&workflow=51773173 + :alt: Energy Consumption (Last 90 days moving average) + +.. |carbon-total-up| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=51773173&mode=totals&metric=carbon + :target: https://metrics.green-coding.io/ci.html?repo=Ouranosinc/xclim&branch=festive-indices&workflow=51773173 + :alt: Carbon Emissions (Total) + +.. |carbon-last-up| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=51773173&metric=carbon + :target: https://metrics.green-coding.io/ci.html?repo=Ouranosinc/xclim&branch=main&workflow=51773173 + :alt: Carbon Emissions (Last run) + +.. |carbon-average-up| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=51773173&mode=avg&duration_days=90&metric=carbon + :target: https://metrics.green-coding.io/ci.html?repo=Ouranosinc/xclim&branch=main&workflow=51773173 + :alt: Carbon Emissions (Last 90 days moving average) From 689303bd6ecc94ee86de06158e79a34deae95ea6 Mon Sep 17 00:00:00 2001 From: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com> Date: Mon, 13 Jan 2025 16:52:38 -0500 Subject: [PATCH 04/18] Update eco-ci metric badges, use a table, make pr-comments Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com> --- .github/workflows/main.yml | 39 ++++++++++--------- .github/workflows/upstream.yml | 8 ++-- README.rst | 70 +++++++++++++++++++++++++++++++--- 3 files changed, 89 insertions(+), 28 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 353a0014c..e4acb1f18 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -56,7 +56,7 @@ jobs: pypi.org:443 sum.golang.org:443 - name: Start Measurement - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: start-measurement branch: ${{ github.head_ref || github.ref_name }} @@ -74,7 +74,7 @@ jobs: run: | python -m pip install --require-hashes -r CI/requirements_ci.txt - name: Setup Python Measurement - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: get-measurement label: 'Environment setup (Python${{ matrix.python-version }}, lint)' @@ -93,13 +93,13 @@ jobs: run: | python -m tox -e lint - name: Tests measurement - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: get-measurement label: 'Lint (Python${{ matrix.python-version }})' continue-on-error: true - name: Show Energy Results - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: display-results continue-on-error: true @@ -133,7 +133,7 @@ jobs: raw.githubusercontent.com:443 sum.golang.org:443 - name: Start Energy Measurement - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: start-measurement branch: ${{ github.head_ref || github.ref_name }} @@ -151,7 +151,7 @@ jobs: run: | python -m pip install --require-hashes -r CI/requirements_ci.txt - name: Environment Setup Energy Measurement - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: get-measurement label: 'Environment setup (Python${{ matrix.python-version }}, standard)' @@ -171,13 +171,13 @@ jobs: COVERALLS_FLAG_NAME: run-${{ matrix.python-version }}-ubuntu-latest-preliminary COVERALLS_PARALLEL: true - name: Tests measurement - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: get-measurement label: 'Testing with tox (Python${{ matrix.python-version }})' continue-on-error: true - name: Show Energy Results - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: display-results continue-on-error: true @@ -260,7 +260,7 @@ jobs: sum.golang.org:443 - name: Start Energy Measurement if : ${{ matrix.os == 'ubuntu-latest' }} - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: start-measurement branch: ${{ github.head_ref || github.ref_name }} @@ -284,7 +284,7 @@ jobs: python -m pip install --require-hashes -r CI/requirements_ci.txt - name: Environment Setup Energy Measurement if : ${{ matrix.os == 'ubuntu-latest' }} - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: get-measurement label: 'Environment setup (Python${{ matrix.python-version }}, ${{ matrix.tox-env }})' @@ -316,14 +316,14 @@ jobs: COVERALLS_PARALLEL: true - name: Tests measurement if : ${{ matrix.os == 'ubuntu-latest' }} - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: get-measurement label: 'Testing with tox (Python${{ matrix.python-version }}, ${{ matrix.tox-env }})' continue-on-error: true - name: Show Energy Results if : ${{ matrix.os == 'ubuntu-latest' }} - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: display-results continue-on-error: true @@ -366,7 +366,7 @@ jobs: raw.githubusercontent.com:443 sum.golang.org:443 - name: Start Energy Measurement - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: start-measurement branch: ${{ github.head_ref || github.ref_name }} @@ -398,7 +398,7 @@ jobs: xclim show_version_info python -m pip check || true - name: Environment Setup Energy Measurement - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: get-measurement label: 'Environment setup (conda, Python${{ matrix.python-version }})' @@ -414,13 +414,13 @@ jobs: COVERALLS_FLAG_NAME: run-{{ matrix.python-version }}-conda COVERALLS_PARALLEL: true - name: Tests measurement - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: get-measurement label: 'Testing with pytest (conda, Python${{ matrix.python-version }})' continue-on-error: true - name: Show Energy Results - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: display-results continue-on-error: true @@ -454,7 +454,7 @@ jobs: pypi.org:443 sum.golang.org:443 - name: Start Energy Measurement - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: start-measurement branch: ${{ github.head_ref || github.ref_name }} @@ -464,13 +464,14 @@ jobs: with: parallel-finished: true - name: Finish measurement - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: get-measurement label: 'Finish Run' continue-on-error: true - name: Show Energy Results - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: display-results + pr-comment: true continue-on-error: true diff --git a/.github/workflows/upstream.yml b/.github/workflows/upstream.yml index 3d21ebaa6..9651cff98 100644 --- a/.github/workflows/upstream.yml +++ b/.github/workflows/upstream.yml @@ -61,7 +61,7 @@ jobs: repo.anaconda.com:443 sum.golang.org:443 - name: Start Measurement - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: start-measurement branch: ${{ github.head_ref || github.ref_name }} @@ -98,7 +98,7 @@ jobs: xclim show_version_info python -m pip check || true - name: Setup Python Measurement - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: get-measurement label: 'Environment Setup (Upstream, Python${{ matrix.python-version }})' @@ -125,13 +125,13 @@ jobs: issue-title: "⚠️ Nightly upstream-dev CI failed for Python${{ matrix.python-version }} ⚠️" log-path: output-${{ matrix.python-version }}-log.jsonl - name: Tests measurement - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: get-measurement label: 'Testing and Reporting (Upstream, Python${{ matrix.python-version }})' continue-on-error: true - name: Show Energy Results - uses: green-coding-solutions/eco-ci-energy-estimation@86f1b2ee12db687bca0d15160a529bb64a7b60d9 # v4.0.0 + uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: display-results continue-on-error: true diff --git a/README.rst b/README.rst index b56a3ff32..21eac466f 100644 --- a/README.rst +++ b/README.rst @@ -11,9 +11,21 @@ xclim: Climate services library |logo| |logo-dark| |logo-light| +----------------------------+-----------------------------------------------------+ | Coding Standards | |black| |ruff| |pre-commit| |ossf-bp| |fossa| | +----------------------------+-----------------------------------------------------+ -| Development Status | |status| |build| |coveralls| |energy| | +| Development Status | |status| |build| |coveralls| | +----------------------------+-----------------------------------------------------+ ++----------------------------------------------------------------------------------------------+ +| `ECO-CI`_ Energy Consumption and Carbon Emissions from CI (since November 2024) | ++------------------+----------------+----------------------------------------------------------+ +| Energy Usage | (main.yml) | |energy-last-mn| |energy-average-mn| |energy-total-mn| | +| +----------------+----------------------------------------------------------+ +| | (upstream.yml) | |energy-last-up| |energy-average-up| |energy-total-up| | ++------------------+----------------+----------------------------------------------------------+ +| Carbon Emissions | (main.yml) | |carbon-last-mn| |carbon-average-mn| |carbon-total-mn| | +| (estimated) +----------------+----------------------------------------------------------+ +| | (upstream.yml) | |carbon-last-up| |carbon-average-up| |carbon-total-up| | ++------------------+----------------+----------------------------------------------------------+ + `xclim` is an operational Python library for climate services, providing numerous climate-related indicator tools with an extensible framework for constructing custom climate indicators, statistical downscaling and bias adjustment of climate model simulations, as well as climate model ensemble analysis tools. @@ -120,6 +132,7 @@ This package was created with Cookiecutter_ and the `audreyfeldroy/cookiecutter- .. _CFI: https://www.innovation.ca/ .. _Cookiecutter: https://github.com/cookiecutter/cookiecutter/ .. _ECCC: https://www.canada.ca/en/environment-climate-change.html +.. _ECO-CI: https://www.green-coding.io/ .. _FECC: https://www.environnement.gouv.qc.ca/ministere/fonds-electrification-changements-climatiques/index.htm .. _Fonds vert: https://www.environnement.gouv.qc.ca/ministere/fonds-vert/index.htm .. _FRQ: https://frq.gouv.qc.ca/ @@ -169,10 +182,6 @@ This package was created with Cookiecutter_ and the `audreyfeldroy/cookiecutter- :target: https://bestpractices.coreinfrastructure.org/projects/6041 :alt: Open Source Security Foundation Best Practices -.. |energy| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=47013755 - :target: https://metrics.green-coding.io/ci.html?repo=Ouranosinc/xclim&branch=main&workflow=47013755 - :alt: Energy Consumption - .. |ossf-score| image:: https://api.securityscorecards.dev/projects/github.com/Ouranosinc/xclim/badge :target: https://securityscorecards.dev/viewer/?uri=github.com/Ouranosinc/xclim :alt: Open Source Security Foundation Scorecard @@ -215,3 +224,54 @@ This package was created with Cookiecutter_ and the `audreyfeldroy/cookiecutter- .. |versions| image:: https://img.shields.io/pypi/pyversions/xclim.svg :target: https://pypi.python.org/pypi/xclim :alt: Supported Python Versions + +.. + Energy Metrics by https://github.com/green-coding-solutions/eco-ci-energy-estimation + +.. |energy-total-mn| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=5828641&mode=totals + :target: https://metrics.green-coding.io/ci.html?repo=Ouranosinc/xclim&branch=main&workflow=5828641 + :alt: Energy Consumption (Total) + +.. |energy-last-mn| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=5828641 + :target: https://metrics.green-coding.io/ci.html?repo=Ouranosinc/xclim&branch=main&workflow=5828641 + :alt: Energy Consumption (Last run) + +.. |energy-average-mn| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=5828641&mode=avg&duration_days=90 + :target: https://metrics.green-coding.io/ci.html?repo=Ouranosinc/xclim&branch=main&workflow=5828641 + :alt: Energy Consumption (Last 90 days moving average) + +.. |carbon-total-mn| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=5828641&mode=totals&metric=carbon + :target: https://metrics.green-coding.io/ci.html?repo=Ouranosinc/xclim&branch=festive-indices&workflow=5828641 + :alt: Carbon Emissions (Total) + +.. |carbon-last-mn| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=5828641&metric=carbon + :target: https://metrics.green-coding.io/ci.html?repo=Ouranosinc/xclim&branch=main&workflow=5828641 + :alt: Carbon Emissions (Last run) + +.. |carbon-average-mn| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=5828641&mode=avg&duration_days=90&metric=carbon + :target: https://metrics.green-coding.io/ci.html?repo=Ouranosinc/xclim&branch=main&workflow=5828641 + :alt: Carbon Emissions (Last 90 days moving average) + +.. |energy-total-up| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=51773173&mode=totals + :target: https://metrics.green-coding.io/ci.html?repo=Ouranosinc/xclim&branch=main&workflow=51773173 + :alt: Energy Consumption (Total) + +.. |energy-last-up| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=51773173 + :target: https://metrics.green-coding.io/ci.html?repo=Ouranosinc/xclim&branch=main&workflow=51773173 + :alt: Energy Consumption (Last run) + +.. |energy-average-up| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=51773173&mode=avg&duration_days=90 + :target: https://metrics.green-coding.io/ci.html?repo=Ouranosinc/xclim&branch=main&workflow=51773173 + :alt: Energy Consumption (Last 90 days moving average) + +.. |carbon-total-up| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=51773173&mode=totals&metric=carbon + :target: https://metrics.green-coding.io/ci.html?repo=Ouranosinc/xclim&branch=festive-indices&workflow=51773173 + :alt: Carbon Emissions (Total) + +.. |carbon-last-up| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=51773173&metric=carbon + :target: https://metrics.green-coding.io/ci.html?repo=Ouranosinc/xclim&branch=main&workflow=51773173 + :alt: Carbon Emissions (Last run) + +.. |carbon-average-up| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=51773173&mode=avg&duration_days=90&metric=carbon + :target: https://metrics.green-coding.io/ci.html?repo=Ouranosinc/xclim&branch=main&workflow=51773173 + :alt: Carbon Emissions (Last 90 days moving average) From 8465a7f8c91756746f42b3c80c68ae1a1eeec656 Mon Sep 17 00:00:00 2001 From: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com> Date: Mon, 13 Jan 2025 17:04:00 -0500 Subject: [PATCH 05/18] updates table organisation and CHANGELOG.rst Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com> --- CHANGELOG.rst | 1 + README.rst | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index ae619b740..f5c0633df 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -9,6 +9,7 @@ Contributors to this version: Juliette Lavoie (:user:`juliettelavoie`) New features and enhancements ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ * New function ``ensemble.partition.general_partition`` (:pull:`2035`) +* `xclim` now tracks energy usage and carbon emissions (last run, averages, and totals) during CI workflows using the `eco-ci-energy-estimation` GitHub Action. (:pull:`2046`). v0.54.0 (2024-12-16) -------------------- diff --git a/README.rst b/README.rst index 21eac466f..e8614fc26 100644 --- a/README.rst +++ b/README.rst @@ -14,17 +14,17 @@ xclim: Climate services library |logo| |logo-dark| |logo-light| | Development Status | |status| |build| |coveralls| | +----------------------------+-----------------------------------------------------+ -+----------------------------------------------------------------------------------------------+ -| `ECO-CI`_ Energy Consumption and Carbon Emissions from CI (since November 2024) | -+------------------+----------------+----------------------------------------------------------+ -| Energy Usage | (main.yml) | |energy-last-mn| |energy-average-mn| |energy-total-mn| | -| +----------------+----------------------------------------------------------+ -| | (upstream.yml) | |energy-last-up| |energy-average-up| |energy-total-up| | -+------------------+----------------+----------------------------------------------------------+ -| Carbon Emissions | (main.yml) | |carbon-last-mn| |carbon-average-mn| |carbon-total-mn| | -| (estimated) +----------------+----------------------------------------------------------+ -| | (upstream.yml) | |carbon-last-up| |carbon-average-up| |carbon-total-up| | -+------------------+----------------+----------------------------------------------------------+ ++------------------------------------------------------------------------------------------------+ +| `ECO-CI`_ Energy Consumption and Carbon Emissions from CI (since November 2024) | ++------------------+------------------+----------------------------------------------------------+ +| | Energy Usage | |energy-last-mn| |energy-average-mn| |energy-total-mn| | +| Main Branch +------------------+----------------------------------------------------------+ +| | Carbon Emissions | |carbon-last-mn| |carbon-average-mn| |carbon-total-mn| | ++------------------+------------------+----------------------------------------------------------+ +| | Energy Usage | |energy-last-up| |energy-average-up| |energy-total-up| | +| Upstream Testing +------------------+----------------------------------------------------------+ +| | Carbon Emissions | |carbon-last-up| |carbon-average-up| |carbon-total-up| | ++------------------+------------------+----------------------------------------------------------+ `xclim` is an operational Python library for climate services, providing numerous climate-related indicator tools with an extensible framework for constructing custom climate indicators, statistical downscaling and bias From 7441ef46c709cd28323207eeee250ad8f4b3dbba Mon Sep 17 00:00:00 2001 From: Pascal Bourgault Date: Wed, 15 Jan 2025 16:49:35 -0500 Subject: [PATCH 06/18] Update tests/test_units.py Co-authored-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com> --- tests/test_units.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_units.py b/tests/test_units.py index 9307673df..0da070b11 100644 --- a/tests/test_units.py +++ b/tests/test_units.py @@ -58,7 +58,6 @@ def test_dimensionality(self): fu = 1 * units.parse_units("kg / m**2 / s") tu = 1 * units.parse_units("mm / d") fu.to("mm/day") - tu.to("mm/day") def test_fraction(self): q = 5 * units.percent From 3b456854d847d218d40013b40721aaf1003ffdc5 Mon Sep 17 00:00:00 2001 From: Pascal Bourgault Date: Wed, 15 Jan 2025 16:55:39 -0500 Subject: [PATCH 07/18] Update test_units.py --- tests/test_units.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_units.py b/tests/test_units.py index 0da070b11..fbffbf391 100644 --- a/tests/test_units.py +++ b/tests/test_units.py @@ -54,9 +54,9 @@ def test_pcic(self): np.isclose(1 * fu, 1 * tu) def test_dimensionality(self): + # Check that the hydro context allows flux to rate conversion with units.context("hydro"): fu = 1 * units.parse_units("kg / m**2 / s") - tu = 1 * units.parse_units("mm / d") fu.to("mm/day") def test_fraction(self): From 0edd0cf99dd82e04ea81f6fb4382ae8ab3ebea98 Mon Sep 17 00:00:00 2001 From: Zeitsperre <10819524+Zeitsperre@users.noreply.github.com> Date: Thu, 16 Jan 2025 11:28:51 -0500 Subject: [PATCH 08/18] simplify table and move it to its own section lower in the README.rst Signed-off-by: Zeitsperre <10819524+Zeitsperre@users.noreply.github.com> --- README.rst | 65 ++++++++++++++++++------------------------------------ 1 file changed, 21 insertions(+), 44 deletions(-) diff --git a/README.rst b/README.rst index e8614fc26..05a2369a9 100644 --- a/README.rst +++ b/README.rst @@ -14,25 +14,13 @@ xclim: Climate services library |logo| |logo-dark| |logo-light| | Development Status | |status| |build| |coveralls| | +----------------------------+-----------------------------------------------------+ -+------------------------------------------------------------------------------------------------+ -| `ECO-CI`_ Energy Consumption and Carbon Emissions from CI (since November 2024) | -+------------------+------------------+----------------------------------------------------------+ -| | Energy Usage | |energy-last-mn| |energy-average-mn| |energy-total-mn| | -| Main Branch +------------------+----------------------------------------------------------+ -| | Carbon Emissions | |carbon-last-mn| |carbon-average-mn| |carbon-total-mn| | -+------------------+------------------+----------------------------------------------------------+ -| | Energy Usage | |energy-last-up| |energy-average-up| |energy-total-up| | -| Upstream Testing +------------------+----------------------------------------------------------+ -| | Carbon Emissions | |carbon-last-up| |carbon-average-up| |carbon-total-up| | -+------------------+------------------+----------------------------------------------------------+ - `xclim` is an operational Python library for climate services, providing numerous climate-related indicator tools with an extensible framework for constructing custom climate indicators, statistical downscaling and bias adjustment of climate model simulations, as well as climate model ensemble analysis tools. `xclim` is built using `xarray`_ and can seamlessly benefit from the parallelization handling provided by `dask`_. Its objective is to make it as simple as possible for users to perform typical climate services data treatment workflows. -Leveraging xarray and dask, users can easily bias-adjust climate simulations over large spatial domains or compute indices from large climate datasets. +Leveraging `xarray` and `dask`, users can easily bias-adjust climate simulations over large spatial domains or compute indices from large climate datasets. For example, the following would compute monthly mean temperature from daily mean temperature: @@ -44,7 +32,7 @@ For example, the following would compute monthly mean temperature from daily mea ds = xr.open_dataset(filename) tg = xclim.atmos.tg_mean(ds.tas, freq="MS") -For applications where metadata and missing values are important to get right, xclim provides a class for each index +For applications where metadata and missing values are important to get right, `xclim` provides a class for each index that validates inputs, checks for missing values, converts units and assigns metadata attributes to the output. This also provides a mechanism for users to customize the indices to their own specifications and preferences. `xclim` currently provides over 150 indices related to mean, minimum and maximum daily temperature, daily precipitation, @@ -122,6 +110,19 @@ This is free software: you can redistribute it and/or modify it under the terms .. _Apache License 2.0: https://opensource.org/license/apache-2-0/ .. _LICENSE: https://github.com/Ouranosinc/xclim/blob/main/LICENSE +Energy and Carbon Usage +----------------------- +The `xclim` development team is interested in thoroughly testing our software while also reducing the environmental impact of the software we develop. +This repository uses the `ECO-CI`_ tool to estimate and track the energy use and carbon emissions of our continuous integration workflows. + ++---------------------------------------------------------------------------------------+ +| `ECO-CI`_ Energy Use and Carbon Emissions from CI Workflows (since November 2024) | ++------------------+------------------+-------------------------------------------------+ +| Testing suite | Energy Usage | |energy-last| |energy-average| |energy-total| | +| +------------------+-------------------------------------------------+ +| (*main* branch) | Carbon Emissions | |carbon-last| |carbon-average| |carbon-total| | ++------------------+------------------+-------------------------------------------------+ + Credits ------- `xclim` development is funded through Ouranos_, Environment and Climate Change Canada (ECCC_), the `Fonds vert`_ and the Fonds d'électrification et de changements climatiques (FECC_), the Canadian Foundation for Innovation (CFI_), and the Fonds de recherche du Québec (FRQ_). @@ -228,50 +229,26 @@ This package was created with Cookiecutter_ and the `audreyfeldroy/cookiecutter- .. Energy Metrics by https://github.com/green-coding-solutions/eco-ci-energy-estimation -.. |energy-total-mn| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=5828641&mode=totals +.. |energy-total| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=5828641&mode=totals :target: https://metrics.green-coding.io/ci.html?repo=Ouranosinc/xclim&branch=main&workflow=5828641 :alt: Energy Consumption (Total) -.. |energy-last-mn| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=5828641 +.. |energy-last| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=5828641 :target: https://metrics.green-coding.io/ci.html?repo=Ouranosinc/xclim&branch=main&workflow=5828641 :alt: Energy Consumption (Last run) -.. |energy-average-mn| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=5828641&mode=avg&duration_days=90 +.. |energy-average| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=5828641&mode=avg&duration_days=90 :target: https://metrics.green-coding.io/ci.html?repo=Ouranosinc/xclim&branch=main&workflow=5828641 :alt: Energy Consumption (Last 90 days moving average) -.. |carbon-total-mn| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=5828641&mode=totals&metric=carbon +.. |carbon-total| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=5828641&mode=totals&metric=carbon :target: https://metrics.green-coding.io/ci.html?repo=Ouranosinc/xclim&branch=festive-indices&workflow=5828641 :alt: Carbon Emissions (Total) -.. |carbon-last-mn| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=5828641&metric=carbon +.. |carbon-last| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=5828641&metric=carbon :target: https://metrics.green-coding.io/ci.html?repo=Ouranosinc/xclim&branch=main&workflow=5828641 :alt: Carbon Emissions (Last run) -.. |carbon-average-mn| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=5828641&mode=avg&duration_days=90&metric=carbon +.. |carbon-average| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=5828641&mode=avg&duration_days=90&metric=carbon :target: https://metrics.green-coding.io/ci.html?repo=Ouranosinc/xclim&branch=main&workflow=5828641 :alt: Carbon Emissions (Last 90 days moving average) - -.. |energy-total-up| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=51773173&mode=totals - :target: https://metrics.green-coding.io/ci.html?repo=Ouranosinc/xclim&branch=main&workflow=51773173 - :alt: Energy Consumption (Total) - -.. |energy-last-up| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=51773173 - :target: https://metrics.green-coding.io/ci.html?repo=Ouranosinc/xclim&branch=main&workflow=51773173 - :alt: Energy Consumption (Last run) - -.. |energy-average-up| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=51773173&mode=avg&duration_days=90 - :target: https://metrics.green-coding.io/ci.html?repo=Ouranosinc/xclim&branch=main&workflow=51773173 - :alt: Energy Consumption (Last 90 days moving average) - -.. |carbon-total-up| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=51773173&mode=totals&metric=carbon - :target: https://metrics.green-coding.io/ci.html?repo=Ouranosinc/xclim&branch=festive-indices&workflow=51773173 - :alt: Carbon Emissions (Total) - -.. |carbon-last-up| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=51773173&metric=carbon - :target: https://metrics.green-coding.io/ci.html?repo=Ouranosinc/xclim&branch=main&workflow=51773173 - :alt: Carbon Emissions (Last run) - -.. |carbon-average-up| image:: https://api.green-coding.io/v1/ci/badge/get?repo=Ouranosinc/xclim&branch=main&workflow=51773173&mode=avg&duration_days=90&metric=carbon - :target: https://metrics.green-coding.io/ci.html?repo=Ouranosinc/xclim&branch=main&workflow=51773173 - :alt: Carbon Emissions (Last 90 days moving average) From 27f13f4154906410989e4b91669cb5a4fe9a1b49 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Jan 2025 16:11:50 +0000 Subject: [PATCH 09/18] Bump tox-gh from 1.4.4 to 1.5.0 in the python group Bumps the python group with 1 update: [tox-gh](https://github.com/tox-dev/tox-gh). Updates `tox-gh` from 1.4.4 to 1.5.0 - [Release notes](https://github.com/tox-dev/tox-gh/releases) - [Commits](https://github.com/tox-dev/tox-gh/compare/1.4.4...1.5.0) --- updated-dependencies: - dependency-name: tox-gh dependency-type: direct:production update-type: version-update:semver-minor dependency-group: python ... Signed-off-by: dependabot[bot] --- CI/requirements_ci.in | 2 +- CI/requirements_ci.txt | 40 ++++++++++++++++++++-------------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/CI/requirements_ci.in b/CI/requirements_ci.in index 204e832d5..3efab52d0 100644 --- a/CI/requirements_ci.in +++ b/CI/requirements_ci.in @@ -4,4 +4,4 @@ flit==3.10.1 pip==24.3.1 pylint==3.3.3 tox==4.23.2 -tox-gh==1.4.4 +tox-gh==1.5.0 diff --git a/CI/requirements_ci.txt b/CI/requirements_ci.txt index 7dcb2c2ea..81257427a 100644 --- a/CI/requirements_ci.txt +++ b/CI/requirements_ci.txt @@ -135,23 +135,23 @@ colorama==0.4.6 \ --hash=sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44 \ --hash=sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6 # via tox -deptry==0.21.2 \ - --hash=sha256:019167b35301edd2bdd4719c8b8f44769be4507cb8a1cd46fff4393cdbe8d31b \ - --hash=sha256:06d48e9fa460aad02f9e1b079d9f5a69d622d291b3a0525b722fc91c88032042 \ - --hash=sha256:1012a88500f242489066f811f6ec0c93328d9340bbf0f87f0c7d2146054d197e \ - --hash=sha256:186ddbc69c1f70e684e83e202795e1054d0c2dfc03b8acc077f65dc3b6a7f4ce \ - --hash=sha256:3080bb88c16ebd35f59cba7688416115b7aaf4630dc5a051dff2649cbf129a1b \ - --hash=sha256:3ef8aed33a2eac357f9565063bc1257bcefa03a37038299c08a4222e28f3cd34 \ - --hash=sha256:4e870553c7a1fafcd99a83ba4137259525679eecabeff61bc669741efa201541 \ - --hash=sha256:7479d3079be69c3bbf5913d8e21090749c1139ee91f81520ffce90b5322476b0 \ - --hash=sha256:769bb658172586d1b03046bdc6b6c94f6a98ecfbac04ff7f77ec61768c75e1c2 \ - --hash=sha256:917745db5f8295eb5048e43d9073a9a675ffdba865e9b294d2e7aa455730cb06 \ - --hash=sha256:adb12d6678fb5dbd320a0a2e37881059d0a45bec6329df4250c977d803fe7f96 \ - --hash=sha256:d76bbf48bd62ecc44ca3d414769bd4b7956598d23d9ccb42fd359b831a31cab2 \ - --hash=sha256:d8add495f0dd19a38aa6d1e09b14b1441bca47c9d945bc7b322efb084313eea3 \ - --hash=sha256:e3b9e0c5ee437240b65e61107b5777a12064f78f604bf9f181a96c9b56eb896d \ - --hash=sha256:f3686e86ad7063b5a6e5253454f9d9e4a7a6b1511a99bd4306fda5424480be48 \ - --hash=sha256:fb2f43747b58abeec01dc277ef22859342f3bca2ac677818c94940a009b436c0 +deptry==0.22.0 \ + --hash=sha256:016f8a5b6c32762beea47a4d9d2d7b04f1b6e534448e5444c7a742bd2fdb260d \ + --hash=sha256:1e20a8ba89078d06440316dba719c2278fdb19923e76633b808fd1b5670020c4 \ + --hash=sha256:2b903c94162e30640bb7a3e6800c7afd03a6bb12b693a21290e06c713dba35af \ + --hash=sha256:2da497a9888f930b5c86c6524b29a4d284ed320edd4148ecc2e45e10f177f4fe \ + --hash=sha256:32212cd40562f71b24da69babaed9a4233c567da390f681d86bb66f8ec4d2bfe \ + --hash=sha256:35acf2ac783ba2ec43ba593ba14e0080393c0ab24797ba55fbed30f0ba02259f \ + --hash=sha256:46c868a0493556b41096f9824a15a3ce38811e6b4a2699ebec16e06e9f85cd84 \ + --hash=sha256:8b371a3c3194c2db9196ab1f80d5ce08138dea731eff8dd9fb2997da42941fa7 \ + --hash=sha256:8b523a33bed952679c97a9f55c690803f0fbeb32649946dcc1362c3f015897c7 \ + --hash=sha256:9a12ebe86299e7bb054804464467f33c49e5a34f204b710fa10fbe1f31c56964 \ + --hash=sha256:9db9d0b8244e2b20bd75a21312c35ee628a602b00c0e2f267fb90f4600de6d2d \ + --hash=sha256:aebba0d1ca119f6241ff0d5b72e72a9b912fa880e81f4ab346a32d9001d6ddb1 \ + --hash=sha256:c68fa570be1443888d252c6f551356777e56e82e492e68e6db3d65b31100c450 \ + --hash=sha256:edd0060065325cd70e6ce47feaa724cdb7fc3f4de673e4ed0fa38e8c1adc4155 \ + --hash=sha256:f4872f48225d1e7dbacb1be5e427945c8f76abf6b91453e038aae076b638ba01 \ + --hash=sha256:fbe6211b972337acdeec6c11a82b666597c1edd6c6e2a93eb705bf49644bfb08 # via -r CI/requirements_ci.in dill==0.3.8 \ --hash=sha256:3ebe3c479ad625c4553aca177444d89b486b1d84982eeacded644afc0cf797ca \ @@ -385,9 +385,9 @@ tox==4.23.2 \ # via # -r CI/requirements_ci.in # tox-gh -tox-gh==1.4.4 \ - --hash=sha256:4ea585f66585b90f5826b1677cfc9453747792a0f9ff83d468603bc17556e07b \ - --hash=sha256:b962e0f8c4619e98d11c2a135939876691e148b843b7dac4cff7de1dc4f7c215 +tox-gh==1.5.0 \ + --hash=sha256:bd4c56d1ebcde4ca2450fed347610a739614a7225945bdc89a67c8395eac9d63 \ + --hash=sha256:fd7e8c826f4576a02af4737fd4b738817660b63898c161d6ee8f658c885f7fa1 # via -r CI/requirements_ci.in types-setuptools==75.6.0.20241126 \ --hash=sha256:7bf25ad4be39740e469f9268b6beddda6e088891fa5a27e985c6ce68bf62ace0 \ From fcfb251e4966c8b2fbc5a2dc2c91bffbca90cf2c Mon Sep 17 00:00:00 2001 From: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com> Date: Mon, 20 Jan 2025 14:44:41 -0500 Subject: [PATCH 10/18] remove comment on PR Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com> --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4b4820654..358acef46 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -473,5 +473,4 @@ jobs: uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 with: task: display-results - pr-comment: true continue-on-error: true From 36ae9e18e9ef8bba11b0672b152c94447df6e7cb Mon Sep 17 00:00:00 2001 From: Ouranos Helper Bot Date: Mon, 20 Jan 2025 19:57:41 +0000 Subject: [PATCH 11/18] =?UTF-8?q?Bump=20version:=200.54.1-dev.3=20?= =?UTF-8?q?=E2=86=92=200.54.1-dev.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ouranos Helper Bot --- pyproject.toml | 2 +- src/xclim/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 597552261..184cf9865 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -140,7 +140,7 @@ target-version = [ ] [tool.bumpversion] -current_version = "0.54.1-dev.3" +current_version = "0.54.1-dev.4" commit = true commit_args = "--no-verify --signoff" tag = false diff --git a/src/xclim/__init__.py b/src/xclim/__init__.py index bb48837c2..0e11ec3c6 100644 --- a/src/xclim/__init__.py +++ b/src/xclim/__init__.py @@ -13,7 +13,7 @@ __author__ = """Travis Logan""" __email__ = "logan.travis@ouranos.ca" -__version__ = "0.54.1-dev.3" +__version__ = "0.54.1-dev.4" with _resources.as_file(_resources.files("xclim.data")) as _module_data: From f5192d59ce4567654881e8bf569fdc37a1bb604b Mon Sep 17 00:00:00 2001 From: Ouranos Helper Bot Date: Mon, 20 Jan 2025 20:16:10 +0000 Subject: [PATCH 12/18] =?UTF-8?q?Bump=20version:=200.54.1-dev.4=20?= =?UTF-8?q?=E2=86=92=200.54.1-dev.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ouranos Helper Bot --- pyproject.toml | 2 +- src/xclim/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 184cf9865..682acead4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -140,7 +140,7 @@ target-version = [ ] [tool.bumpversion] -current_version = "0.54.1-dev.4" +current_version = "0.54.1-dev.5" commit = true commit_args = "--no-verify --signoff" tag = false diff --git a/src/xclim/__init__.py b/src/xclim/__init__.py index 0e11ec3c6..5efd150a6 100644 --- a/src/xclim/__init__.py +++ b/src/xclim/__init__.py @@ -13,7 +13,7 @@ __author__ = """Travis Logan""" __email__ = "logan.travis@ouranos.ca" -__version__ = "0.54.1-dev.4" +__version__ = "0.54.1-dev.5" with _resources.as_file(_resources.files("xclim.data")) as _module_data: From 04080d9964c3d0435c6e5f3a33a293895f836b2b Mon Sep 17 00:00:00 2001 From: Zeitsperre <10819524+Zeitsperre@users.noreply.github.com> Date: Thu, 23 Jan 2025 10:55:01 -0500 Subject: [PATCH 13/18] skip test requiring nl_langinfo on Windows, mark xfailable Signed-off-by: Zeitsperre <10819524+Zeitsperre@users.noreply.github.com> --- tests/test_modules.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/test_modules.py b/tests/test_modules.py index ba1697b18..eac100c71 100644 --- a/tests/test_modules.py +++ b/tests/test_modules.py @@ -1,5 +1,6 @@ from __future__ import annotations +import platform from importlib.util import find_spec from inspect import _empty # noqa from pathlib import Path @@ -273,8 +274,10 @@ def test_all(self): assert self.validate() -# It's not really slow, but this is an unstable test (when it fails) and we might not want to execute it on all builds -@pytest.mark.slow +@pytest.mark.xfail(reason="This is test is relatively unstable.") +@pytest.mark.skipif( + platform.system() == "Windows", reason="nl_langinfo not available on Windows." +) def test_encoding(): import _locale import sys From 934a8cf7ea3982da3d426a21197ca36a8a133847 Mon Sep 17 00:00:00 2001 From: Zeitsperre <10819524+Zeitsperre@users.noreply.github.com> Date: Thu, 23 Jan 2025 11:32:53 -0500 Subject: [PATCH 14/18] better pytest-socket handling Signed-off-by: Zeitsperre <10819524+Zeitsperre@users.noreply.github.com> --- tests/test_modules.py | 2 +- tests/test_sdba/conftest.py | 9 ++------- tests/test_sdba/test_adjustment.py | 1 + 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/tests/test_modules.py b/tests/test_modules.py index eac100c71..dbe07b79f 100644 --- a/tests/test_modules.py +++ b/tests/test_modules.py @@ -274,7 +274,7 @@ def test_all(self): assert self.validate() -@pytest.mark.xfail(reason="This is test is relatively unstable.") +@pytest.mark.xfail(reason="This is test is relatively unstable.", strict=False) @pytest.mark.skipif( platform.system() == "Windows", reason="nl_langinfo not available on Windows." ) diff --git a/tests/test_sdba/conftest.py b/tests/test_sdba/conftest.py index 3732a2eca..9f38e9dfe 100644 --- a/tests/test_sdba/conftest.py +++ b/tests/test_sdba/conftest.py @@ -105,13 +105,8 @@ def qds_month(): @pytest.fixture -def ref_hist_sim_tuto(socket_enabled): # noqa: F841 - """Return ref, hist, sim time series of air temperature. - - socket_enabled is a fixture that enables the use of the internet to download the tutorial dataset while the - `--disable-socket` flag has been called. This fixture will crash if the `air_temperature` tutorial file is - not on disk while the internet is unavailable. - """ +def ref_hist_sim_tuto(): + """Return ref, hist, sim time series of air temperature.""" def _ref_hist_sim_tuto(sim_offset=3, delta=0.1, smth_win=3, trend=True): ds = xr.tutorial.load_dataset("air_temperature") diff --git a/tests/test_sdba/test_adjustment.py b/tests/test_sdba/test_adjustment.py index 8466bd9ca..d9a348ea7 100644 --- a/tests/test_sdba/test_adjustment.py +++ b/tests/test_sdba/test_adjustment.py @@ -131,6 +131,7 @@ def test_time_and_from_ds(self, series, group, dec, tmp_path, random, open_datas np.testing.assert_array_equal(p, p2) @pytest.mark.requires_internet + @pytest.mark.enable_socket def test_reduce_dims(self, ref_hist_sim_tuto): ref, hist, _sim = ref_hist_sim_tuto() hist = hist.expand_dims(member=[0, 1]) From 711bbb1d9af707af9cb29f86daf07a9c7b1cf6dd Mon Sep 17 00:00:00 2001 From: Zeitsperre <10819524+Zeitsperre@users.noreply.github.com> Date: Thu, 23 Jan 2025 15:38:11 -0500 Subject: [PATCH 15/18] update CHANGELOG.rst, fix typo Signed-off-by: Zeitsperre <10819524+Zeitsperre@users.noreply.github.com> --- CHANGELOG.rst | 1 + tests/test_modules.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 4b7570b3b..abfc83ece 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -21,6 +21,7 @@ Internal changes ^^^^^^^^^^^^^^^^ * `sphinx-codeautolink` and `pygments` have been temporarily pinned due to breaking API changes. (:pull:`2030`). * Adjusted the ``TestOfficialYaml`` test to use a dynamic method for finding the installed location of `xclim`. (:pull:`2028`). +* Adjusted two tests for better handling when running in Windows environments. (:pull:`2057`). v0.54.0 (2024-12-16) -------------------- diff --git a/tests/test_modules.py b/tests/test_modules.py index dbe07b79f..970e2a1ed 100644 --- a/tests/test_modules.py +++ b/tests/test_modules.py @@ -274,7 +274,7 @@ def test_all(self): assert self.validate() -@pytest.mark.xfail(reason="This is test is relatively unstable.", strict=False) +@pytest.mark.xfail(reason="This test is relatively unstable.", strict=False) @pytest.mark.skipif( platform.system() == "Windows", reason="nl_langinfo not available on Windows." ) From 210ad9567361f715d884fddf61107f0139274d91 Mon Sep 17 00:00:00 2001 From: Ouranos Helper Bot Date: Fri, 24 Jan 2025 15:17:11 +0000 Subject: [PATCH 16/18] =?UTF-8?q?Bump=20version:=200.54.1-dev.5=20?= =?UTF-8?q?=E2=86=92=200.54.1-dev.6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ouranos Helper Bot --- pyproject.toml | 2 +- src/xclim/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 682acead4..e97321209 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -140,7 +140,7 @@ target-version = [ ] [tool.bumpversion] -current_version = "0.54.1-dev.5" +current_version = "0.54.1-dev.6" commit = true commit_args = "--no-verify --signoff" tag = false diff --git a/src/xclim/__init__.py b/src/xclim/__init__.py index 5efd150a6..316c86698 100644 --- a/src/xclim/__init__.py +++ b/src/xclim/__init__.py @@ -13,7 +13,7 @@ __author__ = """Travis Logan""" __email__ = "logan.travis@ouranos.ca" -__version__ = "0.54.1-dev.5" +__version__ = "0.54.1-dev.6" with _resources.as_file(_resources.files("xclim.data")) as _module_data: From b1238c642b09efe4a8984123705e338c56b566c7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2025 12:58:47 +0000 Subject: [PATCH 17/18] Bump the actions group with 3 updates Bumps the actions group with 3 updates: [green-coding-solutions/eco-ci-energy-estimation](https://github.com/green-coding-solutions/eco-ci-energy-estimation), [coverallsapp/github-action](https://github.com/coverallsapp/github-action) and [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish). Updates `green-coding-solutions/eco-ci-energy-estimation` from 4.2.0 to 4.3.0 - [Release notes](https://github.com/green-coding-solutions/eco-ci-energy-estimation/releases) - [Commits](https://github.com/green-coding-solutions/eco-ci-energy-estimation/compare/e79d33b08b0c47de4438c161d432730fce23f246...2c74a687e9cc4cc4579ae752404a8d54cc46a06a) Updates `coverallsapp/github-action` from 2.3.4 to 2.3.6 - [Release notes](https://github.com/coverallsapp/github-action/releases) - [Commits](https://github.com/coverallsapp/github-action/compare/cfd0633edbd2411b532b808ba7a8b5e04f76d2c8...648a8eb78e6d50909eff900e4ec85cab4524a45b) Updates `pypa/gh-action-pypi-publish` from 1.12.3 to 1.12.4 - [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases) - [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/67339c736fd9354cd4f8cb0b744f2b82a74b5c70...76f52bc884231f62b9a034ebfe128415bbaabdfc) --- updated-dependencies: - dependency-name: green-coding-solutions/eco-ci-energy-estimation dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: coverallsapp/github-action dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: pypa/gh-action-pypi-publish dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/dependency-review.yml | 6 ++-- .github/workflows/main.yml | 40 ++++++++++++------------- .github/workflows/publish-pypi.yml | 2 +- .github/workflows/tag-testpypi.yml | 2 +- .github/workflows/upstream.yml | 8 ++--- 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index f9a82801d..6f457422d 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -34,7 +34,7 @@ jobs: sum.golang.org:443 - name: Start Energy Measurement - uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 + uses: green-coding-solutions/eco-ci-energy-estimation@2c74a687e9cc4cc4579ae752404a8d54cc46a06a # v4.3.0 with: task: start-measurement branch: ${{ github.head_ref || github.ref_name }} @@ -48,14 +48,14 @@ jobs: uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 # v4.5.0 - name: Energy Measurement - uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 + uses: green-coding-solutions/eco-ci-energy-estimation@2c74a687e9cc4cc4579ae752404a8d54cc46a06a # v4.3.0 with: task: get-measurement label: 'Dependency Review' continue-on-error: true - name: Show Energy Results - uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 + uses: green-coding-solutions/eco-ci-energy-estimation@2c74a687e9cc4cc4579ae752404a8d54cc46a06a # v4.3.0 with: task: display-results continue-on-error: true diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index efeb2187a..cfabedff6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -56,7 +56,7 @@ jobs: pypi.org:443 sum.golang.org:443 - name: Start Measurement - uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 + uses: green-coding-solutions/eco-ci-energy-estimation@2c74a687e9cc4cc4579ae752404a8d54cc46a06a # v4.3.0 with: task: start-measurement branch: ${{ github.head_ref || github.ref_name }} @@ -74,7 +74,7 @@ jobs: run: | python -m pip install --require-hashes -r CI/requirements_ci.txt - name: Setup Python Measurement - uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 + uses: green-coding-solutions/eco-ci-energy-estimation@2c74a687e9cc4cc4579ae752404a8d54cc46a06a # v4.3.0 with: task: get-measurement label: 'Environment setup (Python${{ matrix.python-version }}, lint)' @@ -93,13 +93,13 @@ jobs: run: | python -m tox -e lint - name: Tests measurement - uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 + uses: green-coding-solutions/eco-ci-energy-estimation@2c74a687e9cc4cc4579ae752404a8d54cc46a06a # v4.3.0 with: task: get-measurement label: 'Lint (Python${{ matrix.python-version }})' continue-on-error: true - name: Show Energy Results - uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 + uses: green-coding-solutions/eco-ci-energy-estimation@2c74a687e9cc4cc4579ae752404a8d54cc46a06a # v4.3.0 with: task: display-results continue-on-error: true @@ -133,7 +133,7 @@ jobs: raw.githubusercontent.com:443 sum.golang.org:443 - name: Start Energy Measurement - uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 + uses: green-coding-solutions/eco-ci-energy-estimation@2c74a687e9cc4cc4579ae752404a8d54cc46a06a # v4.3.0 with: task: start-measurement branch: ${{ github.head_ref || github.ref_name }} @@ -151,7 +151,7 @@ jobs: run: | python -m pip install --require-hashes -r CI/requirements_ci.txt - name: Environment Setup Energy Measurement - uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 + uses: green-coding-solutions/eco-ci-energy-estimation@2c74a687e9cc4cc4579ae752404a8d54cc46a06a # v4.3.0 with: task: get-measurement label: 'Environment setup (Python${{ matrix.python-version }}, standard)' @@ -171,13 +171,13 @@ jobs: COVERALLS_FLAG_NAME: run-${{ matrix.python-version }}-ubuntu-latest-preliminary COVERALLS_PARALLEL: true - name: Tests measurement - uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 + uses: green-coding-solutions/eco-ci-energy-estimation@2c74a687e9cc4cc4579ae752404a8d54cc46a06a # v4.3.0 with: task: get-measurement label: 'Testing with tox (Python${{ matrix.python-version }})' continue-on-error: true - name: Show Energy Results - uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 + uses: green-coding-solutions/eco-ci-energy-estimation@2c74a687e9cc4cc4579ae752404a8d54cc46a06a # v4.3.0 with: task: display-results continue-on-error: true @@ -260,7 +260,7 @@ jobs: sum.golang.org:443 - name: Start Energy Measurement if : ${{ matrix.os == 'ubuntu-latest' }} - uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 + uses: green-coding-solutions/eco-ci-energy-estimation@2c74a687e9cc4cc4579ae752404a8d54cc46a06a # v4.3.0 with: task: start-measurement branch: ${{ github.head_ref || github.ref_name }} @@ -284,7 +284,7 @@ jobs: python -m pip install --require-hashes -r CI/requirements_ci.txt - name: Environment Setup Energy Measurement if : ${{ matrix.os == 'ubuntu-latest' }} - uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 + uses: green-coding-solutions/eco-ci-energy-estimation@2c74a687e9cc4cc4579ae752404a8d54cc46a06a # v4.3.0 with: task: get-measurement label: 'Environment setup (Python${{ matrix.python-version }}, ${{ matrix.tox-env }})' @@ -316,14 +316,14 @@ jobs: COVERALLS_PARALLEL: true - name: Tests measurement if : ${{ matrix.os == 'ubuntu-latest' }} - uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 + uses: green-coding-solutions/eco-ci-energy-estimation@2c74a687e9cc4cc4579ae752404a8d54cc46a06a # v4.3.0 with: task: get-measurement label: 'Testing with tox (Python${{ matrix.python-version }}, ${{ matrix.tox-env }})' continue-on-error: true - name: Show Energy Results if : ${{ matrix.os == 'ubuntu-latest' }} - uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 + uses: green-coding-solutions/eco-ci-energy-estimation@2c74a687e9cc4cc4579ae752404a8d54cc46a06a # v4.3.0 with: task: display-results continue-on-error: true @@ -366,7 +366,7 @@ jobs: raw.githubusercontent.com:443 sum.golang.org:443 - name: Start Energy Measurement - uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 + uses: green-coding-solutions/eco-ci-energy-estimation@2c74a687e9cc4cc4579ae752404a8d54cc46a06a # v4.3.0 with: task: start-measurement branch: ${{ github.head_ref || github.ref_name }} @@ -398,7 +398,7 @@ jobs: xclim show_version_info python -m pip check || true - name: Environment Setup Energy Measurement - uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 + uses: green-coding-solutions/eco-ci-energy-estimation@2c74a687e9cc4cc4579ae752404a8d54cc46a06a # v4.3.0 with: task: get-measurement label: 'Environment setup (conda, Python${{ matrix.python-version }})' @@ -414,13 +414,13 @@ jobs: COVERALLS_FLAG_NAME: run-{{ matrix.python-version }}-conda COVERALLS_PARALLEL: true - name: Tests measurement - uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 + uses: green-coding-solutions/eco-ci-energy-estimation@2c74a687e9cc4cc4579ae752404a8d54cc46a06a # v4.3.0 with: task: get-measurement label: 'Testing with pytest (conda, Python${{ matrix.python-version }})' continue-on-error: true - name: Show Energy Results - uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 + uses: green-coding-solutions/eco-ci-energy-estimation@2c74a687e9cc4cc4579ae752404a8d54cc46a06a # v4.3.0 with: task: display-results continue-on-error: true @@ -454,23 +454,23 @@ jobs: pypi.org:443 sum.golang.org:443 - name: Start Energy Measurement - uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 + uses: green-coding-solutions/eco-ci-energy-estimation@2c74a687e9cc4cc4579ae752404a8d54cc46a06a # v4.3.0 with: task: start-measurement branch: ${{ github.head_ref || github.ref_name }} continue-on-error: true - name: Coveralls Finished - uses: coverallsapp/github-action@cfd0633edbd2411b532b808ba7a8b5e04f76d2c8 # v2.3.4 + uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6 with: parallel-finished: true - name: Finish measurement - uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 + uses: green-coding-solutions/eco-ci-energy-estimation@2c74a687e9cc4cc4579ae752404a8d54cc46a06a # v4.3.0 with: task: get-measurement label: 'Finish Run' continue-on-error: true - name: Show Energy Results - uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 + uses: green-coding-solutions/eco-ci-energy-estimation@2c74a687e9cc4cc4579ae752404a8d54cc46a06a # v4.3.0 with: task: display-results continue-on-error: true diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 91d30dfee..daefc9575 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -43,4 +43,4 @@ jobs: run: | python -m flit build - name: Publish distribution 📦 to PyPI - uses: pypa/gh-action-pypi-publish@67339c736fd9354cd4f8cb0b744f2b82a74b5c70 # v1.12.3 + uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4 diff --git a/.github/workflows/tag-testpypi.yml b/.github/workflows/tag-testpypi.yml index 9db0c33aa..83ede6ac0 100644 --- a/.github/workflows/tag-testpypi.yml +++ b/.github/workflows/tag-testpypi.yml @@ -43,7 +43,7 @@ jobs: run: | python -m flit build - name: Publish distribution 📦 to Test PyPI - uses: pypa/gh-action-pypi-publish@67339c736fd9354cd4f8cb0b744f2b82a74b5c70 # v1.12.3 + uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4 with: repository-url: https://test.pypi.org/legacy/ skip-existing: true diff --git a/.github/workflows/upstream.yml b/.github/workflows/upstream.yml index 6f1f92047..23d497d72 100644 --- a/.github/workflows/upstream.yml +++ b/.github/workflows/upstream.yml @@ -61,7 +61,7 @@ jobs: repo.anaconda.com:443 sum.golang.org:443 - name: Start Measurement - uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 + uses: green-coding-solutions/eco-ci-energy-estimation@2c74a687e9cc4cc4579ae752404a8d54cc46a06a # v4.3.0 with: task: start-measurement branch: ${{ github.head_ref || github.ref_name }} @@ -98,7 +98,7 @@ jobs: xclim show_version_info python -m pip check || true - name: Setup Python Measurement - uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 + uses: green-coding-solutions/eco-ci-energy-estimation@2c74a687e9cc4cc4579ae752404a8d54cc46a06a # v4.3.0 with: task: get-measurement label: 'Environment Setup (Upstream, Python${{ matrix.python-version }})' @@ -125,13 +125,13 @@ jobs: issue-title: "⚠️ Nightly upstream-dev CI failed for Python${{ matrix.python-version }} ⚠️" log-path: output-${{ matrix.python-version }}-log.jsonl - name: Tests measurement - uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 + uses: green-coding-solutions/eco-ci-energy-estimation@2c74a687e9cc4cc4579ae752404a8d54cc46a06a # v4.3.0 with: task: get-measurement label: 'Testing and Reporting (Upstream, Python${{ matrix.python-version }})' continue-on-error: true - name: Show Energy Results - uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0 + uses: green-coding-solutions/eco-ci-energy-estimation@2c74a687e9cc4cc4579ae752404a8d54cc46a06a # v4.3.0 with: task: display-results continue-on-error: true From 48ce2cd41cef57dfc6bde568182bf2f7d8bf7758 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2025 15:27:12 +0000 Subject: [PATCH 18/18] Bump the python group with 6 updates Bumps the python group with 6 updates: | Package | From | To | | --- | --- | --- | | [filelock](https://github.com/tox-dev/py-filelock) | `3.16.1` | `3.17.0` | | [bump-my-version](https://github.com/callowayproject/bump-my-version) | `0.29.0` | `0.30.0` | | [codespell](https://github.com/codespell-project/codespell) | `2.3.0` | `2.4.0` | | [deptry](https://github.com/fpgmaas/deptry) | `0.22.0` | `0.23.0` | | [pip](https://github.com/pypa/pip) | `24.3.1` | `25.0` | | [tox](https://github.com/tox-dev/tox) | `4.23.2` | `4.24.1` | Updates `filelock` from 3.16.1 to 3.17.0 - [Release notes](https://github.com/tox-dev/py-filelock/releases) - [Changelog](https://github.com/tox-dev/filelock/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/py-filelock/compare/3.16.1...3.17.0) Updates `bump-my-version` from 0.29.0 to 0.30.0 - [Release notes](https://github.com/callowayproject/bump-my-version/releases) - [Changelog](https://github.com/callowayproject/bump-my-version/blob/master/CHANGELOG.md) - [Commits](https://github.com/callowayproject/bump-my-version/compare/0.29.0...0.30.0) Updates `codespell` from 2.3.0 to 2.4.0 - [Release notes](https://github.com/codespell-project/codespell/releases) - [Commits](https://github.com/codespell-project/codespell/compare/v2.3.0...v2.4.0) Updates `deptry` from 0.22.0 to 0.23.0 - [Release notes](https://github.com/fpgmaas/deptry/releases) - [Changelog](https://github.com/fpgmaas/deptry/blob/main/CHANGELOG.md) - [Commits](https://github.com/fpgmaas/deptry/compare/0.22.0...0.23.0) Updates `pip` from 24.3.1 to 25.0 - [Changelog](https://github.com/pypa/pip/blob/main/NEWS.rst) - [Commits](https://github.com/pypa/pip/compare/24.3.1...25.0) Updates `tox` from 4.23.2 to 4.24.1 - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/4.23.2...4.24.1) --- updated-dependencies: - dependency-name: filelock dependency-type: direct:production update-type: version-update:semver-minor dependency-group: python - dependency-name: bump-my-version dependency-type: direct:production update-type: version-update:semver-minor dependency-group: python - dependency-name: codespell dependency-type: direct:production update-type: version-update:semver-minor dependency-group: python - dependency-name: deptry dependency-type: direct:production update-type: version-update:semver-minor dependency-group: python - dependency-name: pip dependency-type: direct:production update-type: version-update:semver-major dependency-group: python - dependency-name: tox dependency-type: direct:production update-type: version-update:semver-minor dependency-group: python ... Signed-off-by: dependabot[bot] --- CI/requirements_ci.in | 8 ++-- CI/requirements_ci.txt | 94 ++++++++++++++++++++++++++++-------------- pyproject.toml | 6 +-- 3 files changed, 69 insertions(+), 39 deletions(-) diff --git a/CI/requirements_ci.in b/CI/requirements_ci.in index 3efab52d0..50dd99990 100644 --- a/CI/requirements_ci.in +++ b/CI/requirements_ci.in @@ -1,7 +1,7 @@ -bump-my-version==0.29.0 -deptry==0.22.0 +bump-my-version==0.30.0 +deptry==0.23.0 flit==3.10.1 -pip==24.3.1 +pip==25.0 pylint==3.3.3 -tox==4.23.2 +tox==4.24.1 tox-gh==1.5.0 diff --git a/CI/requirements_ci.txt b/CI/requirements_ci.txt index 81257427a..737da5a7c 100644 --- a/CI/requirements_ci.txt +++ b/CI/requirements_ci.txt @@ -16,9 +16,9 @@ bracex==2.4 \ --hash=sha256:a27eaf1df42cf561fed58b7a8f3fdf129d1ea16a81e1fadd1d17989bc6384beb \ --hash=sha256:efdc71eff95eaff5e0f8cfebe7d01adf2c8637c8c92edaf63ef348c241a82418 # via wcmatch -bump-my-version==0.29.0 \ - --hash=sha256:6566ab25bd3eeeec109f4ac7e4464227a3ac1fd57f847d259a24800423cd9037 \ - --hash=sha256:e4149ed63b4772f5868b3fcabb8fa5e1191b8abae6d35effd0be980d4b0f55e3 +bump-my-version==0.30.0 \ + --hash=sha256:b0d683a1cb97fbc2f46adf8eb39ff1f0bdd72866c3583fe01f9837d6f031e5e3 \ + --hash=sha256:d53e784c73abc4bb5759e296f510bc71878e1df078eb525542ec9291b5ceb195 # via -r CI/requirements_ci.in cachetools==5.5.0 \ --hash=sha256:02134e8439cdc2ffb62023ce1debca2944c3f289d66bb17ead3ab3dede74b292 \ @@ -135,23 +135,23 @@ colorama==0.4.6 \ --hash=sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44 \ --hash=sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6 # via tox -deptry==0.22.0 \ - --hash=sha256:016f8a5b6c32762beea47a4d9d2d7b04f1b6e534448e5444c7a742bd2fdb260d \ - --hash=sha256:1e20a8ba89078d06440316dba719c2278fdb19923e76633b808fd1b5670020c4 \ - --hash=sha256:2b903c94162e30640bb7a3e6800c7afd03a6bb12b693a21290e06c713dba35af \ - --hash=sha256:2da497a9888f930b5c86c6524b29a4d284ed320edd4148ecc2e45e10f177f4fe \ - --hash=sha256:32212cd40562f71b24da69babaed9a4233c567da390f681d86bb66f8ec4d2bfe \ - --hash=sha256:35acf2ac783ba2ec43ba593ba14e0080393c0ab24797ba55fbed30f0ba02259f \ - --hash=sha256:46c868a0493556b41096f9824a15a3ce38811e6b4a2699ebec16e06e9f85cd84 \ - --hash=sha256:8b371a3c3194c2db9196ab1f80d5ce08138dea731eff8dd9fb2997da42941fa7 \ - --hash=sha256:8b523a33bed952679c97a9f55c690803f0fbeb32649946dcc1362c3f015897c7 \ - --hash=sha256:9a12ebe86299e7bb054804464467f33c49e5a34f204b710fa10fbe1f31c56964 \ - --hash=sha256:9db9d0b8244e2b20bd75a21312c35ee628a602b00c0e2f267fb90f4600de6d2d \ - --hash=sha256:aebba0d1ca119f6241ff0d5b72e72a9b912fa880e81f4ab346a32d9001d6ddb1 \ - --hash=sha256:c68fa570be1443888d252c6f551356777e56e82e492e68e6db3d65b31100c450 \ - --hash=sha256:edd0060065325cd70e6ce47feaa724cdb7fc3f4de673e4ed0fa38e8c1adc4155 \ - --hash=sha256:f4872f48225d1e7dbacb1be5e427945c8f76abf6b91453e038aae076b638ba01 \ - --hash=sha256:fbe6211b972337acdeec6c11a82b666597c1edd6c6e2a93eb705bf49644bfb08 +deptry==0.23.0 \ + --hash=sha256:04afae204654542406318fd3dd6f4a6697579597f37195437daf84a53ee0ebbf \ + --hash=sha256:1cfa4b3a46ee8a026eaa38e4b9ba43fe6036a07fe16bf0a663cb611b939f6af8 \ + --hash=sha256:1f2a6817a37d76e8f6b667381b7caf6ea3e6d6c18b5be24d36c625f387c79852 \ + --hash=sha256:40706dcbed54141f2d23afa70a272171c8c46531cd6f0f9c8ef482c906b3cee2 \ + --hash=sha256:4915a3590ccf38ad7a9176aee376745aa9de121f50f8da8fb9ccec87fa93e676 \ + --hash=sha256:583154732cfd438a4a090b7d13d8b2016f1ac2732534f34fb689345768d8538b \ + --hash=sha256:5f7e4b1a5232ed6d352fca7173750610a169377d1951d3e9782947191942a765 \ + --hash=sha256:736e7bc557aec6118b2a4d454f0d81f070782faeaa9d8d3c9a15985c9f265372 \ + --hash=sha256:889541844092f18e7b48631852195f36c25c5afd4d7e074b19ba824b430add50 \ + --hash=sha256:9601b64cc0aed42687fdd5c912d5f1e90d7f7333fb589b14e35bfdfebae866f3 \ + --hash=sha256:9a46f78098f145100dc582a59af8548b26cdfa16cf0fbd85d2d44645e724cb6a \ + --hash=sha256:9d03cc99a61c348df92074a50e0a71b28f264f0edbf686084ca90e6fd44e3abe \ + --hash=sha256:aff9156228eb16cd81792f920c1623c00cb59091ae572600ba0eac587da33c0c \ + --hash=sha256:d53e803b280791d89a051b6183d9dc40411200e22a8ab7e6c32c6b169822a664 \ + --hash=sha256:da7678624f4626d839c8c03675452cefc59d6cf57d25c84a9711dae514719279 \ + --hash=sha256:e6172b2205f6e84bcc9df25226693d4deb9576a6f746c2ace828f6d13401d357 # via -r CI/requirements_ci.in dill==0.3.8 \ --hash=sha256:3ebe3c479ad625c4553aca177444d89b486b1d84982eeacded644afc0cf797ca \ @@ -165,9 +165,9 @@ docutils==0.21.2 \ --hash=sha256:3a6b18732edf182daa3cd12775bbb338cf5691468f91eeeb109deff6ebfa986f \ --hash=sha256:dafca5b9e384f0e419294eb4d2ff9fa826435bf15f15b7bd45723e8ad76811b2 # via flit -filelock==3.16.1 \ - --hash=sha256:2082e5703d51fbf98ea75855d9d5527e33d8ff23099bec374a134febee6946b0 \ - --hash=sha256:c249fbfcd5db47e5e2d6d62198e565475ee65e4831e2561c8e313fa7eb961435 +filelock==3.17.0 \ + --hash=sha256:533dc2f7ba78dc2f0f531fc6c4940addf7b70a481e269a5a3b93be94ffbe8338 \ + --hash=sha256:ee4e77401ef576ebb38cd7f13b9b28893194acc20a8e68e18730ba9c0e54660e # via # tox # virtualenv @@ -361,9 +361,39 @@ rich-click==1.8.3 \ --hash=sha256:636d9c040d31c5eee242201b5bf4f2d358bfae4db14bb22ec1cafa717cfd02cd \ --hash=sha256:6d75bdfa7aa9ed2c467789a0688bc6da23fbe3a143e19aa6ad3f8bac113d2ab3 # via bump-my-version -tomli==2.0.1 \ - --hash=sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc \ - --hash=sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f +tomli==2.2.1 \ + --hash=sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6 \ + --hash=sha256:02abe224de6ae62c19f090f68da4e27b10af2b93213d36cf44e6e1c5abd19fdd \ + --hash=sha256:286f0ca2ffeeb5b9bd4fcc8d6c330534323ec51b2f52da063b11c502da16f30c \ + --hash=sha256:2d0f2fdd22b02c6d81637a3c95f8cd77f995846af7414c5c4b8d0545afa1bc4b \ + --hash=sha256:33580bccab0338d00994d7f16f4c4ec25b776af3ffaac1ed74e0b3fc95e885a8 \ + --hash=sha256:400e720fe168c0f8521520190686ef8ef033fb19fc493da09779e592861b78c6 \ + --hash=sha256:40741994320b232529c802f8bc86da4e1aa9f413db394617b9a256ae0f9a7f77 \ + --hash=sha256:465af0e0875402f1d226519c9904f37254b3045fc5084697cefb9bdde1ff99ff \ + --hash=sha256:4a8f6e44de52d5e6c657c9fe83b562f5f4256d8ebbfe4ff922c495620a7f6cea \ + --hash=sha256:4e340144ad7ae1533cb897d406382b4b6fede8890a03738ff1683af800d54192 \ + --hash=sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249 \ + --hash=sha256:6972ca9c9cc9f0acaa56a8ca1ff51e7af152a9f87fb64623e31d5c83700080ee \ + --hash=sha256:7fc04e92e1d624a4a63c76474610238576942d6b8950a2d7f908a340494e67e4 \ + --hash=sha256:889f80ef92701b9dbb224e49ec87c645ce5df3fa2cc548664eb8a25e03127a98 \ + --hash=sha256:8d57ca8095a641b8237d5b079147646153d22552f1c637fd3ba7f4b0b29167a8 \ + --hash=sha256:8dd28b3e155b80f4d54beb40a441d366adcfe740969820caf156c019fb5c7ec4 \ + --hash=sha256:9316dc65bed1684c9a98ee68759ceaed29d229e985297003e494aa825ebb0281 \ + --hash=sha256:a198f10c4d1b1375d7687bc25294306e551bf1abfa4eace6650070a5c1ae2744 \ + --hash=sha256:a38aa0308e754b0e3c67e344754dff64999ff9b513e691d0e786265c93583c69 \ + --hash=sha256:a92ef1a44547e894e2a17d24e7557a5e85a9e1d0048b0b5e7541f76c5032cb13 \ + --hash=sha256:ac065718db92ca818f8d6141b5f66369833d4a80a9d74435a268c52bdfa73140 \ + --hash=sha256:b82ebccc8c8a36f2094e969560a1b836758481f3dc360ce9a3277c65f374285e \ + --hash=sha256:c954d2250168d28797dd4e3ac5cf812a406cd5a92674ee4c8f123c889786aa8e \ + --hash=sha256:cb55c73c5f4408779d0cf3eef9f762b9c9f147a77de7b258bef0a5628adc85cc \ + --hash=sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff \ + --hash=sha256:d3f5614314d758649ab2ab3a62d4f2004c825922f9e370b29416484086b264ec \ + --hash=sha256:d920f33822747519673ee656a4b6ac33e382eca9d331c87770faa3eef562aeb2 \ + --hash=sha256:db2b95f9de79181805df90bedc5a5ab4c165e6ec3fe99f970d0e302f384ad222 \ + --hash=sha256:e59e304978767a54663af13c07b3d1af22ddee3bb2fb0618ca1593e4f593a106 \ + --hash=sha256:e85e99945e688e32d5a35c1ff38ed0b3f41f43fad8df0bdf79f72b2ba7bc5272 \ + --hash=sha256:ece47d672db52ac607a3d9599a9d48dcb2f2f735c6c2d1f34130085bb12b112a \ + --hash=sha256:f4039b9cbc3048b2416cc57ab3bda989a6fcf9b36cf8937f01a6e731b64f80d7 # via # deptry # pylint @@ -379,9 +409,9 @@ tomlkit==0.13.0 \ # via # bump-my-version # pylint -tox==4.23.2 \ - --hash=sha256:452bc32bb031f2282881a2118923176445bac783ab97c874b8770ab4c3b76c38 \ - --hash=sha256:86075e00e555df6e82e74cfc333917f91ecb47ffbc868dcafbd2672e332f4a2c +tox==4.24.1 \ + --hash=sha256:083a720adbc6166fff0b7d1df9d154f9d00bfccb9403b8abf6bc0ee435d6a62e \ + --hash=sha256:57ba7df7d199002c6df8c2db9e6484f3de6ca8f42013c083ea2d4d1e5c6bdc75 # via # -r CI/requirements_ci.in # tox-gh @@ -406,9 +436,9 @@ urllib3==2.2.2 \ --hash=sha256:a448b2f64d686155468037e1ace9f2d2199776e17f0a46610480d311f73e3472 \ --hash=sha256:dd505485549a7a552833da5e6063639d0d177c04f23bc3864e41e5dc5f612168 # via requests -virtualenv==20.26.6 \ - --hash=sha256:280aede09a2a5c317e409a00102e7077c6432c5a38f0ef938e643805a7ad2c48 \ - --hash=sha256:7345cc5b25405607a624d8418154577459c3e0277f5466dd79c49d5e492995f2 +virtualenv==20.29.1 \ + --hash=sha256:4e4cb403c0b0da39e13b46b1b2476e505cb0046b25f242bee80f62bf990b2779 \ + --hash=sha256:b8b8970138d32fb606192cb97f6cd4bb644fa486be9308fb9b63f81091b5dc35 # via tox wcmatch==8.5.2 \ --hash=sha256:17d3ad3758f9d0b5b4dedc770b65420d4dac62e680229c287bf24c9db856a478 \ diff --git a/pyproject.toml b/pyproject.toml index e97321209..e7b8dc577 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -61,11 +61,11 @@ dev = [ # Dev tools and testing "black[jupyter] ==24.10.0", "blackdoc ==0.3.9", - "bump-my-version ==0.29.0", - "codespell ==2.3.0", + "bump-my-version ==0.30.0", + "codespell ==2.4.0", "coverage[toml] >=7.5.0", "coveralls >=4.0.1", # coveralls is not yet compatible with Python 3.13 - "deptry ==0.22.0", + "deptry ==0.23.0", "flake8 >=7.1.1", "flake8-rst-docstrings >=0.3.0", "h5netcdf>=1.3.0",