feat(solver): add structured failure events to Solution#1458
Merged
Conversation
1209514 to
854a522
Compare
tj098895
reviewed
Mar 25, 2026
1dcbba5 to
ac95db4
Compare
tj098895
approved these changes
Mar 26, 2026
ac95db4 to
f4c7294
Compare
olelod
commented
Mar 26, 2026
|
|
||
| current_inlet = inlet_stream | ||
| overall_success = True | ||
| failure_event: SolverFailureEvent | None = None |
Contributor
Author
There was a problem hiding this comment.
only first failure that occurs
olelod
commented
Mar 26, 2026
| configurations[pressure_control_configuration.simulation_unit_id] = pressure_control_configuration | ||
|
|
||
| failure_event = pressure_control_solution.failure_event | ||
| if isinstance(failure_event, TargetNotAchievableEvent) and failure_event.source_id is None: |
Contributor
Author
There was a problem hiding this comment.
if the failure occurs within common_asv or individual_asv there is no process_system_id available when the failure occurs. add it here.
Contributor
|
@olelod dont see any reason to not merge it despite that it is not "complete" :) |
Replace bare success=False returns with typed failure events: - OutsideCapacityEvent: rate above stonewall or below surge, with required source_id (ProcessUnitId) and optional actual/boundary values (m3/h) - TargetNotAchievableEvent: pressure target out of achievable range, with achievable/target values (bara) and optional source_id (ProcessSystemId) Compressor passes its process_unit_id (required) when raising RateTooHighError/ RateTooLowError. OutletPressureSolver takes a required process_system_id such that TargetNotAchievableEvent in multi pressure system can trace which segment failed.
f4c7294 to
e6ee51f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace bare success=False returns with typed failure events:
Type of Work
See here (internal): https://github.com/equinor/ecalc-internal/discussions/1044
Have you remembered and considered?
docs/drafts/next.draft.md)docs/docs/migration_guides/)BREAKING:in footer or!in headerWhat is this PR all about?
What else did you consider?
Between the lines?