mlco2/codecarbon

Too many variables when initializing the EmissionsTracker

Offen

#404 geöffnet am 05.05.2023

 (3 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Python (306 Forks)auto 404
enhancementgood first issue

Repository-Metriken

Stars
 (1.885 Sterne)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

Description

The BaseEmissionsTracker accepts 22 variables when initialized (and growing). This could lead to potential issues. And it is a known code smell.

What I Propose

Refactor the input variables to accept a config dict object as input.

So instead of

EmissionsTracker(project_name: "My project", measure_power_secs=10, output_dir="./temp")

codecarbon could do

config_options = {
    project_name: "My project",
    measure_power_secs=10,
    output_dir="./temp",
}
EmissionsTracker(config_options)

Contributor Guide