mlco2 / codecarbon

Track emissions from Compute and recommend ways to reduce their impact on the environment.
https://mlco2.github.io/codecarbon
MIT License
1k stars 157 forks source link

fix: pre-commit error with python 3.12 #514

Closed inimaz closed 3 months ago

inimaz commented 3 months ago

Closes #465

Before this PR

codecarbon/core/emissions.py:219:71: E226 missing whitespace around arithmetic operator
codecarbon/viz/carbonboard.py:89:65: E231 missing whitespace after ','
codecarbon/viz/carbonboard.py:92:59: E231 missing whitespace after ','
codecarbon/viz/carbonboard_on_api.py:90:65: E231 missing whitespace after ','
codecarbon/viz/carbonboard_on_api.py:93:59: E231 missing whitespace after ','
examples/task_inference.py:51:28: E201 whitespace after '{'
examples/task_inference.py:51:70: E201 whitespace after '{'
examples/task_inference.py:51:111: E201 whitespace after '{'

Steps done

  1. Update isort + flake8 + black to their latest versions with
    pre-commit autoupdate
  2. Change manually the files mentioned above
  3. Add autoflake