Skip to content

fix: remove output fields subsumed by primitiveVars to prevent duplic…#1953

Merged
NasserFlexCompute merged 1 commit intorelease-candidate/25.9from
hotfix/cherry-pick-c43634a
Apr 2, 2026
Merged

fix: remove output fields subsumed by primitiveVars to prevent duplic…#1953
NasserFlexCompute merged 1 commit intorelease-candidate/25.9from
hotfix/cherry-pick-c43634a

Conversation

@NasserFlexCompute
Copy link
Copy Markdown
Contributor

@NasserFlexCompute NasserFlexCompute commented Apr 2, 2026

…… (#1948)


Note

Medium Risk
Changes the solver JSON translation for outputFields by conditionally removing pressure/velocity when primitiveVars is requested, which can alter users’ exported field sets and affect postprocessing expectations.

Overview
Prevents duplicate VTK DataArray names when users request primitiveVars alongside pressure and/or velocity by filtering the subsumed fields out of translated outputFields.

Adds remove_fields_subsumed_by_primitive_vars() in output_fields.py and applies it in solver_translator.py for both per-output and volume-output field translation, with updated/added tests to assert velocity is no longer emitted when primitiveVars is present (while keeping auto-appended fields like velocity_magnitude).

Written by Cursor Bugbot for commit 7048453. This will update automatically on new commits. Configure here.

Copilot AI review requested due to automatic review settings April 2, 2026 20:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 drop pressure/velocity whenever primitiveVars is 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.

@NasserFlexCompute NasserFlexCompute enabled auto-merge (squash) April 2, 2026 21:33
@NasserFlexCompute NasserFlexCompute merged commit 62afd03 into release-candidate/25.9 Apr 2, 2026
23 checks passed
@NasserFlexCompute NasserFlexCompute deleted the hotfix/cherry-pick-c43634a branch April 2, 2026 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants