little refactoring done

This commit is contained in:
Ayzen
2026-03-10 17:33:25 +03:00
parent 9c745f304e
commit 1f715ce22c
10 changed files with 520 additions and 245 deletions
+5 -3
View File
@@ -3,6 +3,7 @@
from __future__ import annotations
from dataclasses import dataclass, field
import json
from pathlib import Path
from typing import Any
@@ -131,9 +132,10 @@ class RunConfigModel:
@classmethod
def load_from_path(cls, path: Path) -> RunConfigModel:
"""Load JSON file from disk and decode into model."""
from python_app.models.run_config_codec import load_run_config
return load_run_config(path)
payload = json.loads(path.read_text(encoding="utf-8"))
if not isinstance(payload, dict):
raise ValueError(f"Config root must be JSON object: {path}")
return cls.from_dict(payload)
def clone(self) -> RunConfigModel:
"""Create deep copy through codec round-trip."""