Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
005b37a
Add type level support for passing Path instances to download_file
Gobot1234 Sep 19, 2025
a41b780
Pre-emptively fix isort
Gobot1234 Sep 19, 2025
e06bbbd
Fix black
Gobot1234 Sep 20, 2025
79beceb
fix: solver session settings access in tests and examples
Gobot1234 Oct 2, 2025
a9d95d3
revert: some of the broken updates
Gobot1234 Oct 6, 2025
c3fc60e
chore: add acronym for DOE
Gobot1234 Oct 6, 2025
376508f
Move the boundary layer update
Gobot1234 Oct 7, 2025
0063e0c
Apply suggestion from @Gobot1234
Gobot1234 Oct 9, 2025
a6c1804
Fix some review issues
Gobot1234 Oct 9, 2025
0aa7841
Merge branch 'main' into example-updates
Gobot1234 Oct 9, 2025
9e02c58
Fix typo
Gobot1234 Oct 10, 2025
5f9fd49
fix: old syntax for camera position
Gobot1234 Oct 20, 2025
e101c51
refactor: make the code more pythonic
Gobot1234 Oct 22, 2025
313b069
Merge branch 'main' into example-updates
Gobot1234 Oct 30, 2025
2343b7a
fix ci
Gobot1234 Nov 3, 2025
c8a59db
chore: adding changelog file 4579.fixed.md [dependabot-skip]
pyansys-ci-bot Nov 3, 2025
ebc90ce
Adda couple of missed deprecations
Gobot1234 Nov 5, 2025
af2156f
Merge branch 'main' into jhilton-/example-updates
Gobot1234 Dec 2, 2025
5b0326f
fmt
Gobot1234 Dec 2, 2025
701650b
oops
Gobot1234 Dec 2, 2025
4f8fa85
fix tui change
Gobot1234 Dec 2, 2025
a3fcc89
rm the unnecessary space
Gobot1234 Dec 3, 2025
60f3292
Improve session guide
Gobot1234 Dec 3, 2025
f632441
fix ci potentially
Gobot1234 Dec 3, 2025
387ce45
Apply more of Sean's comments
Gobot1234 Dec 3, 2025
ab758a2
fix ci more
Gobot1234 Dec 3, 2025
22e7f71
penultimate round of fixes before bed
Gobot1234 Dec 4, 2025
a93ae3c
fmt again :)
Gobot1234 Dec 4, 2025
a6e3199
revert changes to tests
Gobot1234 Dec 18, 2025
8ea0f85
Merge main branch to resolve test file conflicts
Gobot1234 Dec 18, 2025
673a5f2
Revert all test file changes to match main
Gobot1234 Dec 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
revert: some of the broken updates
  • Loading branch information
Gobot1234 committed Oct 7, 2025
commit a9d95d33d1294a6915d17fe9fe40c69b95399c78
154 changes: 77 additions & 77 deletions doc/source/user_guide/usability.rst

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/00-fluent/DOE_ML.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# /// script
# dependencies = [
# "pyfluent",
# "ansys-fluent-core",
# "matplotlib",
# "numpy",
# "pandas",
Expand Down
5 changes: 2 additions & 3 deletions examples/00-fluent/ahmed_body_workflow.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# /// script
# dependencies = [
# "pyfluent",
# "ansys-fluent-core",
# "ansys-fluent-visualization",
# ]
# ///
Expand Down Expand Up @@ -66,7 +66,6 @@

import ansys.fluent.core as pyfluent
from ansys.fluent.core import examples
from ansys.fluent.core.session_solver import Solver
from ansys.fluent.visualization import Contour, GraphicsWindow

#######################################################################################
Expand Down Expand Up @@ -221,7 +220,7 @@
#######################################################################################
# Switch to the Solver Mode
# =====================================================================================
session: Solver = session.switch_to_solver()
session = session.switch_to_solver()

#######################################################################################
# Mesh Visualization
Expand Down
2 changes: 1 addition & 1 deletion examples/00-fluent/brake.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# /// script
# dependencies = [
# "pyfluent",
# "ansys-fluent-core",
# "ansys-fluent-visualization",
# "matplotlib",
# ]
Expand Down
2 changes: 1 addition & 1 deletion examples/00-fluent/conjugate_heat_transfer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# /// script
# dependencies = [
# "pyfluent",
# "ansys-fluent-core",
# "ansys-fluent-visualization",
# "matplotlib",
# "pyvista",
Expand Down
2 changes: 1 addition & 1 deletion examples/00-fluent/exhaust_system_settings_api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# /// script
# dependencies = [
# "pyfluent",
# "ansys-fluent-core",
# ]
# ///

Expand Down
2 changes: 1 addition & 1 deletion examples/00-fluent/external_compressible_flow.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# /// script
# dependencies = [
# "pyfluent",
# "ansys-fluent-core",
# ]
# ///

Expand Down
2 changes: 1 addition & 1 deletion examples/00-fluent/frozen_rotor_workflow.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# /// script
# dependencies = [
# "pyfluent",
# "ansys-fluent-core",
# ]
# ///

Expand Down
2 changes: 1 addition & 1 deletion examples/00-fluent/lunar_lander_thermal.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# /// script
# dependencies = [
# "pyfluent",
# "ansys-fluent-core",
# "matplotlib",
# "numpy",
# "pandas",
Expand Down
2 changes: 1 addition & 1 deletion examples/00-fluent/mixing_elbow_settings_api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# /// script
# dependencies = [
# "pyfluent",
# "ansys-fluent-core",
# ]
# ///

Expand Down
2 changes: 1 addition & 1 deletion examples/00-fluent/mixing_tank_workflow.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# /// script
# dependencies = [
# "pyfluent",
# "ansys-fluent-core",
# ]
# ///

Expand Down
2 changes: 1 addition & 1 deletion examples/00-fluent/modeling_ablation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# /// script
# dependencies = [
# "pyfluent",
# "ansys-fluent-core",
# "ansys-fluent-visualization",
# ]
# ///
Expand Down
2 changes: 1 addition & 1 deletion examples/00-fluent/modeling_cavitation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# /// script
# dependencies = [
# "pyfluent",
# "ansys-fluent-core",
# ]
# ///

Expand Down
2 changes: 1 addition & 1 deletion examples/00-fluent/parametric_static_mixer_1.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# /// script
# dependencies = [
# "pyfluent",
# "ansys-fluent-core",
# ]
# ///

Expand Down
2 changes: 1 addition & 1 deletion examples/00-fluent/radiation_headlamp.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# /// script
# dependencies = [
# "pyfluent",
# "ansys-fluent-core",
# ]
# ///

Expand Down
2 changes: 1 addition & 1 deletion examples/00-fluent/single_battery_cell_workflow.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# /// script
# dependencies = [
# "pyfluent",
# "ansys-fluent-core",
# ]
# ///

Expand Down
2 changes: 1 addition & 1 deletion examples/00-fluent/species_transport.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# /// script
# dependencies = [
# "pyfluent",
# "ansys-fluent-core",
# ]
# ///

Expand Down
2 changes: 1 addition & 1 deletion examples/00-fluent/steady_vortex.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# /// script
# dependencies = [
# "imageio",
# "pyfluent",
# "ansys-fluent-core",
# ]
# ///

Expand Down
4 changes: 2 additions & 2 deletions examples/00-fluent/tyler_sofrin_modes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# dependencies = [
# "matplotlib",
# "numpy",
# "pyfluent",
# "ansys-fluent-core",
# ]
# ///

Expand Down Expand Up @@ -212,7 +212,7 @@
An[n_ind][angle_ind] = mag
Bn[n_ind][angle_ind] = 0
else:
session.settings.solution.report_definitions.surface["mag-report"] = {
session.solution.report_definitions.surface["mag-report"] = {
"report_type": "surface-vertexavg",
"surface_names": ["point-" + str(angle)],
"field": str(variable) + "-mag",
Expand Down
12 changes: 6 additions & 6 deletions src/ansys/fluent/core/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,13 +630,13 @@ def search(
>>> pyfluent.search("font", match_whole_word=True)
>>> pyfluent.search("Font")
>>> pyfluent.search("local*", api_path="<solver_session>.setup")
<solver_session>.setupdynamic_mesh.methods.smoothing.radial_settings.local_smoothing (Parameter)
<solver_session>.setupmesh_interfaces.interface["<name>"].local_absolute_mapped_tolerance (Parameter)
<solver_session>.setupmesh_interfaces.interface["<name>"].local_relative_mapped_tolerance (Parameter)
<solver_session>.setup.dynamic_mesh.methods.smoothing.radial_settings.local_smoothing (Parameter)
<solver_session>.setup.mesh_interfaces.interface["<name>"].local_absolute_mapped_tolerance (Parameter)
<solver_session>.setup.mesh_interfaces.interface["<name>"].local_relative_mapped_tolerance (Parameter)
>>> pyfluent.search("读", language="cmn") # search 'read' in Chinese
<solver_session>.fileread (Command)
<solver_session>.fileimport_.read (Command)
<solver_session>.meshsurface_mesh.read (Command)
<solver_session>.file.ead (Command)
<solver_session>.file.mport_.read (Command)
<solver_session>.mesh.surface_mesh.read (Command)
<solver_session>.tui.display.display_states.read (Command)
<meshing_session>.tui.display.display_states.read (Command)
"""
Expand Down
2 changes: 1 addition & 1 deletion tests/test_flobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ def test_accessor_methods_on_settings_object(static_mixer_settings_session):
].turbulence.turbulent_viscosity_ratio

if solver.get_fluent_version() >= FluentVersion.v251:
path = '<session>.setupboundary_conditions.velocity_inlet["inlet1"].turbulence.turbulent_viscosity_ratio'
path = '<session>.settings.setup.boundary_conditions.velocity_inlet["inlet1"].turbulence.turbulent_viscosity_ratio'
else:
path = '<session>.setup.boundary_conditions.velocity_inlet["inlet1"].turbulence.turbulent_viscosity_ratio'
name = "turbulent_viscosity_ratio"
Expand Down
27 changes: 14 additions & 13 deletions tests/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def test_search_wildcard(capsys):
)
lines = capsys.readouterr().out.splitlines()
assert (
"<solver_session>.solutionrun_calculation.cfl_based_adaptive_time_stepping.max_fixed_time_step (Parameter)"
"<solver_session>.solution.run_calculation.cfl_based_adaptive_time_stepping.max_fixed_time_step (Parameter)"
in lines
)

Expand All @@ -161,7 +161,7 @@ def test_search_wildcard(capsys):
api_tree_data=api_tree_data,
)
lines = capsys.readouterr().out.splitlines()
assert "<solver_session>.solutioncontrols.limits.min_des_tke (Parameter)" in lines
assert "<solver_session>.solution.controls.limits.min_des_tke (Parameter)" in lines


@pytest.mark.fluent_version("==24.2")
Expand All @@ -186,7 +186,7 @@ def test_search_whole_word(capsys):
)
lines = capsys.readouterr().out.splitlines()
assert (
"<solver_session>.setupmodels.battery.tool_kits.standalone_echem_model.k0_sei (Parameter)"
"<solver_session>.setup.models.battery.tool_kits.standalone_echem_model.k0_sei (Parameter)"
in lines
)

Expand All @@ -198,7 +198,8 @@ def test_search_semantic(capsys):
_search_semantic("读", language="cmn", api_tree_data=api_tree_data)
lines = capsys.readouterr().out.splitlines()
assert (
"<solver_session>.fileread_surface_mesh (Command) (similarity: 100.0%)" in lines
"<solver_session>.file.read_surface_mesh (Command) (similarity: 100.0%)"
in lines
)

_search_semantic("フォント", language="jpn", api_tree_data=api_tree_data)
Expand Down Expand Up @@ -264,7 +265,7 @@ def test_wildcard_search(capsys):
pyfluent.search("local*")
lines = capsys.readouterr().out.splitlines()
assert (
'<solver_session>.setupmesh_interfaces.interface["<name>"].local_absolute_mapped_tolerance (Parameter)'
'<solver_session>.setup.mesh_interfaces.interface["<name>"].local_absolute_mapped_tolerance (Parameter)'
in lines
)

Expand All @@ -274,11 +275,11 @@ def test_wildcard_search(capsys):
def test_chinese_semantic_search(capsys):
pyfluent.search("读", language="cmn")
lines = capsys.readouterr().out.splitlines()
assert "<solver_session>.fileread_case (Command) (similarity: 100.0%)" in lines
assert "<solver_session>.file.read_case (Command) (similarity: 100.0%)" in lines

pyfluent.search("写", language="cmn")
lines = capsys.readouterr().out.splitlines()
assert "<solver_session>.filewrite_case (Command) (similarity: 100.0%)" in lines
assert "<solver_session>.file.write_case (Command) (similarity: 100.0%)" in lines


@pytest.mark.fluent_version("==24.2")
Expand Down Expand Up @@ -333,7 +334,7 @@ def test_solver_api_path():
pyfluent.config.print_search_results = False
results = pyfluent.search(search_string="faces_zones", api_path="<solver_session>")
assert "<meshing_session>" not in results
assert "<solver_session>.meshmodify_zones.project_face_zones (Command)" in results
assert "<solver_session>.mesh.modify_zones.project_face_zones (Command)" in results
assert (
"<solver_session>.tui.mesh.modify_zones.project_face_zones (Command)" in results
)
Expand All @@ -360,7 +361,7 @@ def test_solver_specific_api_path():
results = pyfluent.search(search_string="font", api_path="contour")
assert "<meshing_session>" not in results
assert (
'<solver_session>.resultsgraphics.contour["<name>"].color_map.font_automatic (Parameter) (similarity: 98.31%)'
'<solver_session>.results.graphics.contour["<name>"].color_map.font_automatic (Parameter) (similarity: 98.31%)'
in results
)

Expand All @@ -387,10 +388,10 @@ def test_wildcard_with_api_path():
import ansys.fluent.core as pyfluent

pyfluent.config.print_search_results = False
results = pyfluent.search("local*", api_path="<solver_session>.setup")
results = pyfluent.search("local*", api_path="<solver_session>.setup.")
assert "<meshing_session>" not in results
assert (
'<solver_session>.setupmesh_interfaces.interface["<name>"].local_absolute_mapped_tolerance (Parameter)'
'<solver_session>.setup.mesh_interfaces.interface["<name>"].local_absolute_mapped_tolerance (Parameter)'
in results
)

Expand All @@ -404,7 +405,7 @@ def test_wildcard_with_api_object():
results = pyfluent.search("local*", api_path="mesh_interfaces")
assert "<meshing_session>" not in results
assert (
'<solver_session>.setupmesh_interfaces.interface["<name>"].local_absolute_mapped_tolerance (Parameter)'
'<solver_session>.setup.mesh_interfaces.interface["<name>"].local_absolute_mapped_tolerance (Parameter)'
in results
)

Expand Down Expand Up @@ -435,7 +436,7 @@ def test_semantic_search_read():
for result in results:
assert "thread" not in result
assert (
"<solver_session>.fileconvert_hanging_nodes_during_read (Parameter) (similarity: 100.0%)"
"<solver_session>.file.convert_hanging_nodes_during_read (Parameter) (similarity: 100.0%)"
in results
)

Expand Down
4 changes: 2 additions & 2 deletions tests/test_settings_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def test_api_upgrade(new_solver_session, capsys):
case_path = download_file("Static_Mixer_main.cas.h5", "pyfluent/static_mixer")
solver.tui.file.read_case(case_path)
timeout_loop(
lambda: "<solver_session>.fileread_case" in capsys.readouterr().out,
lambda: "<solver_session>.file.read_case" in capsys.readouterr().out,
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

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

The assertion checks for the deprecated access pattern <solver_session>.file.read_case instead of the updated pattern <solver_session>.settings.file.read_case. This contradicts the PR's goal of updating to the new API.

Suggested change
lambda: "<solver_session>.file.read_case" in capsys.readouterr().out,
lambda: "<solver_session>.settings.file.read_case" in capsys.readouterr().out,

Copilot uses AI. Check for mistakes.
timeout=5,
)

Expand Down Expand Up @@ -642,7 +642,7 @@ def test_deprecated_command_arguments(mixing_elbow_case_data_session):
with pytest.warns(
PyFluentUserWarning,
match=(
"Unknown keyword 'all_boundary_zones' for command '<session>.resultsreport.fluxes.mass_flow'. "
"Unknown keyword 'all_boundary_zones' for command '<session>.results.report.fluxes.mass_flow'. "
"It will be ignored."
),
):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_tui_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ def test_api_upgrade_message(new_solver_session):
solver.tui.file.read_case(case_name)
s = f.getvalue()
if solver.get_fluent_version() >= FluentVersion.v251:
assert s.split("\n")[-2].split("(")[0] == r"<solver_session>.fileread_case"
assert s.split("\n")[-2].split("(")[0] == r"<solver_session>.file.read_case"
else:
assert s.split("\n")[-2].split("(")[0] == r"<solver_session>.fileread_case"
assert s.split("\n")[-2].split("(")[0] == r"<solver_session>.file.read_case"


def test_exit_not_in_meshing_tui(new_meshing_session):
Expand Down