Skip to content

Commit

Permalink
feat: Recursive 'update_dict'. (#3370)
Browse files Browse the repository at this point in the history
* feat: Recursive update_dict.

* Update tests.
  • Loading branch information
prmukherj authored Oct 15, 2024
1 parent a17c690 commit d26ae27
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ packages = [

[tool.poetry.dependencies]
python = ">=3.10,<4.0"
ansys-api-fluent = "^0.3.27"
ansys-api-fluent = "^0.3.28"
ansys-platform-instancemanagement = "~=1.0"
ansys-tools-filetransfer = ">=0.1,<0.3"
ansys-units = "^0.3.2"
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/fluent/core/services/datamodel_se.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ def update_dict(
) -> None:
"""Update the dict."""
request = DataModelProtoModule.UpdateDictRequest(
rules=rules, path=path, wait=True
rules=rules, path=path, wait=True, recursive=recursive
)
_convert_value_to_variant(dict_state, request.dicttomerge)
response = self._impl.update_dict(request)
Expand Down
39 changes: 39 additions & 0 deletions tests/test_new_meshing_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1760,3 +1760,42 @@ def test_return_state_changes(new_meshing_session):
wt.describe_geometry()

assert wt.add_multizone_controls


@pytest.mark.codegen_required
@pytest.mark.fluent_version(">=25.1")
def test_recursive_update_dict(new_meshing_session):
meshing = new_meshing_session
fault_tolerant = meshing.fault_tolerant()
import_file_name = examples.download_file(
"exhaust_system.fmd", "pyfluent/exhaust_system"
)

import_cad = fault_tolerant.import_cad_and_part_management
import_cad.feature_angle = 35
import_cad.fmd_file_name = import_file_name
import_cad()

descr_geom = fault_tolerant.describe_geometry_and_flow
descr_geom.arguments()
descr_geom.flow_type = "Internal flow through the object"
descr_geom.add_enclosure = "Yes"
descr_geom.close_caps = "Yes"
descr_geom.local_refinement_regions = "Yes"
descr_geom.describe_geometry_and_flow_options.moving_objects = "Yes"
descr_geom.describe_geometry_and_flow_options.advanced_options = True
descr_geom.describe_geometry_and_flow_options.porous_regions = "Yes"
descr_geom.describe_geometry_and_flow_options.enable_overset = "Yes"
descr_geom.describe_geometry_and_flow_options.extract_edge_features = "Yes"
descr_geom.describe_geometry_and_flow_options.zero_thickness = "Yes"
descr_geom.arguments()
assert meshing.workflow.TaskObject["Describe Geometry and Flow"].Arguments()[
"DescribeGeometryAndFlowOptions"
] == {
"AdvancedOptions": True,
"EnableOverset": "Yes",
"ExtractEdgeFeatures": "Yes",
"MovingObjects": "Yes",
"PorousRegions": "Yes",
"ZeroThickness": "Yes",
}

0 comments on commit d26ae27

Please sign in to comment.