Skip to content

Conversation

@mkundu1
Copy link
Contributor

@mkundu1 mkundu1 commented Oct 22, 2025

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.py will pass.

@Copilot Copilot AI review requested due to automatic review settings October 22, 2025 12:44
Copy link
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

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 to set_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.

@github-actions github-actions bot added documentation Documentation related (improving, adding, etc) examples Publishing PyFluent examples bug Issue, problem or error in PyFluent labels Oct 22, 2025
@Copilot Copilot AI review requested due to automatic review settings October 22, 2025 12:47
Copy link
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@mkundu1 mkundu1 merged commit cb21518 into main Oct 23, 2025
72 of 89 checks passed
@mkundu1 mkundu1 deleted the fix/set-state-via-call branch October 23, 2025 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issue, problem or error in PyFluent documentation Documentation related (improving, adding, etc) examples Publishing PyFluent examples

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants