Load the arguments from a file.
(cls: type[ArgType], file: Path)
| 25 | |
| 26 | @classmethod |
| 27 | def load(cls: type[ArgType], file: Path) -> ArgType: |
| 28 | """Load the arguments from a file.""" |
| 29 | with open(file) as f: |
| 30 | data = json.load(f) |
| 31 | data["metric"] = Metric.from_string(data["metric"]) |
| 32 | return cls(**data) |
| 33 | |
| 34 | def dict(self) -> dict[str, Any]: |
| 35 | """Dump the arguments to a dict.""" |
no test coverage detected