File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 33from __future__ import annotations
44
55import datetime as dt
6+ import importlib
67from pathlib import Path
7- from typing import Any
8+ from typing import Any , cast
89
910import pandas as pd
10- import yaml # type: ignore[import-untyped]
1111
1212from cardvalue_ml .config import paths
1313from cardvalue_ml .features .build_features import prepare_regression_features
1414from cardvalue_ml .models .evaluate import save_json
1515from cardvalue_ml .models .train import train_random_forest
1616
17+ yaml = cast (Any , importlib .import_module ("yaml" ))
18+
1719
1820def load_experiment_config (config_path : Path ) -> dict [str , Any ]:
1921 if not config_path .exists ():
@@ -22,7 +24,7 @@ def load_experiment_config(config_path: Path) -> dict[str, Any]:
2224 config = yaml .safe_load (handle )
2325 if not isinstance (config , dict ):
2426 raise ValueError ("Experiment config must be a mapping" )
25- return config
27+ return cast ( dict [ str , Any ], config )
2628
2729
2830def run_experiment (config_path : Path ) -> dict [str , Any ]:
You can’t perform that action at this time.
0 commit comments