From 165d42a675c7ebb789b6435aaeab8ead8dee7d41 Mon Sep 17 00:00:00 2001 From: Diego Alonso Alvarez Date: Thu, 5 Sep 2024 07:53:04 +0100 Subject: [PATCH] Apply patches after loading config file. --- wsimod/orchestration/model.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wsimod/orchestration/model.py b/wsimod/orchestration/model.py index 8e890175..50507249 100644 --- a/wsimod/orchestration/model.py +++ b/wsimod/orchestration/model.py @@ -157,6 +157,8 @@ def load(self, address, config_name="config.yml", overrides={}): config_name: overrides: """ + from ..extensions import apply_patches + with open(os.path.join(address, config_name), "r") as file: data = yaml.safe_load(file) @@ -191,6 +193,8 @@ def load(self, address, config_name="config.yml", overrides={}): if "dates" in data.keys(): self.dates = [to_datetime(x) for x in data["dates"]] + apply_patches(self) + def save(self, address, config_name="config.yml", compress=False): """Save the model object to a yaml file and input data to csv.gz format in the directory specified.