Skip to content

Commit 7b1ad96

Browse files
committed
simplify config
1 parent bfe3c80 commit 7b1ad96

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

alphadia/workflow/config.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ class Config(UserDict):
2828
"""Dict-like config class that can read from and write to yaml and json files and allows updating with other config objects."""
2929

3030
def __init__(self, data: dict = None, name: str = DEFAULT) -> None:
31-
# super class deliberately not called
31+
# super class deliberately not called as this calls "update" (which we overwrite)
3232
self.data = (
3333
{**data} if data is not None else {}
3434
) # this needs to be called 'data' as we inherit from UserDict
35-
self.experiment_name = name
35+
self.name = name
3636

3737
def from_yaml(self, path: str) -> None:
3838
with open(path) as f:
@@ -74,11 +74,6 @@ def update(self, configs: list["Config"], do_print: bool = False):
7474
do_print : bool, optional
7575
Whether to print the modified config. Default is False.
7676
"""
77-
if isinstance(experiments, dict):
78-
# need to resolve name clash with basic method unless we find a better name for 'our' update
79-
super().update(experiments)
80-
return
81-
8277
# we assume that self.data holds the default config
8378
default_config = deepcopy(self.data)
8479

@@ -88,7 +83,6 @@ def _recursive_defaultdict():
8883

8984
tracking_dict = defaultdict(_recursive_defaultdict)
9085

91-
9286
current_config = deepcopy(self.data)
9387
for config in configs:
9488
logger.info(f"Updating config with '{config.name}'")

0 commit comments

Comments
 (0)