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 .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -473,4 +473,5 @@ jobs:
uses: green-coding-solutions/eco-ci-energy-estimation@e79d33b08b0c47de4438c161d432730fce23f246 # v4.2.0
with:
task: display-results
pr-comment: true
continue-on-error: true
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
70 changes: 65 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 | |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.
Expand Down Expand Up @@ -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/
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Loading