Skip to content

Commit

Permalink
fix: bug in compressor with turbine models with multiple streams and …
Browse files Browse the repository at this point in the history
…only one date (#296)
  • Loading branch information
olelod authored Nov 23, 2023
1 parent 17fe9ce commit 8c2c786
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
get_condition_from_expression,
get_power_loss_factor_from_expression,
)
from libecalc.core.models.compressor.base import CompressorModel
from libecalc.core.models.compressor.base import (
CompressorModel,
CompressorWithTurbineModel,
)
from libecalc.core.models.compressor.train.variable_speed_compressor_train_common_shaft_multiple_streams_and_pressures import (
VariableSpeedCompressorTrainCommonShaftMultipleStreamsAndPressures,
)
Expand Down Expand Up @@ -74,8 +77,13 @@ def evaluate(
]
)
# Squeeze to remove axes of length one -> non-multiple streams will be 1d and not 2d.
# But we don't want to squeeze multiple streams model with only one date
if isinstance(self._compressor_function, VariableSpeedCompressorTrainCommonShaftMultipleStreamsAndPressures):
# But we don't want to squeeze multiple streams model with only one date.
# That goes for CompressorWithTurbineModel with a MultipleStreamsAndPressures-train as well
if isinstance(self._compressor_function, CompressorWithTurbineModel):
compressor_model = self._compressor_function.compressor_model
else:
compressor_model = self._compressor_function
if isinstance(compressor_model, VariableSpeedCompressorTrainCommonShaftMultipleStreamsAndPressures):
stream_day_rate = Rates.to_stream_day(
calendar_day_rates=calendar_day_rates,
regularity=regularity,
Expand Down

0 comments on commit 8c2c786

Please sign in to comment.