From 81e0b6c6187da49df8dcff07ca54d53b2a668273 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Wed, 17 Dec 2025 15:18:10 +0100 Subject: [PATCH 1/5] maint: update `Operator` class for `PropertyFieldsContainer` output type --- src/ansys/dpf/core/common.py | 4 ++++ src/ansys/dpf/core/dpf_operator.py | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/src/ansys/dpf/core/common.py b/src/ansys/dpf/core/common.py index 135cb49468a..57dc475e380 100644 --- a/src/ansys/dpf/core/common.py +++ b/src/ansys/dpf/core/common.py @@ -184,6 +184,7 @@ class types(Enum): meshes_container = -3 streams_container = -4 bytes = -5 + property_fields_container = -6 def types_enum_to_types(): @@ -209,6 +210,7 @@ def types_enum_to_types(): meshed_region, meshes_container, property_field, + property_fields_container, result_info, scoping, scopings_container, @@ -237,6 +239,7 @@ def types_enum_to_types(): types.meshed_region: meshed_region.MeshedRegion, types.result_info: result_info.ResultInfo, types.property_field: property_field.PropertyField, + types.property_fields_container: property_fields_container.PropertyFieldsContainer, types.data_tree: data_tree.DataTree, types.operator: dpf_operator.Operator, types.scoping: scoping.Scoping, @@ -248,6 +251,7 @@ def types_enum_to_types(): types.generic_data_container: generic_data_container.GenericDataContainer, types.mesh_info: mesh_info.MeshInfo, types.any: Any, + } diff --git a/src/ansys/dpf/core/dpf_operator.py b/src/ansys/dpf/core/dpf_operator.py index 3e99ed020a2..1f5e86bcc88 100644 --- a/src/ansys/dpf/core/dpf_operator.py +++ b/src/ansys/dpf/core/dpf_operator.py @@ -413,6 +413,7 @@ def _type_to_output_method(self): meshed_region, meshes_container, property_field, + property_fields_container, result_info, scoping, scopings_container, @@ -535,6 +536,14 @@ def _type_to_output_method(self): "generic_data_container", ) ) + if hasattr(self._api, "operator_getoutput_custom_type_fields_container"): + out.append( + ( + property_fields_container.PropertyFieldsContainer, + self._api.operator_getoutput_custom_type_fields_container, + "property_fields_container", + ) + ) return out @property From 980fcc160dd2bc21d3652b112178d3c47210179f Mon Sep 17 00:00:00 2001 From: moe-ad Date: Wed, 17 Dec 2025 15:30:47 +0100 Subject: [PATCH 2/5] fix: codestyle --- src/ansys/dpf/core/common.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ansys/dpf/core/common.py b/src/ansys/dpf/core/common.py index 57dc475e380..c785d787d62 100644 --- a/src/ansys/dpf/core/common.py +++ b/src/ansys/dpf/core/common.py @@ -251,7 +251,6 @@ def types_enum_to_types(): types.generic_data_container: generic_data_container.GenericDataContainer, types.mesh_info: mesh_info.MeshInfo, types.any: Any, - } From f02437abc0509ae0edb864c706f19902338d84dd Mon Sep 17 00:00:00 2001 From: moe-ad Date: Wed, 17 Dec 2025 17:46:43 +0100 Subject: [PATCH 3/5] fix: reorder _type_to_output_method output --- src/ansys/dpf/core/dpf_operator.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/ansys/dpf/core/dpf_operator.py b/src/ansys/dpf/core/dpf_operator.py index 1f5e86bcc88..5041f961068 100644 --- a/src/ansys/dpf/core/dpf_operator.py +++ b/src/ansys/dpf/core/dpf_operator.py @@ -513,11 +513,6 @@ def _type_to_output_method(self): server=self._server, collection=obj ).get_integral_entries(), ), - ( - collection.Collection, - self._api.operator_getoutput_as_any, - lambda obj, type: any.Any(server=self._server, any_dpf=obj).cast(type), - ), ( custom_container_base.CustomContainerBase, self._api.operator_getoutput_generic_data_container, @@ -544,6 +539,14 @@ def _type_to_output_method(self): "property_fields_container", ) ) + # Append here so subclasses of Collection type are checked before it + out.append( + ( + collection.Collection, + self._api.operator_getoutput_as_any, + lambda obj, type: any.Any(server=self._server, any_dpf=obj).cast(type), + ), + ) return out @property From 0cb3f8db8e9c91c1587ac719671bb504c952c6fa Mon Sep 17 00:00:00 2001 From: moe-ad Date: Wed, 17 Dec 2025 18:10:59 +0100 Subject: [PATCH 4/5] fix: Operator --- src/ansys/dpf/core/dpf_operator.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ansys/dpf/core/dpf_operator.py b/src/ansys/dpf/core/dpf_operator.py index 5041f961068..8854081e00f 100644 --- a/src/ansys/dpf/core/dpf_operator.py +++ b/src/ansys/dpf/core/dpf_operator.py @@ -531,14 +531,14 @@ def _type_to_output_method(self): "generic_data_container", ) ) - if hasattr(self._api, "operator_getoutput_custom_type_fields_container"): - out.append( - ( - property_fields_container.PropertyFieldsContainer, - self._api.operator_getoutput_custom_type_fields_container, - "property_fields_container", - ) - ) + # if hasattr(self._api, "operator_getoutput_custom_type_fields_container"): + # out.append( + # ( + # property_fields_container.PropertyFieldsContainer, + # self._api.operator_getoutput_custom_type_fields_container, + # "property_fields_container", + # ) + # ) # Append here so subclasses of Collection type are checked before it out.append( ( From 3066e69199fe32e82a6ee1d91a20b2f996c34aef Mon Sep 17 00:00:00 2001 From: moe-ad Date: Wed, 17 Dec 2025 18:20:51 +0100 Subject: [PATCH 5/5] fix: unnecessary entry --- src/ansys/dpf/core/dpf_operator.py | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/src/ansys/dpf/core/dpf_operator.py b/src/ansys/dpf/core/dpf_operator.py index 8854081e00f..ce6a0342e0f 100644 --- a/src/ansys/dpf/core/dpf_operator.py +++ b/src/ansys/dpf/core/dpf_operator.py @@ -513,6 +513,11 @@ def _type_to_output_method(self): server=self._server, collection=obj ).get_integral_entries(), ), + ( + collection.Collection, + self._api.operator_getoutput_as_any, + lambda obj, type: any.Any(server=self._server, any_dpf=obj).cast(type), + ), ( custom_container_base.CustomContainerBase, self._api.operator_getoutput_generic_data_container, @@ -531,22 +536,6 @@ def _type_to_output_method(self): "generic_data_container", ) ) - # if hasattr(self._api, "operator_getoutput_custom_type_fields_container"): - # out.append( - # ( - # property_fields_container.PropertyFieldsContainer, - # self._api.operator_getoutput_custom_type_fields_container, - # "property_fields_container", - # ) - # ) - # Append here so subclasses of Collection type are checked before it - out.append( - ( - collection.Collection, - self._api.operator_getoutput_as_any, - lambda obj, type: any.Any(server=self._server, any_dpf=obj).cast(type), - ), - ) return out @property