Skip to content

Ecoclient Simvue Python API Extension #752

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

Merged
merged 41 commits into from
Mar 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
1ab36df
Remove CodeCarbon from Python API
kzscisoft Mar 6, 2025
ddabec6
Fix emission metric sending
kzscisoft Mar 7, 2025
4978446
Fix wrong variable name
kzscisoft Mar 7, 2025
3916018
Merge branch 'dev' into feature/ecoclient
kzscisoft Mar 13, 2025
333d374
Fix co2 monitor default
kzscisoft Mar 17, 2025
223d4c3
Remove extra parameter from _start
kzscisoft Mar 17, 2025
bd66480
Added path field validation
kzscisoft Mar 19, 2025
8f79810
Refactor of heartbeat code
kzscisoft Mar 19, 2025
bd10c44
Started simplifying ecoclient
kzscisoft Mar 19, 2025
3aab367
Fix emissions estimates using resource metrics CPU info
kzscisoft Mar 20, 2025
2f104e8
Add GPU metrics
kzscisoft Mar 20, 2025
08dc7a0
Format code
kzscisoft Mar 20, 2025
933ba92
Fix loop frequency to be 1s
kzscisoft Mar 20, 2025
f885caf
Fix bad refresh rate for CO2 signal and added CO2 signal mocking
kzscisoft Mar 24, 2025
5f5fcfa
Add CO2 intensity refresh to sender
kzscisoft Mar 25, 2025
6d1917d
Merge branch 'dev' into feature/ecoclient
kzscisoft Mar 25, 2025
3e08099
Remove unneeded extra thread in sender
kzscisoft Mar 25, 2025
eacbe45
Resolve stability of log_metrics test
kzscisoft Mar 25, 2025
af4d0e3
[skip ci] Updated changelog
kzscisoft Mar 25, 2025
3acce87
Merge branch 'dev' into feature/ecoclient
kzscisoft Mar 25, 2025
bae9ade
Re-write abort python on alert test
kzscisoft Mar 25, 2025
30da207
Merge branch 'dev' into feature/ecoclient
kzscisoft Mar 25, 2025
6538fc6
Fix monitor tests
kzscisoft Mar 25, 2025
4de2f5f
Simplified and fixed the emissions run tests
kzscisoft Mar 26, 2025
01f8c0b
Fix bad code inclusion of 'attach_process' for emissions monitor
kzscisoft Mar 27, 2025
b2811f0
Fix 0 GPUs bug
kzscisoft Mar 27, 2025
462e7be
Renamed resource metrics interval to system metrics interval
kzscisoft Mar 28, 2025
ebef998
Add Python3.10 support for CO2 timestamp parsing
kzscisoft Mar 28, 2025
444805d
Tidy error response from CO2 signal API
kzscisoft Mar 28, 2025
1626f17
Reactivate sorting tests
kzscisoft Mar 28, 2025
9c5317e
Fix Co2 client logic, do not get from CO2 signal if value provided
kzscisoft Mar 28, 2025
ff41785
Do not refresh if offline
kzscisoft Mar 28, 2025
b0545e5
Added local refresh and handling of complete offline running for CO2
kzscisoft Mar 28, 2025
74f00f2
Added Number of CPU cores to config
kzscisoft Mar 28, 2025
37d900b
Added intensity units to log message
kzscisoft Mar 28, 2025
2437e37
Fix refresh on first run offline
kzscisoft Mar 28, 2025
01b5ff8
Correct step 0 emissions measure
kzscisoft Mar 28, 2025
bbe4b4f
Test parallelization
kzscisoft Mar 28, 2025
d352d7e
Mock location info for international test running
kzscisoft Mar 28, 2025
4099b79
Fix handling of no local emission data
kzscisoft Mar 28, 2025
ff59423
Run non offline/online tests in CI
kzscisoft Mar 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 111 additions & 7 deletions .github/workflows/test_client_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,95 @@ concurrency:
cancel-in-progress: true

jobs:
build:

online_unit_tests:
runs-on: ubuntu-latest
timeout-minutes: 40
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install dependencies
run: |
python -m pip install poetry
poetry self add poetry-plugin-export
poetry export -f requirements.txt --with dev -o requirements.txt --all-extras
python -m pip install torch --index-url https://download.pytorch.org/whl/cpu
python -m pip install -r requirements.txt
python -m pip install .
- name: Test with pytest
env:
SIMVUE_URL: ${{ secrets.SIMVUE_URL }}
SIMVUE_TOKEN: ${{ secrets.SIMVUE_TOKEN }}
run: python -m pytest tests/unit/ -x -m online -c /dev/null -p no:warnings -n 0 -v
offline_unit_tests:
runs-on: ubuntu-latest
timeout-minutes: 40
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install dependencies
run: |
python -m pip install poetry
poetry self add poetry-plugin-export
poetry export -f requirements.txt --with dev -o requirements.txt --all-extras
python -m pip install torch --index-url https://download.pytorch.org/whl/cpu
python -m pip install -r requirements.txt
python -m pip install .
- name: Test with pytest
env:
SIMVUE_URL: ${{ secrets.SIMVUE_URL }}
SIMVUE_TOKEN: ${{ secrets.SIMVUE_TOKEN }}
run: python -m pytest tests/unit/ -x -m offline -c /dev/null -p no:warnings -n 0 -v
online_functional_tests:
runs-on: ubuntu-latest
timeout-minutes: 40
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install dependencies
run: |
python -m pip install poetry
poetry self add poetry-plugin-export
poetry export -f requirements.txt --with dev -o requirements.txt --all-extras
python -m pip install torch --index-url https://download.pytorch.org/whl/cpu
python -m pip install -r requirements.txt
python -m pip install .
- name: Test with pytest
env:
SIMVUE_URL: ${{ secrets.SIMVUE_URL }}
SIMVUE_TOKEN: ${{ secrets.SIMVUE_TOKEN }}
run: python -m pytest tests/functional/ -x -m online -c /dev/null -p no:warnings -n 0 -v
offline_functional_tests:
runs-on: ubuntu-latest
timeout-minutes: 40
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install dependencies
run: |
python -m pip install poetry
poetry self add poetry-plugin-export
poetry export -f requirements.txt --with dev -o requirements.txt --all-extras
python -m pip install torch --index-url https://download.pytorch.org/whl/cpu
python -m pip install -r requirements.txt
python -m pip install .
- name: Test with pytest
env:
SIMVUE_URL: ${{ secrets.SIMVUE_URL }}
SIMVUE_TOKEN: ${{ secrets.SIMVUE_TOKEN }}
run: python -m pytest tests/functional/ -x -m offline -c /dev/null -p no:warnings -n 0 -v
other_unit_tests:
runs-on: ubuntu-latest
timeout-minutes: 40
steps:
Expand All @@ -40,9 +127,26 @@ jobs:
env:
SIMVUE_URL: ${{ secrets.SIMVUE_URL }}
SIMVUE_TOKEN: ${{ secrets.SIMVUE_TOKEN }}
run: python -m pytest tests/ -x --cov --cov-report=xml -m 'not scenario' -c /dev/null -p no:warnings -n 0 -v
- name: Upload coverage reports to Codecov
run: python -m pytest tests/unit/ -x -m 'not offline' -m 'not online' -m 'not scenario' -c /dev/null -p no:warnings -n 0 -v
other_functional_tests:
runs-on: ubuntu-latest
timeout-minutes: 40
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install dependencies
run: |
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
./codecov -t ${CODECOV_TOKEN}
python -m pip install poetry
poetry self add poetry-plugin-export
poetry export -f requirements.txt --with dev -o requirements.txt --all-extras
python -m pip install torch --index-url https://download.pytorch.org/whl/cpu
python -m pip install -r requirements.txt
python -m pip install .
- name: Test with pytest
env:
SIMVUE_URL: ${{ secrets.SIMVUE_URL }}
SIMVUE_TOKEN: ${{ secrets.SIMVUE_TOKEN }}
run: python -m pytest tests/functional/ -x -m 'not offline' -m 'not online' -m 'not scenario' -c /dev/null -p no:warnings -n 0 -v
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Change log

## Unreleased
* Removed CodeCarbon dependence in favour of a slimmer solution using the CO2 Signal API.
* Added sorting to server queries, users can now specify to sort by columns during data retrieval from the database.
## [v2.0.1](https://github.com/simvue-io/client/releases/tag/v2.0.1) - 2025-03-24
* Improvements to docstrings on methods, classes and functions.
Expand Down
62 changes: 0 additions & 62 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -42,67 +42,5 @@ keywords:
- alerting
- simulation
license: Apache-2.0
commit: 5084f9c17ae4b7f77e188f5aa8a51ebd3f790c9e
version: 2.0.1
date-released: '2025-03-24'
references:
- title: mlco2/codecarbon
version: v2.8.2
type: software
date-released: 2024-12-08
doi: 10.5281/zenodo.14518377
url: https://doi.org/10.5281/zenodo.14518377
repository-code: https://github.com/mlco2/codecarbon
authors:
- given-names: Benoit
family-names: Courty
- given-names: Victor
family-names: Schmidt
- given-names: Sasha
family-names: Luccioni
- given-names: Goyal
family-names: Kamal
- given-names: Marion
family-names: Coutarel
- given-names: Boris
family-names: Feld
- given-names: Jérémy
family-names: Lecourt
- given-names: Liam
family-names: Connell
- given-names: Amine
family-names: Saboni
- given-names: Mathilde
family-names: Léval
- given-names: Luis
family-names: Blanche
- given-names: Alexis
family-names: Cruveiller
- given-names: Franklin
family-names: Zhao
- given-names: Aditya
family-names: Joshi
- given-names: Alexis
family-names: Bogroff
- given-names: Hugues
family-names: de Lavoreille
- given-names: Niko
family-names: Laskaris
- given-names: Edoardo
family-names: Abati
- given-names: Douglas
family-names: Blank
- given-names: Ziyao
family-names: Wang
- given-names: Armin
family-names: Catovic
- given-names: Marc
family-names: Alencon
- given-names: Michał
family-names: Stęchły
- given-names: Christian
family-names: Bauer
- given-names: Lucas Otávio N.
family-names: de Araújo
- given-names: Minerva
family-names: Books
Loading
Loading