Prioritize kroend over krowend/krogend - #504
Open
bartekvik wants to merge 1 commit into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #504 +/- ##
=======================================
Coverage 98.79% 98.80%
=======================================
Files 18 18
Lines 2664 2682 +18
=======================================
+ Hits 2632 2650 +18
Misses 32 32 ☔ View full report in Codecov by Harness. |
bartekvik
force-pushed
the
Kroend_prioritize
branch
from
June 11, 2026 12:15
a942f84 to
3ba1f5f
Compare
bartekvik
force-pushed
the
Kroend_prioritize
branch
from
July 1, 2026 13:38
3ba1f5f to
620a68d
Compare
Treat NaN kroend as missing and fall back to legacy endpoints
bartekvik
force-pushed
the
Kroend_prioritize
branch
from
July 2, 2026 08:41
620a68d to
95efa64
Compare
There was a problem hiding this comment.
Pull request overview
Updates three-phase factory endpoint normalization to prioritize legacy kroend while retaining phase-specific fallback behavior.
Changes:
- Adds NaN-aware endpoint selection and warning behavior.
- Expands tests for priority, normalization, and NaN handling.
- Identified outdated public documentation requiring correction.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/pyscal/factory.py |
Implements endpoint priority and fallback logic. |
tests/test_factory.py |
Tests priority, warnings, normalization, and NaN cases. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+1427
to
+1430
| - If only 'krowend' is present and not NaN, map it to 'kroend'. | ||
| - If both 'krowend' and 'kroend' are present, treat NaN as missing for | ||
| endpoint selection; when both are valid, legacy 'kroend' is prioritized. | ||
| - Log a warning only when both are present and both are not NaN. |
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.
This PR modifies the functionality introduced in #471 to prioritize
kroend(legacy) overkrowend/krogend. This is in relation to a condensate system.Background
PR #471 introduced support for phase-specific endpoint keys (
krowendfor WaterOil andkrogendfor GasOil).Some existing workflows still provide
kroend, and rely on it being used when multiple endpoint keys are present.PR Changes
krowend,krogendkroendwhen it is present together with the phase-specific keyskroendcontains a valid value, it is used (highest priority).kroendis missing or contains NaN,kroendis treated as unavailable and the implementation falls back to the phase-specific endpoints:krowendmaps to WaterOil kroend.krogendmaps to GasOil kroend.This ensures correct behavior for the edge case where
kroendis present in the input but its value is NaN.krowend/krogend).-fallback to phase-specific keys when
kroendis NaN-keep
kroendwhen phase-specific keys are NaN-no warning when one side is NaN
-phase-specific keys are removed from output representations
Behavior
kroendis present: it is used (highest priority).kroendis absent:krowendmaps to WaterOil kroend.krogendmaps to GasOil kroend.Backward Compatibility
kroendcontinue to work as expected.kroend.