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

Function get_existing_exp_id

codecarbon/cli/cli_utils.py:42–51  ·  view source on GitHub ↗

Return experiment_id resolved from the same hierarchical config strategy used by EmissionsTracker (global file, local file, then CODECARBON_* env).

()

Source from the content-addressed store, hash-verified

40
41
42def get_existing_exp_id() -> Optional[str]:
43 """
44 Return experiment_id resolved from the same hierarchical config strategy
45 used by EmissionsTracker (global file, local file, then CODECARBON_* env).
46 """
47 try:
48 conf = get_hierarchical_config()
49 except KeyError:
50 return None
51 return conf.get("experiment_id")
52
53
54def write_local_exp_id(exp_id, path: Optional[Path] = None):

Callers 1

monitorFunction · 0.90

Calls 1

get_hierarchical_configFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…