From 79a5dd8bfe163131e8dc9f91d35f56cd1f8776d5 Mon Sep 17 00:00:00 2001 From: Prithwish Mukherjee Date: Fri, 19 Sep 2025 14:31:12 +0530 Subject: [PATCH 01/12] chore: Update 26R1 meshing tests. --- tests/test_new_meshing_workflow.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/test_new_meshing_workflow.py b/tests/test_new_meshing_workflow.py index fb5f7911297e..6b0d9efc5a7a 100644 --- a/tests/test_new_meshing_workflow.py +++ b/tests/test_new_meshing_workflow.py @@ -20,6 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. +import os import time from typing import Iterable @@ -28,6 +29,8 @@ from ansys.fluent.core import FluentVersion, examples from ansys.fluent.core.workflow import camel_to_snake_case +os.environ["PYFLUENT_FLUENT_ROOT"] = r"C:\ANSYSDev\ANSYSDev\vNNN\fluent" + @pytest.mark.nightly @pytest.mark.codegen_required @@ -1095,7 +1098,10 @@ def test_new_meshing_workflow_without_dm_caching( watertight.add_local_sizing.add_child_to_task() watertight.add_local_sizing() - watertight.create_volume_mesh() + if new_meshing_session.get_fluent_version() < FluentVersion.v261: + watertight.create_volume_mesh() + else: + watertight.create_volume_mesh_wtm() watertight.import_geometry.rename(new_name="import_geom_wtm") time.sleep(2) @@ -1594,7 +1600,10 @@ def test_scenario_with_common_python_names_from_fdl(new_meshing_session): assert len(fault_tolerant.task_names()) == len(set(fault_tolerant.task_names())) # APIName from fdl file - assert "create_volume_mesh" in fault_tolerant.task_names() + if meshing.get_fluent_version() < FluentVersion.v261: + assert "create_volume_mesh" in fault_tolerant.task_names() + else: + assert "create_volume_mesh_ftm" in fault_tolerant.task_names() assert "generate_volume_mesh" in fault_tolerant.task_names() assert "generate_surface_mesh" in fault_tolerant.task_names() From 8521a4e125144de31ba41b940fc2bde1b6ec3f71 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Fri, 19 Sep 2025 09:02:45 +0000 Subject: [PATCH 02/12] chore: adding changelog file 4480.maintenance.md [dependabot-skip] --- doc/changelog.d/4480.maintenance.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/changelog.d/4480.maintenance.md diff --git a/doc/changelog.d/4480.maintenance.md b/doc/changelog.d/4480.maintenance.md new file mode 100644 index 000000000000..ba5ec62b41d6 --- /dev/null +++ b/doc/changelog.d/4480.maintenance.md @@ -0,0 +1 @@ +Update 26R1 meshing tests. From 57aa3894f3f5ed4dc06b0eae2d35ff8e36622426 Mon Sep 17 00:00:00 2001 From: Prithwish Mukherjee Date: Fri, 19 Sep 2025 19:50:57 +0530 Subject: [PATCH 03/12] Update test. --- tests/test_new_meshing_workflow.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/test_new_meshing_workflow.py b/tests/test_new_meshing_workflow.py index 6b0d9efc5a7a..c6c3fd1b931e 100644 --- a/tests/test_new_meshing_workflow.py +++ b/tests/test_new_meshing_workflow.py @@ -20,7 +20,6 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -import os import time from typing import Iterable @@ -29,8 +28,6 @@ from ansys.fluent.core import FluentVersion, examples from ansys.fluent.core.workflow import camel_to_snake_case -os.environ["PYFLUENT_FLUENT_ROOT"] = r"C:\ANSYSDev\ANSYSDev\vNNN\fluent" - @pytest.mark.nightly @pytest.mark.codegen_required @@ -1242,6 +1239,10 @@ def test_duplicate_tasks_in_workflow(new_meshing_session): watertight.import_geometry.insertable_tasks.import_boi_geometry.insert() watertight.import_geometry.insertable_tasks.import_boi_geometry.insert() watertight.import_geometry.insertable_tasks.import_boi_geometry.insert() + if meshing.get_fluent_version() < FluentVersion.v261: + _entry = "create_volume_mesh" + else: + _entry = "create_volume_mesh_wtm" assert set(watertight.task_names()) == { "import_geometry", "create_surface_mesh", @@ -1252,7 +1253,7 @@ def test_duplicate_tasks_in_workflow(new_meshing_session): "create_regions", "update_regions", "add_boundary_layer", - "create_volume_mesh", + _entry, "add_local_sizing", "import_boi_geometry", "import_boi_geometry_1", From afbcbbf8fb69d7f12e195e23f4783bc5dcb1f5f5 Mon Sep 17 00:00:00 2001 From: Prithwish Mukherjee Date: Tue, 23 Sep 2025 10:39:46 +0530 Subject: [PATCH 04/12] Update tests. --- tests/test_datamodel_service.py | 8 +++++--- tests/test_new_meshing_workflow.py | 21 ++++++++++++--------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/tests/test_datamodel_service.py b/tests/test_datamodel_service.py index a20084668c0d..067801a74d1a 100644 --- a/tests/test_datamodel_service.py +++ b/tests/test_datamodel_service.py @@ -813,15 +813,17 @@ def test_set_command_args_and_sub_args(new_meshing_session): meshing = new_meshing_session ig = meshing.meshing.ImportGeometry.create_instance() + ig.FileFormat = "Mesh" + # Command Arguments assert ig.MeshUnit() == "m" ig.MeshUnit = "mm" assert ig.MeshUnit() == "mm" # Command Arguments SubItem - assert ig.CadImportOptions.OneZonePer() == "body" - ig.CadImportOptions.OneZonePer = "face" - assert ig.CadImportOptions.OneZonePer() == "face" + assert ig.ImportCadPreferences.ShowImportCadPreferences() is False + ig.ImportCadPreferences.ShowImportCadPreferences = True + assert ig.ImportCadPreferences.ShowImportCadPreferences() is True @pytest.mark.fluent_version(">=24.1") diff --git a/tests/test_new_meshing_workflow.py b/tests/test_new_meshing_workflow.py index c6c3fd1b931e..42cf63f431bd 100644 --- a/tests/test_new_meshing_workflow.py +++ b/tests/test_new_meshing_workflow.py @@ -617,10 +617,13 @@ def test_watertight_workflow_dynamic_interface( watertight = new_meshing_session.watertight() watertight.import_geometry.file_name = mixing_elbow_geometry_filename watertight.import_geometry() - create_volume_mesh = watertight.create_volume_mesh + if new_meshing_session.get_fluent_version() < FluentVersion.v261: + create_volume_mesh = watertight.create_volume_mesh + else: + create_volume_mesh = watertight.create_volume_mesh_wtm assert create_volume_mesh is not None - watertight.delete_tasks(list_of_tasks=["create_volume_mesh"]) - assert "create_volume_mesh" not in watertight.task_names() + watertight.delete_tasks(list_of_tasks=["create_volume_mesh_wtm"]) + assert "create_volume_mesh_wtm" not in watertight.task_names() assert sorted( [repr(x) for x in watertight.add_boundary_layer.insertable_tasks()] @@ -631,15 +634,15 @@ def test_watertight_workflow_dynamic_interface( "", "", "", - "", + "", "", "", "", ] ) - watertight.add_boundary_layer.insertable_tasks.create_volume_mesh.insert() - assert "create_volume_mesh" in watertight.task_names() - create_volume_mesh = watertight.create_volume_mesh + watertight.add_boundary_layer.insertable_tasks.create_volume_mesh_wtm.insert() + assert "create_volume_mesh_wtm" in watertight.task_names() + create_volume_mesh = watertight.create_volume_mesh_wtm assert create_volume_mesh is not None assert ( @@ -653,8 +656,8 @@ def test_watertight_workflow_dynamic_interface( assert watertight.describe_geometry.enclose_fluid_regions watertight.describe_geometry.enclose_fluid_regions.delete() assert "enclose_fluid_regions" not in watertight.task_names() - watertight.create_volume_mesh.delete() - assert "create_volume_mesh" not in watertight.task_names() + watertight.create_volume_mesh_wtm.delete() + assert "create_volume_mesh_wtm" not in watertight.task_names() @pytest.mark.fluent_version("==23.2") From 1b1a70446effb091ad4aa32e3fc3d8dbd99120a6 Mon Sep 17 00:00:00 2001 From: Prithwish Mukherjee Date: Wed, 24 Sep 2025 13:04:34 +0530 Subject: [PATCH 05/12] Fix typos. --- .ci/fluent_test_runner.py | 6 +++--- doc/settings_rstgen.py | 2 +- examples/00-fluent/lunar_lander_thermal.py | 6 +++--- src/ansys/fluent/core/fluent_connection.py | 2 +- tests/test_preferences.py | 6 +++--- tests/test_reduction.py | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.ci/fluent_test_runner.py b/.ci/fluent_test_runner.py index 5e6d5ff37ef9..bf2450adb3e7 100644 --- a/.ci/fluent_test_runner.py +++ b/.ci/fluent_test_runner.py @@ -45,12 +45,12 @@ def _run_single_test( """ logging.debug(f"journal_file: {journal_file}") src_pyfluent_dir = str(Path(pyfluent.__file__).parent) - verion_for_file_name = FluentVersion.current_dev().number - dst_pyfluent_dir = f"/ansys_inc/v{verion_for_file_name}/commonfiles/CPython/3_10/linx64/Release/Ansys/PyFluentCore/ansys/fluent/core" + version_for_file_name = FluentVersion.current_dev().number + dst_pyfluent_dir = f"/ansys_inc/v{version_for_file_name}/commonfiles/CPython/3_10/linx64/Release/Ansys/PyFluentCore/ansys/fluent/core" src_gen_dir = ( Path(pyfluent.__file__).parent / "ansys" / "fluent" / "core" / "generated" ) - dst_gen_dir = f"/ansys_inc/v{verion_for_file_name}/fluent/fluent{FluentVersion.current_dev()!r}/cortex/pylib/flapi/generated" + dst_gen_dir = f"/ansys_inc/v{version_for_file_name}/fluent/fluent{FluentVersion.current_dev()!r}/cortex/pylib/flapi/generated" dst_test_dir = "/testing" working_dir = Path(dst_test_dir) parent = journal_file.parent diff --git a/doc/settings_rstgen.py b/doc/settings_rstgen.py index 0e4af8842836..0d1141307dda 100644 --- a/doc/settings_rstgen.py +++ b/doc/settings_rstgen.py @@ -9,7 +9,7 @@ -- Populate a parents dictionary with current class file name (not class name) as key and list of parents file names (not class names) as value. - Recursively Generate the rst files for classes starting with settings.root. -- Add target reference as the file name for the given class. This is used by other classes to generate hyperlinks - -- Add properties like members, undoc-memebers, show-inheritence to the autoclass directive. + -- Add properties like members, undoc-members, show-inheritance to the autoclass directive. -- Generate the tables of children, commands, arguments, and parents. --- Get access to the respective properties and members on the class with get_attr. --- Use the file name of the child class to generate the hyperlink to that class. diff --git a/examples/00-fluent/lunar_lander_thermal.py b/examples/00-fluent/lunar_lander_thermal.py index 4291c73c8d33..57e1c82e9812 100644 --- a/examples/00-fluent/lunar_lander_thermal.py +++ b/examples/00-fluent/lunar_lander_thermal.py @@ -665,13 +665,13 @@ def get_surf_mean_temp( ) # Simulate closing louvers below 273 K by changing emissivity - rad_emiss = solver_session.setup.boundary_conditions.wall[ + rad_emission = solver_session.setup.boundary_conditions.wall[ "sc-radiator" ].radiation.internal_emissivity_band["thermal-ir"] if rad_mean_temp < 273: - rad_emiss.value = 0.09 + rad_emission.value = 0.09 else: - rad_emiss.value = 0.70 + rad_emission.value = 0.70 # Run simulation for 1 timestep solver_session.solution.run_calculation.calculate() diff --git a/src/ansys/fluent/core/fluent_connection.py b/src/ansys/fluent/core/fluent_connection.py index ca0061b04065..90e84d4f21e4 100644 --- a/src/ansys/fluent/core/fluent_connection.py +++ b/src/ansys/fluent/core/fluent_connection.py @@ -104,7 +104,7 @@ class MonitorThread(threading.Thread): """A class used for monitoring a Fluent session. Daemon thread which will ensure cleanup of session objects, shutdown of - non-deamon threads etc. + non-daemon threads etc. Attributes ---------- diff --git a/tests/test_preferences.py b/tests/test_preferences.py index 8632e99f6876..3fedafd46704 100644 --- a/tests/test_preferences.py +++ b/tests/test_preferences.py @@ -52,9 +52,9 @@ def test_solver_preferences(new_solver_session): ansys_logo.Visible = True assert ansys_logo.Visible() is True - perfered_graphics = solver.preferences.Graphics - perfered_graphics.AnimationOption = "wireframe" - assert perfered_graphics.AnimationOption() == "wireframe" + preferred_graphics = solver.preferences.Graphics + preferred_graphics.AnimationOption = "wireframe" + assert preferred_graphics.AnimationOption() == "wireframe" solver.exit() diff --git a/tests/test_reduction.py b/tests/test_reduction.py index de4d4cc9f8b9..b9baaf9bcd4a 100644 --- a/tests/test_reduction.py +++ b/tests/test_reduction.py @@ -463,7 +463,7 @@ def test_reductions( def test_reduction_does_not_modify_case(static_mixer_case_session: Any): solver = static_mixer_case_session solver.solution.initialization.hybrid_initialize() - # After reading the static-mixer case in Fluent, case-modifed? flag is somehow True + # After reading the static-mixer case in Fluent, case-modified? flag is somehow True solver.scheme.eval("(%save-case-id)") assert not solver.scheme.eval("(case-modified?)") solver.reduction.area_average( From 697090eb1983749af7e580a3c599691bbe9d27a9 Mon Sep 17 00:00:00 2001 From: Prithwish Mukherjee Date: Wed, 24 Sep 2025 13:31:25 +0530 Subject: [PATCH 06/12] Fix numpy and matplotlib versions. --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 789fc03c5636..58785c7c3b32 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -526,6 +526,11 @@ jobs: username: ansys-bot password: ${{ secrets.GITHUB_TOKEN }} + - name: Show versions + run: | + python -c "import numpy; print('numpy', numpy.__version__)" + python -c "import matplotlib; print('matplotlib', matplotlib.__version__)" + - name: Pull Fluent docker image if: ${{ !contains(github.event.pull_request.title, '[skip tests]') }} run: make docker-pull From bf86376272e5da755e1b8074bc1bd7dc9ffe0e58 Mon Sep 17 00:00:00 2001 From: Prithwish Mukherjee Date: Wed, 24 Sep 2025 13:33:07 +0530 Subject: [PATCH 07/12] Fix numpy and matplotlib versions. --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 58785c7c3b32..92e7e6731ec9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -292,6 +292,11 @@ jobs: # API-Code------ key: API-Code-v${{ env.API_CODE_CACHE }}-${{ steps.version.outputs.PYFLUENT_VERSION }}-v23.1.0-v25.2.0-${{ vars.FLUENT_STABLE_IMAGE_DEV }}-${{ hashFiles('src/ansys/fluent/core/codegen/**') }} + - name: Show versions + run: | + python -c "import numpy; print('numpy', numpy.__version__)" + python -c "import matplotlib; print('matplotlib', matplotlib.__version__)" + - name: Pull 23.1 Fluent docker image if: steps.cache-api-code.outputs.cache-hit != 'true' run: make docker-pull @@ -526,11 +531,6 @@ jobs: username: ansys-bot password: ${{ secrets.GITHUB_TOKEN }} - - name: Show versions - run: | - python -c "import numpy; print('numpy', numpy.__version__)" - python -c "import matplotlib; print('matplotlib', matplotlib.__version__)" - - name: Pull Fluent docker image if: ${{ !contains(github.event.pull_request.title, '[skip tests]') }} run: make docker-pull From 84c4e1008cf2185720921b12d0196bd032d84be0 Mon Sep 17 00:00:00 2001 From: Prithwish Mukherjee Date: Wed, 24 Sep 2025 13:40:45 +0530 Subject: [PATCH 08/12] Fix numpy and matplotlib versions. --- .github/workflows/ci.yml | 5 ----- pyproject.toml | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 92e7e6731ec9..789fc03c5636 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -292,11 +292,6 @@ jobs: # API-Code------ key: API-Code-v${{ env.API_CODE_CACHE }}-${{ steps.version.outputs.PYFLUENT_VERSION }}-v23.1.0-v25.2.0-${{ vars.FLUENT_STABLE_IMAGE_DEV }}-${{ hashFiles('src/ansys/fluent/core/codegen/**') }} - - name: Show versions - run: | - python -c "import numpy; print('numpy', numpy.__version__)" - python -c "import matplotlib; print('matplotlib', matplotlib.__version__)" - - name: Pull 23.1 Fluent docker image if: steps.cache-api-code.outputs.cache-hit != 'true' run: make docker-pull diff --git a/pyproject.toml b/pyproject.toml index 432c1222bb4a..e0d5d96a78b9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ dependencies = [ "grpcio-health-checking>=1.30.0", "grpcio-status>=1.26.0", "nltk>=3.9.1", - "numpy>=1.14.0,<3.0.0", + "numpy>=1.14.0,<2.0.0", "pandas>=1.1.0,<3.0.0", "pyansys-tools-report>=0.8.1", "pyyaml>=6.0", From c37b026c0d0592d1604ade44f83fc0858306f2c5 Mon Sep 17 00:00:00 2001 From: Prithwish Mukherjee Date: Wed, 24 Sep 2025 17:50:18 +0530 Subject: [PATCH 09/12] Update test for 26.1 --- tests/test_new_meshing_workflow.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_new_meshing_workflow.py b/tests/test_new_meshing_workflow.py index 42cf63f431bd..f81753d87093 100644 --- a/tests/test_new_meshing_workflow.py +++ b/tests/test_new_meshing_workflow.py @@ -622,7 +622,10 @@ def test_watertight_workflow_dynamic_interface( else: create_volume_mesh = watertight.create_volume_mesh_wtm assert create_volume_mesh is not None - watertight.delete_tasks(list_of_tasks=["create_volume_mesh_wtm"]) + if new_meshing_session.get_fluent_version() < FluentVersion.v261: + watertight.delete_tasks(list_of_tasks=["create_volume_mesh"]) + else: + watertight.delete_tasks(list_of_tasks=["create_volume_mesh_wtm"]) assert "create_volume_mesh_wtm" not in watertight.task_names() assert sorted( From cce073d42df88713f46377da978271fd801f63ab Mon Sep 17 00:00:00 2001 From: Prithwish Mukherjee Date: Thu, 25 Sep 2025 08:30:10 +0530 Subject: [PATCH 10/12] Update test for 26.1 --- tests/test_new_meshing_workflow.py | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/tests/test_new_meshing_workflow.py b/tests/test_new_meshing_workflow.py index f81753d87093..c5a60b3aa3e7 100644 --- a/tests/test_new_meshing_workflow.py +++ b/tests/test_new_meshing_workflow.py @@ -624,9 +624,12 @@ def test_watertight_workflow_dynamic_interface( assert create_volume_mesh is not None if new_meshing_session.get_fluent_version() < FluentVersion.v261: watertight.delete_tasks(list_of_tasks=["create_volume_mesh"]) + vol_mesh_task_name = "" + assert "create_volume_mesh" not in watertight.task_names() else: watertight.delete_tasks(list_of_tasks=["create_volume_mesh_wtm"]) - assert "create_volume_mesh_wtm" not in watertight.task_names() + vol_mesh_task_name = "" + assert "create_volume_mesh_wtm" not in watertight.task_names() assert sorted( [repr(x) for x in watertight.add_boundary_layer.insertable_tasks()] @@ -637,15 +640,20 @@ def test_watertight_workflow_dynamic_interface( "", "", "", - "", + vol_mesh_task_name, "", "", "", ] ) - watertight.add_boundary_layer.insertable_tasks.create_volume_mesh_wtm.insert() - assert "create_volume_mesh_wtm" in watertight.task_names() - create_volume_mesh = watertight.create_volume_mesh_wtm + if new_meshing_session.get_fluent_version() < FluentVersion.v261: + watertight.add_boundary_layer.insertable_tasks.create_volume_mesh.insert() + assert "create_volume_mesh" in watertight.task_names() + create_volume_mesh = watertight.create_volume_mesh + else: + watertight.add_boundary_layer.insertable_tasks.create_volume_mesh_wtm.insert() + assert "create_volume_mesh_wtm" in watertight.task_names() + create_volume_mesh = watertight.create_volume_mesh_wtm assert create_volume_mesh is not None assert ( @@ -659,8 +667,12 @@ def test_watertight_workflow_dynamic_interface( assert watertight.describe_geometry.enclose_fluid_regions watertight.describe_geometry.enclose_fluid_regions.delete() assert "enclose_fluid_regions" not in watertight.task_names() - watertight.create_volume_mesh_wtm.delete() - assert "create_volume_mesh_wtm" not in watertight.task_names() + if new_meshing_session.get_fluent_version() < FluentVersion.v261: + watertight.create_volume_mesh.delete() + assert "create_volume_mesh" not in watertight.task_names() + else: + watertight.create_volume_mesh_wtm.delete() + assert "create_volume_mesh_wtm" not in watertight.task_names() @pytest.mark.fluent_version("==23.2") From fd2f5518e9755933d11916c1902abbfdc5ebd120 Mon Sep 17 00:00:00 2001 From: Prithwish Mukherjee Date: Thu, 25 Sep 2025 10:35:23 +0530 Subject: [PATCH 11/12] Update test for 26.1 --- tests/test_new_meshing_workflow.py | 35 +----------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/tests/test_new_meshing_workflow.py b/tests/test_new_meshing_workflow.py index c5a60b3aa3e7..908d7b3d8019 100644 --- a/tests/test_new_meshing_workflow.py +++ b/tests/test_new_meshing_workflow.py @@ -455,39 +455,6 @@ def test_new_2d_meshing_workflow(new_meshing_session_wo_exit): assert solver.is_active() is False -@pytest.mark.codegen_required -@pytest.mark.fluent_version(">=23.2") -def test_updating_state_in_new_meshing_workflow(new_meshing_session): - # Import geometry - import_file_name = examples.download_file( - "mixing_elbow.pmdb", "pyfluent/mixing_elbow" - ) - watertight = new_meshing_session.watertight() - assert watertight.import_geometry.length_unit() == "mm" - assert watertight.import_geometry.cad_import_options.feature_angle() == 40.0 - assert ( - watertight.import_geometry.cad_import_options.one_zone_per.allowed_values() - == ["body", "face", "object"] - ) - assert watertight.import_geometry.cad_import_options.one_zone_per() == "body" - watertight.import_geometry.arguments = { - "file_name": import_file_name, - "length_unit": "in", - "cad_import_options": {"feature_angle": 35, "one_zone_per": "object"}, - } - assert watertight.import_geometry.cad_import_options.feature_angle() == 35.0 - assert ( - watertight.import_geometry.cad_import_options.one_zone_per.get_state() - == "object" - ) - assert watertight.import_geometry.length_unit.get_state() == "in" - watertight.import_geometry.cad_import_options.feature_angle = 25.0 - assert watertight.import_geometry.cad_import_options.feature_angle() == 25.0 - watertight.import_geometry.cad_import_options.one_zone_per = "face" - assert watertight.import_geometry.cad_import_options.one_zone_per() == "face" - watertight.import_geometry() - - def _assert_snake_case_attrs(attrs: Iterable): for attr in attrs: assert str(attr).islower() @@ -705,7 +672,7 @@ def test_extended_wrapper(new_meshing_session, mixing_elbow_geometry_filename): import_geometry = watertight.import_geometry assert import_geometry.Arguments() == {} import_geometry.Arguments = dict(FileName=mixing_elbow_geometry_filename) - assert 8 < len(import_geometry.arguments.get_state()) < 15 + assert 7 <= len(import_geometry.arguments.get_state()) < 15 assert len(import_geometry.arguments.get_state(explicit_only=True)) == 1 import_geometry.arguments.set_state(dict(file_name=None)) time.sleep(5) From 0fc7400dc712f5352a66bd007f60159adbe20c44 Mon Sep 17 00:00:00 2001 From: Prithwish Mukherjee Date: Thu, 25 Sep 2025 16:15:39 +0530 Subject: [PATCH 12/12] Fix server side for tests. --- tests/test_datamodel_service.py | 6 +++--- tests/test_new_meshing_workflow.py | 34 +++++++++--------------------- 2 files changed, 13 insertions(+), 27 deletions(-) diff --git a/tests/test_datamodel_service.py b/tests/test_datamodel_service.py index 067801a74d1a..e063cec76ce6 100644 --- a/tests/test_datamodel_service.py +++ b/tests/test_datamodel_service.py @@ -387,11 +387,11 @@ def test_get_and_set_state_for_command_arg_instance(new_meshing_session): assert x.LengthUnit.get_state() == "ft" - assert x.CadImportOptions.ExtractFeatures() + assert not x.ImportCadPreferences.ShowImportCadPreferences() - x.CadImportOptions.ExtractFeatures.set_state(False) + x.ImportCadPreferences.ShowImportCadPreferences.set_state(True) - assert not x.CadImportOptions.ExtractFeatures() + assert x.ImportCadPreferences.ShowImportCadPreferences() x.set_state({"FileName": "dummy_file_name.dummy_extn"}) diff --git a/tests/test_new_meshing_workflow.py b/tests/test_new_meshing_workflow.py index 908d7b3d8019..68c255fffc4b 100644 --- a/tests/test_new_meshing_workflow.py +++ b/tests/test_new_meshing_workflow.py @@ -1509,7 +1509,9 @@ def test_accessors_for_argument_sub_items(new_meshing_session): meshing.workflow.TaskObject["Import Geometry"].Arguments = dict(LengthUnit="in") assert import_geom.arguments.length_unit() == "in" + import_geom.arguments.file_format = "Mesh" assert not import_geom.arguments.mesh_unit.is_read_only() + import_geom.arguments.file_format = "CAD" assert import_geom.arguments.length_unit.is_active() assert not import_geom.arguments.file_name.is_read_only() assert not import_geom.arguments.file_name() @@ -1521,8 +1523,10 @@ def test_accessors_for_argument_sub_items(new_meshing_session): with pytest.raises(AttributeError): import_geom.arguments.CadImportOptions.OneZonePer = "face" - assert import_geom.arguments.cad_import_options() - assert import_geom.arguments.cad_import_options.one_zone_per() + assert import_geom.arguments.import_cad_preferences() + assert ( + not import_geom.arguments.import_cad_preferences.show_import_cad_preferences() + ) assert import_geom.arguments.file_format.get_attrib_value("allowedValues") == [ "CAD", @@ -1530,14 +1534,10 @@ def test_accessors_for_argument_sub_items(new_meshing_session): ] assert import_geom.arguments.file_format.allowed_values() == ["CAD", "Mesh"] - assert not import_geom.arguments.cad_import_options.one_zone_per.is_read_only() - assert import_geom.arguments.cad_import_options.one_zone_per() == "body" - import_geom.arguments.cad_import_options.one_zone_per.set_state("face") - assert import_geom.arguments.cad_import_options.one_zone_per() == "face" - import_geom.arguments.cad_import_options.one_zone_per = "object" - assert import_geom.arguments.cad_import_options.one_zone_per() == "object" - - volume_mesh_gen = watertight.create_volume_mesh + if meshing.get_fluent_version() < FluentVersion.v261: + volume_mesh_gen = watertight.create_volume_mesh + else: + volume_mesh_gen = watertight.create_volume_mesh_wtm assert ( volume_mesh_gen.arguments.volume_fill_controls.cell_sizing.default_value() == "Geometric" @@ -1551,28 +1551,14 @@ def test_accessors_for_argument_sub_items(new_meshing_session): "Geometric", ] ) - feat_angle = import_geom.arguments.cad_import_options.feature_angle - assert feat_angle.default_value() == 40.0 - - # Test particular to numerical type (min() only available in numerical types) - assert feat_angle.min() == 0.0 - - # Test intended to fail in numerical type (allowed_values() only available in string types) - with pytest.raises(AttributeError) as msg: - assert feat_angle.allowed_values() - assert ( - msg.value.args[0] == "'_FeatureAngle' object has no attribute 'allowed_values'" - ) # Test intended to fail in numerical type (allowed_values() only available in string types) with pytest.raises(AttributeError) as msg: assert import_geom.arguments.num_parts.allowed_values() - assert msg.value.args[0] == "'_NumParts' object has no attribute 'allowed_values'" # Test intended to fail in string type (min() only available in numerical types) with pytest.raises(AttributeError) as msg: assert import_geom.arguments.length_unit.min() - assert msg.value.args[0] == "'_LengthUnit' object has no attribute 'min'" @pytest.mark.codegen_required