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

Refactor output methods #541

Open
inimaz opened this issue May 4, 2024 · 1 comment
Open

Refactor output methods #541

inimaz opened this issue May 4, 2024 · 1 comment
Labels
enhancement New feature or request question Further information is requested

Comments

@inimaz
Copy link
Contributor

inimaz commented May 4, 2024

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?

@inimaz inimaz added enhancement New feature or request question Further information is requested labels May 4, 2024
@LuisBlanche
Copy link
Contributor

Hey ! Why not but it is important to avoid using mutable default arguments

I don't see any 'list' types in the current __init__ method so we need to check whether this works with the _sentinel pattern works with lists

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants