Skip to content

Conversation

Gobot1234
Copy link
Collaborator

@Gobot1234 Gobot1234 commented Oct 2, 2025

Context

When solver session settings access was deprecated directly on solver the code wasn't updated I've also sprinkled in a couple of small improvements to the examples

Change Summary

Updated all references direct access patterns (solver.setup.models) to the correct settings-based access pattern (solver.settings.setup.models) along with adding PEP 723 styles dependencies to the examples to make them easier to run as standalone scripts.

Rationale

Fixes all the deprecation warnings

Impact

Changes basically everywhere

@Copilot Copilot AI review requested due to automatic review settings October 9, 2025 09:52
Copy link
Contributor

@Copilot 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 access to solver session settings throughout the test suite and examples. The changes update all references from direct access patterns (e.g., solver.setup.models) to the correct settings-based access pattern (e.g., solver.settings.setup.models). This is a comprehensive update ensuring consistent API usage across the entire codebase.

  • Updates solver session settings access pattern in tests and examples
  • Adds missing .settings prefix to all solver session attribute access
  • Minor formatting improvements and code cleanup

Reviewed Changes

Copilot reviewed 69 out of 70 changed files in this pull request and generated 6 comments.

File Description
tests/*.py Updated solver session settings access to use .settings prefix
examples/*.py Updated solver session settings access pattern in all examples
src/ansys/fluent/core/*.py Updated settings access in core modules
doc/source/*.rst Updated documentation examples to use correct settings API

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Copilot Copilot AI review requested due to automatic review settings October 9, 2025 16:14
Copy link
Contributor

@Copilot 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

Copilot reviewed 68 out of 69 changed files in this pull request and generated 6 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: Copilot <[email protected]>
@Copilot Copilot AI review requested due to automatic review settings October 10, 2025 09:27
Copy link
Contributor

@Copilot 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

Copilot reviewed 68 out of 69 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@seanpearsonuk
Copy link
Collaborator

Pull Request Overview

This PR fixes access to solver session settings throughout the test suite and examples. The changes update all references from direct access patterns (e.g., solver.setup.models) to the correct settings-based access pattern (e.g., solver.settings.setup.models). This is a comprehensive update ensuring consistent API usage across the entire codebase.

  • Updates solver session settings access pattern in tests and examples
  • Adds missing .settings prefix to all solver session attribute access
  • Minor formatting improvements and code cleanup

Reviewed Changes

Copilot reviewed 69 out of 70 changed files in this pull request and generated 6 comments.

File Description
tests/.py Updated solver session settings access to use .settings prefix
examples/
.py Updated solver session settings access pattern in all examples
src/ansys/fluent/core/.py Updated settings access in core modules
doc/source/
.rst Updated documentation examples to use correct settings API
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Gobot1234 Please could you use the above overview as a basis for your PR description.

@Copilot Copilot AI review requested due to automatic review settings October 22, 2025 15:47
Copy link
Contributor

@Copilot 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

Copilot reviewed 68 out of 69 changed files in this pull request and generated 7 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

for n_ind, variable in enumerate(varname):
if len(variable) >= 4 and variable[:4] == "mean":
session.solution.report_definitions.surface["mag-report"] = {
if variable.startswith("mean"):
Copy link

Copilot AI Oct 22, 2025

Choose a reason for hiding this comment

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

[nitpick] The change from if len(variable) >= 4 and variable[:4] == 'mean' to if variable.startswith('mean') is more Pythonic and clearer, but this appears to be a refactoring improvement unrelated to the PR's stated purpose of fixing solver session settings access patterns. Consider separating code refactoring changes from the main purpose of the PR.

Copilot uses AI. Check for mistakes.

Comment on lines +246 to +248
with (Path.cwd() / "FourierCoefficients.csv").open("w") as f:
writer = csv.writer(f)
writer.writerow(["n", "theta", "An", "Bn"])
Copy link

Copilot AI Oct 22, 2025

Choose a reason for hiding this comment

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

[nitpick] The refactoring from manual string formatting to using csv.writer is an improvement, but this change is unrelated to the PR's stated purpose of fixing solver session settings access. Consider keeping such refactoring in a separate PR to maintain focus on the deprecation fix.

Copilot uses AI. Check for mistakes.

solver_session = pyfluent.launch_fluent(
dimension=3,
precision="double",
processor_count=4,
Copy link

Copilot AI Oct 22, 2025

Choose a reason for hiding this comment

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

The removal of the dimension=3 parameter appears unrelated to the PR's purpose of fixing solver session settings access patterns. If this parameter is deprecated or unnecessary, it should be documented in the PR description or handled in a separate commit.

Suggested change
processor_count=4,
processor_count=4,
dimension=3,

Copilot uses AI. Check for mistakes.

# ---------------------------------------------------------------

session = pyfluent.launch_fluent(precision="double", processor_count=2, version="3d")
session = pyfluent.launch_fluent(precision="double", processor_count=2, dimension=3)
Copy link

Copilot AI Oct 22, 2025

Choose a reason for hiding this comment

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

The change from version='3d' to dimension=3 appears to be fixing an incorrect parameter name, which is good, but this change is not mentioned in the PR description and seems unrelated to the solver session settings access fix. Consider noting this fix in the PR description.

Copilot uses AI. Check for mistakes.

# Water enters a Mixing Elbow from two Inlets; Hot (313 K) and Cold (293 K) and exits
# from Outlet. Using PyFluent in the background, this example runs Design of Experiments
# with Cold Inlet Velocity and Hot Inlet Velocity as Input Parameters and Outlet
# (DOE) with Cold Inlet Velocity and Hot Inlet Velocity as Input Parameters and Outlet
Copy link

Copilot AI Oct 22, 2025

Choose a reason for hiding this comment

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

[nitpick] The expansion of 'DOE' to 'Design of Experiments (DOE)' on first use is a good documentation improvement, but it's unrelated to the PR's stated purpose. Consider separating documentation improvements from functional changes.

Copilot uses AI. Check for mistakes.

precision="double",
processor_count=2,
version="3d",
processor_count=4,
Copy link

Copilot AI Oct 22, 2025

Choose a reason for hiding this comment

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

The change from processor_count=2 to processor_count=4 and removal of the version='3d' parameter appears unrelated to fixing solver session settings access. If these are intentional improvements, they should be documented in the PR description.

Suggested change
processor_count=4,
processor_count=2,
version="3d",

Copilot uses AI. Check for mistakes.

mode="meshing",
dimension=3,
precision="double",
processor_count=4,
Copy link

Copilot AI Oct 22, 2025

Choose a reason for hiding this comment

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

The removal of dimension=3 parameter is not mentioned in the PR description and appears unrelated to the solver session settings access fix. If this parameter is no longer needed, document why in the PR description.

Suggested change
processor_count=4,
processor_count=4,
dimension=3,

Copilot uses AI. Check for mistakes.

@Gobot1234 Gobot1234 changed the title fix: solver session settings access in tests and examples fix: example deprecation warnings and improvements Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants