From 7ed6c1d71cd976e1b61f7d841e9fedec6f47150f Mon Sep 17 00:00:00 2001 From: Dominik Jain Date: Mon, 9 Oct 2023 14:21:36 +0200 Subject: [PATCH] Remove obsolete module highlevel.utils --- tianshou/highlevel/utils.py | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 tianshou/highlevel/utils.py diff --git a/tianshou/highlevel/utils.py b/tianshou/highlevel/utils.py deleted file mode 100644 index 0b130a6..0000000 --- a/tianshou/highlevel/utils.py +++ /dev/null @@ -1,24 +0,0 @@ -from dataclasses import asdict, is_dataclass - - -def collect_configs(*confs): - """Collect instances of dataclasses to a single dict mapping the classname to the values. - - If any of the passed objects is not a ddataclass or if two instances - of the same config class are passed, an error will be raised. - - :param confs: dataclasses - :return: Dictionary mapping class names to their instances. - """ - result = {} - - for conf in confs: - if not is_dataclass(conf): - raise ValueError(f"Object {conf.__class__.__name__} is not a dataclass.") - - if conf.__class__.__name__ in result: - raise ValueError(f"Duplicate instance of {conf.__class__.__name__} found.") - - result[conf.__class__.__name__] = asdict(conf) - - return result