Skip to content

Update generated code for DPF 261_test_hgp_header on main #2498

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
65 changes: 37 additions & 28 deletions doc/source/_static/dpf_operators.html

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion src/ansys/dpf/core/operators/utility/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from .change_shell_layers import change_shell_layers
from .compute_time_scoping import compute_time_scoping
from .customtypefield_get_attribute import customtypefield_get_attribute
from .customtypefield_set_property import customtypefield_set_property
from .default_value import default_value
from .delegate_to_operator import delegate_to_operator
from .ds_get_attribute import ds_get_attribute
Expand All @@ -21,6 +22,7 @@
from .field import field
from .field_clone_to_shell_layer import field_clone_to_shell_layer
from .field_get_attribute import field_get_attribute
from .field_set_property import field_set_property
from .field_to_fc import field_to_fc
from .fields_container import fields_container
from .fields_container_matrices_label import fields_container_matrices_label
Expand Down Expand Up @@ -66,14 +68,14 @@
from .producer_consumer_for_each import producer_consumer_for_each
from .property_field import property_field
from .propertyfield_get_attribute import propertyfield_get_attribute
from .propertyfield_set_property import propertyfield_set_property
from .python_generator import python_generator
from .remote_operator_instantiate import remote_operator_instantiate
from .remote_workflow_instantiate import remote_workflow_instantiate
from .remove_unnecessary_labels import remove_unnecessary_labels
from .scalars_to_field import scalars_to_field
from .server_path import server_path
from .set_attribute import set_attribute
from .set_property import set_property
from .split_in_for_each_range import split_in_for_each_range
from .strain_from_voigt import strain_from_voigt
from .strain_from_voigt_fc import strain_from_voigt_fc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@


class customtypefield_get_attribute(Operator):
r"""A CustomTypeField in pin 0 and a property name (string) in pin 1 are
expected in input.
r"""Gets a property from an input field/field container. A CustomTypeFieldin
pin 0, a property name (string) in pin 1 are expected as inputs


Parameters
----------
custom_type_field: CustomTypeField
custom_type_field: CustomTypeField or CustomTypeFieldsContainer
property_name: str
Accepted inputs are: 'time_freq_support', 'scoping' and 'header'.
Property to get. Accepted inputs are specific strings namely: 'unit, 'name','time_freq_support', 'scoping' and 'header'.

Returns
-------
property: TimeFreqSupport or Scoping or DataTree
Property value.
property_value: str or TimeFreqSupport or Scoping or DataTree
Property value that is returned. Accepted Outputs are: Field, PropertyField, StringField, CustomTypeField or their containers.

Examples
--------
Expand All @@ -52,7 +52,7 @@ class customtypefield_get_attribute(Operator):
... )

>>> # Get output data
>>> result_property = op.outputs.property()
>>> result_property_value = op.outputs.property_value()
"""

def __init__(
Expand All @@ -70,31 +70,36 @@ def __init__(

@staticmethod
def _spec() -> Specification:
description = r"""A CustomTypeField in pin 0 and a property name (string) in pin 1 are
expected in input.
description = r"""Gets a property from an input field/field container. A CustomTypeFieldin
pin 0, a property name (string) in pin 1 are expected as inputs
"""
spec = Specification(
description=description,
map_input_pin_spec={
0: PinSpecification(
name="custom_type_field",
type_names=["custom_type_field"],
type_names=["custom_type_field", "custom_type_fields_container"],
optional=False,
document=r"""""",
),
1: PinSpecification(
name="property_name",
type_names=["string"],
optional=False,
document=r"""Accepted inputs are: 'time_freq_support', 'scoping' and 'header'.""",
document=r"""Property to get. Accepted inputs are specific strings namely: 'unit, 'name','time_freq_support', 'scoping' and 'header'.""",
),
},
map_output_pin_spec={
0: PinSpecification(
name="property",
type_names=["time_freq_support", "scoping", "abstract_data_tree"],
name="property_value",
type_names=[
"string",
"time_freq_support",
"scoping",
"abstract_data_tree",
],
optional=False,
document=r"""Property value.""",
document=r"""Property value that is returned. Accepted Outputs are: Field, PropertyField, StringField, CustomTypeField or their containers.""",
),
},
)
Expand Down Expand Up @@ -194,7 +199,7 @@ def custom_type_field(self) -> Input:
def property_name(self) -> Input:
r"""Allows to connect property_name input to the operator.

Accepted inputs are: 'time_freq_support', 'scoping' and 'header'.
Property to get. Accepted inputs are specific strings namely: 'unit, 'name','time_freq_support', 'scoping' and 'header'.

Returns
-------
Expand All @@ -221,32 +226,40 @@ class OutputsCustomtypefieldGetAttribute(_Outputs):
>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.utility.customtypefield_get_attribute()
>>> # Connect inputs : op.inputs. ...
>>> result_property = op.outputs.property()
>>> result_property_value = op.outputs.property_value()
"""

def __init__(self, op: Operator):
super().__init__(customtypefield_get_attribute._spec().outputs, op)
self.property_as_time_freq_support = Output(
self.property_value_as_string = Output(
_modify_output_spec_with_one_type(
customtypefield_get_attribute._spec().output_pin(0), "string"
),
0,
op,
)
self._outputs.append(self.property_value_as_string)
self.property_value_as_time_freq_support = Output(
_modify_output_spec_with_one_type(
customtypefield_get_attribute._spec().output_pin(0), "time_freq_support"
),
0,
op,
)
self._outputs.append(self.property_as_time_freq_support)
self.property_as_scoping = Output(
self._outputs.append(self.property_value_as_time_freq_support)
self.property_value_as_scoping = Output(
_modify_output_spec_with_one_type(
customtypefield_get_attribute._spec().output_pin(0), "scoping"
),
0,
op,
)
self._outputs.append(self.property_as_scoping)
self.property_as_data_tree = Output(
self._outputs.append(self.property_value_as_scoping)
self.property_value_as_data_tree = Output(
_modify_output_spec_with_one_type(
customtypefield_get_attribute._spec().output_pin(0), "data_tree"
),
0,
op,
)
self._outputs.append(self.property_as_data_tree)
self._outputs.append(self.property_value_as_data_tree)
Loading
Loading