Skip to content

Commit ede5015

Browse files
committed
chore: require speed column in chart
1 parent 8591b09 commit ede5015

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/libecalc/presentation/yaml/mappers/process_simulation_mapper.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,16 @@ def _get_compressor_chart(self, yaml_compressor_model_chart: YamlCompressorModel
172172
resource = self._resources.get(resource_name)
173173
if resource is None:
174174
raise EcalcValidationException(f"Resource '{resource_name}' not found for variable speed chart.")
175+
if "SPEED" not in resource.get_headers():
176+
raise EcalcValidationException(
177+
f"Chart resource '{resource_name}' is missing required 'SPEED' column. "
178+
f"For single-speed charts, use the same speed value for all rows."
179+
)
175180
try:
176-
is_single_speed = "SPEED" not in resource.get_headers()
177181
return UserDefinedChartData.from_resource(
178182
resource,
179183
units=yaml_chart.units,
180-
is_single_speed=is_single_speed,
184+
is_single_speed=False,
181185
control_margin=control_margin_fraction,
182186
)
183187
except InvalidResourceException as e:

0 commit comments

Comments
 (0)