fix: remove output fields subsumed by primitiveVars to prevent duplic…#1953
Merged
NasserFlexCompute merged 1 commit intorelease-candidate/25.9from Apr 2, 2026
Merged
Conversation
angranl-flex
approved these changes
Apr 2, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a solver JSON translation edge case where requesting both primitiveVars and pressure/velocity leads to duplicate VTK DataArray names (e.g., p, velocity), which can break ParaView when loading subsets of fields.
Changes:
- Add
remove_fields_subsumed_by_primitive_vars()to droppressure/velocitywheneverprimitiveVarsis present. - Apply this filtering during output-field translation for both generic outputs and volume outputs.
- Update/extend unit tests to reflect and validate the new deduplication behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
flow360/component/simulation/outputs/output_fields.py |
Introduces the helper that removes pressure/velocity when primitiveVars is present (prevents downstream VTK name duplication). |
flow360/component/simulation/translator/solver_translator.py |
Applies the helper in translate_output_fields() and translate_volume_output() so translated solver JSON avoids redundant fields. |
tests/simulation/outputs/test_output_fields.py |
Adds unit tests covering the helper’s behavior and edge cases. |
tests/simulation/translator/test_output_translation.py |
Updates expected translated outputFields (removes velocity in cases where primitiveVars is present). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
…… (#1948)
Note
Medium Risk
Changes the solver JSON translation for
outputFieldsby conditionally removingpressure/velocitywhenprimitiveVarsis requested, which can alter users’ exported field sets and affect postprocessing expectations.Overview
Prevents duplicate VTK DataArray names when users request
primitiveVarsalongsidepressureand/orvelocityby filtering the subsumed fields out of translatedoutputFields.Adds
remove_fields_subsumed_by_primitive_vars()inoutput_fields.pyand applies it insolver_translator.pyfor both per-output and volume-output field translation, with updated/added tests to assertvelocityis no longer emitted whenprimitiveVarsis present (while keeping auto-appended fields likevelocity_magnitude).Written by Cursor Bugbot for commit 7048453. This will update automatically on new commits. Configure here.