(exp_id, path: Optional[Path] = None)
| 52 | |
| 53 | |
| 54 | def 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 | |
| 69 | def overwrite_local_config(config_name, value, path: Optional[Path] = None): |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…