From cc76cf20179089f86b69c9687a648de6e5a5c4c1 Mon Sep 17 00:00:00 2001 From: pesap Date: Mon, 4 Nov 2024 10:03:29 -0700 Subject: [PATCH] fix: Correctly assign `output_active_power_limits` (#59) Closes #58 --- src/r2x/exporter/sienna.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/r2x/exporter/sienna.py b/src/r2x/exporter/sienna.py index f6ecd38..b9ed669 100644 --- a/src/r2x/exporter/sienna.py +++ b/src/r2x/exporter/sienna.py @@ -408,6 +408,7 @@ def process_storage_data(self, fname="storage.csv") -> None: generic_storage = get_export_records( list(self.system.to_records(Storage)), partial(apply_property_map, property_map=self.property_map), + partial(apply_flatten_key, keys_to_flatten={"active_power_limits"}), partial(apply_pint_deconstruction, unit_map=self.unit_map), # partial(apply_valid_properties, valid_properties=output_fields), ) @@ -422,8 +423,8 @@ def process_storage_data(self, fname="storage.csv") -> None: for storage in storage_list: output_dict = storage output_dict["generator_name"] = storage["name"] - output_dict["input_active_power_limit_max"] = output_dict["active_power"] - output_dict["output_active_power_limit_max"] = output_dict["active_power"] + output_dict["input_active_power_limit_max"] = output_dict["active_power_limits_max"] + output_dict["output_active_power_limit_max"] = output_dict["active_power_limits_max"] # NOTE: If we need to change this in the future, we could probably # use the function max to check if the component has the field. output_dict["input_active_power_limit_min"] = 0 # output_dict["active_power"]