mlco2 / mlco2/codecarbon

Refactor output methods

Open
#541 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement question
Dominant language
Python
Stars
1.9k
Forks
323
Avg merge
1d 12h
Merged PRs (30d)
12

Description

Goal

For every output method of the emissions tracker, we have a save_to_X param to pass.
See : https://github.com/mlco2/codecarbon/blob/master/codecarbon/emissions_tracker.py#L229-L236
This can become very complex in the long run.

A nice thing will be to have just one param called output that allows an array of strings.

Before

EmissionTracker( save_to_api=True, save_to_file= True, ...)

After

EmissionTracker( output=["api","file"] ...)

What do you think?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with codecarbon/emissions_tracker.py around lines 229-236, where the current save_to_X parameters are defined. Trace how each output method is configured and identify the tests covering those options. Done means output can select multiple destinations while preserving the intended output behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.