diff --git a/hiro_models/model_auxiliary.py b/hiro_models/model_auxiliary.py index 4297525..bed6cf8 100644 --- a/hiro_models/model_auxiliary.py +++ b/hiro_models/model_auxiliary.py @@ -42,9 +42,11 @@ def model_db(data_path: str = "./.data"): db_path.touch(exist_ok=True) with db_path.open("r+") as f: data = f.read() - db = ( - JSONEncoder.loads(data, object_hook=model_hook) if len(data) > 0 else {} - ) + db = JSONEncoder.loads(data) if len(data) > 0 else {} + db = { + key: model_hook(value) if isinstance(value, dict) else value + for key, value in db.items() + } yield db @@ -76,7 +78,7 @@ def model_hook(dct: dict[str, Any]): if model == "OttoEngine": return OttoEngine.from_dict(treated_vals) - return object_hook(dct) + return dct def integrate_multi(models: Sequence[Model], *args, **kwargs): diff --git a/hiro_models/utility.py b/hiro_models/utility.py index 330e2de..4157f9e 100644 --- a/hiro_models/utility.py +++ b/hiro_models/utility.py @@ -63,7 +63,6 @@ class JSONEncoder(json.JSONEncoder): @default.register(tuple) def _(self, obj: tuple): - print("ho") return { "type": "tuple", "value": list(*obj),