Make fidelity simulator tools self-contained

This commit is contained in:
2026-07-14 13:29:38 +08:00
parent a3b25f4a92
commit 12d1d4ad02
3 changed files with 21 additions and 0 deletions

View File

@@ -16,6 +16,9 @@ from typing import Any
def load_module(name: str, path: Path):
module_root = str(path.parent.resolve())
if module_root not in sys.path:
sys.path.insert(0, module_root)
spec = importlib.util.spec_from_file_location(name, path)
if spec is None or spec.loader is None:
raise ImportError(path)