Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More detailed energy and carbon stats #2046

Merged
merged 9 commits into from
Jan 20, 2025
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ New features and enhancements
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* New function ``ensemble.partition.general_partition`` (:pull:`2035`)
* Added a new ``xclim.indices.generic.bivariate_count_occurrences`` function to count instances where operations and performed and validated for two variables. (:pull:`2030`).
* `xclim` now tracks energy usage and carbon emissions ("last run", "average", and "total") during CI workflows using the `eco-ci-energy-estimation` GitHub Action. (:pull:`2046`).

Internal changes
^^^^^^^^^^^^^^^^
Expand Down
51 changes: 44 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ 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| |
+----------------------------+-----------------------------------------------------+

`xclim` is an operational Python library for climate services, providing numerous climate-related indicator tools
Expand All @@ -20,7 +20,7 @@ adjustment of climate model simulations, as well as climate model ensemble analy

`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:

Expand All @@ -32,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,
Expand Down Expand Up @@ -110,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_).
Expand All @@ -120,6 +133,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/
Expand Down Expand Up @@ -169,10 +183,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
Expand Down Expand Up @@ -215,3 +225,30 @@ 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| 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| 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| 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| 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| 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| 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)
Loading