Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion flixopt/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def __init__(
self.optional = optional
self.specific_effects: EffectValuesUser = specific_effects or {}
self.piecewise_effects = piecewise_effects
self._minimum_size = minimum_size if minimum_size is not None else CONFIG.modeling.EPSILON
self._minimum_size = minimum_size if minimum_size is not None else 0
self._maximum_size = maximum_size if maximum_size is not None else CONFIG.modeling.BIG # default maximum

def transform_data(self, flow_system: 'FlowSystem'):
Expand Down
6 changes: 3 additions & 3 deletions tests/test_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def test_flow_invest_optional(self, basic_flow_system_linopy):
flow.model.variables['Sink(Wärme)|size'] >= flow.model.variables['Sink(Wärme)|is_invested'] * 20,
)

def test_flow_invest_optional_wo_min_size(self, basic_flow_system_linopy):
def test_flow_invest_wo_min_size_optional(self, basic_flow_system_linopy):
flow_system = basic_flow_system_linopy
timesteps = flow_system.time_series_collection.timesteps

Expand Down Expand Up @@ -327,13 +327,13 @@ def test_flow_invest_wo_min_size_non_optional(self, basic_flow_system_linopy):
]
)

assert_var_equal(model['Sink(Wärme)|size'], model.add_variables(lower=1e-5, upper=100))
assert_var_equal(model['Sink(Wärme)|size'], model.add_variables(lower=0, upper=100))

# flow_rate
assert_var_equal(
flow.model.flow_rate,
model.add_variables(
lower=np.linspace(0.1, 0.5, timesteps.size) * 1e-5,
lower=0,
upper=np.linspace(0.5, 1, timesteps.size) * 100,
coords=(timesteps,),
),
Expand Down