From bda5b402cd6143c06246b04dfa6d9e8cda3b6141 Mon Sep 17 00:00:00 2001 From: Raul Ciria Aylagas <53448419+Raul-Ciria-Aylagas@users.noreply.github.com> Date: Wed, 11 Oct 2023 14:33:48 +0200 Subject: [PATCH] BUGFIX: GenericStorage investment initialization The __init__ method was malfunctioning with the preferred way to declare investments in the attr nominal_storage_capacity. Probably due to code legacy from older versions. --- src/oemof/solph/components/_generic_storage.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/oemof/solph/components/_generic_storage.py b/src/oemof/solph/components/_generic_storage.py index a10e02ca3..c24ddd2f8 100644 --- a/src/oemof/solph/components/_generic_storage.py +++ b/src/oemof/solph/components/_generic_storage.py @@ -217,7 +217,7 @@ def __init__( if isinstance(nominal_storage_capacity, numbers.Real): self.nominal_storage_capacity = nominal_storage_capacity elif isinstance(nominal_storage_capacity, Investment): - self.investment = investment + self.investment = nominal_storage_capacity self._invest_group = True self.initial_storage_level = initial_storage_level @@ -235,11 +235,9 @@ def __init__( self.min_storage_level = solph_sequence(min_storage_level) self.fixed_costs = solph_sequence(fixed_costs) self.storage_costs = solph_sequence(storage_costs) - self.investment = investment self.invest_relation_input_output = invest_relation_input_output self.invest_relation_input_capacity = invest_relation_input_capacity self.invest_relation_output_capacity = invest_relation_output_capacity - self._invest_group = isinstance(self.investment, Investment) self.lifetime_inflow = lifetime_inflow self.lifetime_outflow = lifetime_outflow