Conversation
|
The PR: #5037 will be superseded by this PR. |
Up to standards ✅🟢 Issues
|
There was a problem hiding this comment.
Pull request overview
Refactors offline FileSession field-data retrieval to align return types/behavior with solver field data, addressing issue #5036 where SurfaceFieldDataRequest.data_types order could affect output shape/type.
Changes:
- Reworked
FileFieldDatasurface/scalar/vector fetch paths to build a common intermediate structure and delegate formatting to_ReturnFieldData. - Updated file-session tests to use the new
SurfaceDataobject-style access (.vertices,.connectivity) and added a regression test for stringdata_typesordering. - Updated offline File Session user-guide examples to reflect the new access pattern.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/ansys/fluent/core/file_session.py |
Refactors surface/scalar/vector field-data retrieval to use _ReturnFieldData and provide consistent return types. |
tests/test_file_session.py |
Updates assertions for new SurfaceData return type and adds regression coverage for string data_types order. |
doc/source/user_guide/offline/file_session.rst |
Updates examples to use .vertices access (and combined surface request example). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 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>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Please consider adding the following flake8 check to catch similar issues in future during pre-commit. |
Done, Thank you. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Context
The 'get_field_data' method of File Session is updated to be consistent with solver field data and use generic methods already available in the interface instead of new (duplicate) methods. These delicacies were the primary reason for error as reported in #5036. Moreover the method to get surface data was swallowing a data internally in such cases and returning wrong data.
Change Summary
Used common methods already available in field_data_interfaces.py to avoid any of the above issues.
Impact
The user will get expected output from "file_session.fields.field_data.get_field_data" now and also the output type will be consistent with "solver.fields.field_data.get_field_data".
A test has been added to check the return type.