-
Notifications
You must be signed in to change notification settings - Fork 56
fix: set-state via call #4567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: set-state via call #4567
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes an issue with setting parameter state via the __call__ method, ensuring that values are sent to Fluent in the correct format. Previously, when using keyword arguments with __call__, the entire dictionary was being passed to set_state, but Fluent expected only the value.
Key changes:
- Modified
__call__in the base class to extract only the first value from kwargs before passing toset_state - Added
__call__method override in a child class to handle kwargs differently - Added test coverage for the set-state-via-call functionality
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/ansys/fluent/core/solver/flobject.py | Updated __call__ methods to send only the first value from kwargs to set_state |
| tests/test_settings_api.py | Added test case to verify set-state functionality via __call__ |
| examples/00-fluent/exhaust_system_settings_api.py | Reduced iteration count from 100 to 10 (likely for faster test execution) |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Context
There was an issue in the previous PR that implemented parameter set-state via
__call__as the value was not sent to Fluent in the expected format.Change Summary
Only the first argument value is sent to Fluent while setting parameter state via
__call__.Rationale
To send the set-state value to Fluent in the correct format
Impact
New unittest has been added, the example script
exhaust_system_settings_api.pywill pass.