MCPcopy Create free account
hub / github.com/mlco2/codecarbon / write_local_exp_id

Function write_local_exp_id

codecarbon/cli/cli_utils.py:54–66  ·  view source on GitHub ↗
(exp_id, path: Optional[Path] = None)

Source from the content-addressed store, hash-verified

52
53
54def write_local_exp_id(exp_id, path: Optional[Path] = None):
55 p = path or Path.cwd().resolve() / ".codecarbon.config"
56
57 config = configparser.ConfigParser()
58 if p.exists():
59 config.read(str(p))
60 if "codecarbon" not in config.sections():
61 config.add_section("codecarbon")
62
63 config["codecarbon"]["experiment_id"] = exp_id
64
65 with p.open("w") as f:
66 config.write(f)
67
68
69def overwrite_local_config(config_name, value, path: Optional[Path] = None):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…