chore: Enhance FileSession batching reliability and error clarity#5061
chore: Enhance FileSession batching reliability and error clarity#5061
Conversation
There was a problem hiding this comment.
Pull request overview
This PR tidies up FileSession batching behavior so that batched field-data requests correctly normalize FileSession-only scalar semantics and merge multiple requests for the same surface without overwriting prior results.
Changes:
- Added scalar option normalization for FileSession scalar reads (node/boundary options normalized to face/element semantics with a deprecation warning).
- Updated batch response aggregation to merge multiple scalar/vector fields and surface data per surface via
setdefault(instead of overwriting). - Added tests to validate scalar request option handling and per-surface merging behavior in batch responses.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
tests/test_file_session.py |
Adds regression tests covering scalar option normalization behavior and per-surface merging in batch responses. |
src/ansys/fluent/core/file_session.py |
Normalizes scalar request options for FileSession, improves batch aggregation merging, and tightens vector field name validation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Up to standards ✅🟢 Issues
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…tics Agent-Logs-Url: https://github.com/ansys/pyfluent/sessions/839e3084-c359-4dc2-b2d0-9b1295843809 Co-authored-by: prmukherj <109645853+prmukherj@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@prmukherj I notice that Copilot used "tidies up" in its PR summary, but it writes "tidies up FileSession batching behavior," whereas titling the PR chore: Tidy up File Session gives a false impression that the PR does not include any behavioural changes. This becomes a problem when we read the logs later. It would be better to emphasise in the title that this PR is all about fixes. |
Co-authored-by: Sean Pearson <93727996+seanpearsonuk@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Context
FileSessionbatching behavior had several issues: scalar field requests incorrectly reflected node/boundary semantics that don't apply to file-based sessions, batch responses overwrote prior results when multiple requests targeted the same surface, and public docstrings misled callers aboutnode_value/boundary_valuebehavior.Change Summary
node_value/boundary_valueare normalized toFalsefor FileSession scalar reads (face/element-only), emitting aPyFluentDeprecationWarningwith correctstacklevelwhen non-default values are passed.DataLocationenum used in both tag construction and response aggregation, eliminating fragile integer-to-enum key alignment._ScalarFieldTransactiondefaults:node_value/boundary_valuenow default toFalse, accurately reflecting FileSession semantics regardless of instantiation path.setdefault-based aggregation so multiple scalar/vector field requests for the same surface merge instead of overwriting.Batch.get_responsenow respectsprovide_faces/provide_verticesflags, skipping unnecessary connectivity/vertex reads for surfaces that didn't request them.add_scalar_fields_requestandget_scalar_field_datato document thatnode_value/boundary_valueare ignored in FileSession (face-only data) and emit a deprecation warning when set toTrue.Rationale
FileSession reads data from files (face/element only); exposing node/boundary options as meaningful controls is incorrect and misleading. Merging rather than overwriting batch results is necessary for correctness when multiple field requests share a surface.
Impact
FileSessionscalar field batching and direct reads.node_value=Trueorboundary_value=Truewill now see a deprecation warning.