Skip to content

fix: compressor sampled evaluation input validation#1244

Open
frodehk wants to merge 3 commits intomainfrom
fix/compressor-sampled-evaluation-input-validation
Open

fix: compressor sampled evaluation input validation#1244
frodehk wants to merge 3 commits intomainfrom
fix/compressor-sampled-evaluation-input-validation

Conversation

@frodehk
Copy link
Copy Markdown
Contributor

@frodehk frodehk commented Nov 25, 2025

Implement validation to ensure that the evaluation input for sampled compressor (qhull-based) models matches the required variables. The new validation raises a dedicated exception if any required input for the compressor's evaluation (rate, suction pressure, or discharge pressure) is missing.

Previously, the code did not check that the correct evaluation variables were always set. This likely hasn't caused issues because 'rate' is typically present in the user's input data (e.g., facility input). Several tests are added to confirm that the required inputs are enforced across 1D, 2D, and 3D models.

@frodehk frodehk self-assigned this Nov 25, 2025
@frodehk frodehk requested a review from a team as a code owner November 25, 2025 12:05
@kjbrak
Copy link
Copy Markdown
Contributor

kjbrak commented Nov 25, 2025

I think CompressorModelSampled would benefit from a better docstring explaining the init args. Not relevant to the implementation, but can consider adding/improving it. Its very confusing having those vaguely understandable variables in the init for example, like:
energy_usage_adjustment_constant: float, energy_usage_adjustment_factor: float, energy_usage_type: EnergyUsageType, energy_usage_values: list[float],

Also, could benefit from some more inline comments maybe, if you feel you are close to this code now and can make inline comments about the data flow then that could benefit future readers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants