mlco2 / codecarbon

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

feat(output): unifying execution of 'live' output handlers #459

Closed eledhwen closed 3 months ago

eledhwen commented 12 months ago

Following-up on discussion in https://github.com/mlco2/codecarbon/pull/458

eledhwen commented 3 months ago

Good! I like it thanks! You might have some conflicts when merging with master, since we have moved all the output_methods in output.py to a its own directory.

Indeed, I just rebased from master and re-dispatched the changes to the various output definitions.

inimaz commented 3 months ago

Seeing the output of the CI ==> There are 2 things @eledhwen :

  1. Run hatch run dev:precommit-install and commit again, this will apply the correct formatting
  2. In file codecarbon/output_methods/base_output.py Change from codecarbon.output import TaskEmissionsData to from codecarbon.output_methods.emissions_data import TaskEmissionsData==> to avoid circular dependencies.
eledhwen commented 3 months ago

Seeing the output of the CI ==> There are 2 things @eledhwen :

  1. Run hatch run dev:precommit-install and commit again, this will apply the correct formatting
  2. In file codecarbon/output_methods/base_output.py Change from codecarbon.output import TaskEmissionsData to from codecarbon.output_methods.emissions_data import TaskEmissionsData==> to avoid circular dependencies.

Done ✅

eledhwen commented 3 months ago

@inimaz I also fixed the impacted tests, it should be good to go now.

inimaz commented 3 months ago

@eledhwen Thanks for the feature! Looks good.