Skip to content

Commit 213a765

Browse files
Update generated code for DPF 261_daily on main (#2684)
Co-authored-by: PProfizi <[email protected]>
1 parent f43d366 commit 213a765

File tree

8 files changed

+318
-24
lines changed

8 files changed

+318
-24
lines changed

doc/source/_static/dpf_operators.html

Lines changed: 12 additions & 8 deletions
Large diffs are not rendered by default.

src/ansys/dpf/core/operators/metadata/time_freq_support_get_attribute.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ class time_freq_support_get_attribute(Operator):
2525
----------
2626
time_freq_support: TimeFreqSupport
2727
property_name: str
28-
Supported property names are: "time_freqs", "imaginary_freqs", "frequency_tolerance", "set_id", "cummulative_index", "sets_freqs".
29-
property_identifier: int, optional
30-
Additional pin for properties "set_id" and "cummulative_index": the step id, for "sets_freqs": the sets scoping.
28+
Supported property names are: "time_freqs", "imaginary_freqs", "frequency_tolerance", "set_id", "cummulative_index", "sets_freqs", "step_id_from_harmonic_index".
29+
property_identifier: int or Scoping, optional
30+
Additional pin for properties "set_id" and "cummulative_index": the step id, for "sets_freqs": the sets scoping, for "step_id_from_harmonic_index" : the harmonic index.
3131
property_identifier_2: int, optional
3232
Additional pin for properties "set_id" and "cummulative_index": the substep id (if none, last substep is considered).
3333
3434
Returns
3535
-------
3636
property: float or Field or Scoping
37-
Returns a double for property: "frequency_tolerance", a single-value Scoping for properties for "set_id" and "cummulative_index", and a Field otherwise.
37+
Returns a double for property: "frequency_tolerance", a single-value Scoping for properties for "set_id" and "cummulative_index", an int for "step_id_from_harmonic_index" and a Field otherwise.
3838
3939
Examples
4040
--------
@@ -106,13 +106,13 @@ def _spec() -> Specification:
106106
name="property_name",
107107
type_names=["string"],
108108
optional=False,
109-
document=r"""Supported property names are: "time_freqs", "imaginary_freqs", "frequency_tolerance", "set_id", "cummulative_index", "sets_freqs".""",
109+
document=r"""Supported property names are: "time_freqs", "imaginary_freqs", "frequency_tolerance", "set_id", "cummulative_index", "sets_freqs", "step_id_from_harmonic_index".""",
110110
),
111111
2: PinSpecification(
112112
name="property_identifier",
113-
type_names=["int32"],
113+
type_names=["int32", "scoping"],
114114
optional=True,
115-
document=r"""Additional pin for properties "set_id" and "cummulative_index": the step id, for "sets_freqs": the sets scoping.""",
115+
document=r"""Additional pin for properties "set_id" and "cummulative_index": the step id, for "sets_freqs": the sets scoping, for "step_id_from_harmonic_index" : the harmonic index.""",
116116
),
117117
3: PinSpecification(
118118
name="property_identifier_2",
@@ -126,7 +126,7 @@ def _spec() -> Specification:
126126
name="property",
127127
type_names=["double", "field", "scoping"],
128128
optional=False,
129-
document=r"""Returns a double for property: "frequency_tolerance", a single-value Scoping for properties for "set_id" and "cummulative_index", and a Field otherwise.""",
129+
document=r"""Returns a double for property: "frequency_tolerance", a single-value Scoping for properties for "set_id" and "cummulative_index", an int for "step_id_from_harmonic_index" and a Field otherwise.""",
130130
),
131131
},
132132
)
@@ -238,7 +238,7 @@ def time_freq_support(self) -> Input:
238238
def property_name(self) -> Input:
239239
r"""Allows to connect property_name input to the operator.
240240
241-
Supported property names are: "time_freqs", "imaginary_freqs", "frequency_tolerance", "set_id", "cummulative_index", "sets_freqs".
241+
Supported property names are: "time_freqs", "imaginary_freqs", "frequency_tolerance", "set_id", "cummulative_index", "sets_freqs", "step_id_from_harmonic_index".
242242
243243
Returns
244244
-------
@@ -259,7 +259,7 @@ def property_name(self) -> Input:
259259
def property_identifier(self) -> Input:
260260
r"""Allows to connect property_identifier input to the operator.
261261
262-
Additional pin for properties "set_id" and "cummulative_index": the step id, for "sets_freqs": the sets scoping.
262+
Additional pin for properties "set_id" and "cummulative_index": the step id, for "sets_freqs": the sets scoping, for "step_id_from_harmonic_index" : the harmonic index.
263263
264264
Returns
265265
-------

src/ansys/dpf/core/operators/utility/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from .change_shell_layers import change_shell_layers
99
from .compute_time_scoping import compute_time_scoping
1010
from .customtypefield_get_attribute import customtypefield_get_attribute
11+
from .cyclic_support_get_attribute import cyclic_support_get_attribute
1112
from .default_value import default_value
1213
from .delegate_to_operator import delegate_to_operator
1314
from .ds_get_attribute import ds_get_attribute
Lines changed: 244 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,244 @@
1+
"""
2+
cyclic_support_get_attribute
3+
4+
Autogenerated DPF operator classes.
5+
"""
6+
7+
from __future__ import annotations
8+
9+
from warnings import warn
10+
from ansys.dpf.core.dpf_operator import Operator
11+
from ansys.dpf.core.inputs import Input, _Inputs
12+
from ansys.dpf.core.outputs import Output, _Outputs
13+
from ansys.dpf.core.outputs import _modify_output_spec_with_one_type
14+
from ansys.dpf.core.operators.specification import PinSpecification, Specification
15+
from ansys.dpf.core.config import Config
16+
from ansys.dpf.core.server_types import AnyServerType
17+
18+
19+
class cyclic_support_get_attribute(Operator):
20+
r"""A CyclicSupport in pin 0 and a property name (string) in pin 1 are
21+
expected in input.
22+
23+
24+
Parameters
25+
----------
26+
cyclic_support: CyclicSupport
27+
property_name: str
28+
Accepted inputs are: 'element_duplicate_offset' and 'node_duplicate_offset' (returns int).
29+
30+
Returns
31+
-------
32+
property: str or int
33+
Property value.
34+
35+
Examples
36+
--------
37+
>>> from ansys.dpf import core as dpf
38+
39+
>>> # Instantiate operator
40+
>>> op = dpf.operators.utility.cyclic_support_get_attribute()
41+
42+
>>> # Make input connections
43+
>>> my_cyclic_support = dpf.CyclicSupport()
44+
>>> op.inputs.cyclic_support.connect(my_cyclic_support)
45+
>>> my_property_name = str()
46+
>>> op.inputs.property_name.connect(my_property_name)
47+
48+
>>> # Instantiate operator and connect inputs in one line
49+
>>> op = dpf.operators.utility.cyclic_support_get_attribute(
50+
... cyclic_support=my_cyclic_support,
51+
... property_name=my_property_name,
52+
... )
53+
54+
>>> # Get output data
55+
>>> result_property = op.outputs.property()
56+
"""
57+
58+
def __init__(
59+
self, cyclic_support=None, property_name=None, config=None, server=None
60+
):
61+
super().__init__(
62+
name="cyclic_support::get_attribute", config=config, server=server
63+
)
64+
self._inputs = InputsCyclicSupportGetAttribute(self)
65+
self._outputs = OutputsCyclicSupportGetAttribute(self)
66+
if cyclic_support is not None:
67+
self.inputs.cyclic_support.connect(cyclic_support)
68+
if property_name is not None:
69+
self.inputs.property_name.connect(property_name)
70+
71+
@staticmethod
72+
def _spec() -> Specification:
73+
description = r"""A CyclicSupport in pin 0 and a property name (string) in pin 1 are
74+
expected in input.
75+
"""
76+
spec = Specification(
77+
description=description,
78+
map_input_pin_spec={
79+
0: PinSpecification(
80+
name="cyclic_support",
81+
type_names=["cyclic_support"],
82+
optional=False,
83+
document=r"""""",
84+
),
85+
1: PinSpecification(
86+
name="property_name",
87+
type_names=["string"],
88+
optional=False,
89+
document=r"""Accepted inputs are: 'element_duplicate_offset' and 'node_duplicate_offset' (returns int).""",
90+
),
91+
},
92+
map_output_pin_spec={
93+
0: PinSpecification(
94+
name="property",
95+
type_names=["string", "int32"],
96+
optional=False,
97+
document=r"""Property value.""",
98+
),
99+
},
100+
)
101+
return spec
102+
103+
@staticmethod
104+
def default_config(server: AnyServerType = None) -> Config:
105+
"""Returns the default config of the operator.
106+
107+
This config can then be changed to the user needs and be used to
108+
instantiate the operator. The Configuration allows to customize
109+
how the operation will be processed by the operator.
110+
111+
Parameters
112+
----------
113+
server:
114+
Server with channel connected to the remote or local instance. When
115+
``None``, attempts to use the global server.
116+
117+
Returns
118+
-------
119+
config:
120+
A new Config instance equivalent to the default config for this operator.
121+
"""
122+
return Operator.default_config(
123+
name="cyclic_support::get_attribute", server=server
124+
)
125+
126+
@property
127+
def inputs(self) -> InputsCyclicSupportGetAttribute:
128+
"""Enables to connect inputs to the operator
129+
130+
Returns
131+
--------
132+
inputs:
133+
An instance of InputsCyclicSupportGetAttribute.
134+
"""
135+
return super().inputs
136+
137+
@property
138+
def outputs(self) -> OutputsCyclicSupportGetAttribute:
139+
"""Enables to get outputs of the operator by evaluating it
140+
141+
Returns
142+
--------
143+
outputs:
144+
An instance of OutputsCyclicSupportGetAttribute.
145+
"""
146+
return super().outputs
147+
148+
149+
class InputsCyclicSupportGetAttribute(_Inputs):
150+
"""Intermediate class used to connect user inputs to
151+
cyclic_support_get_attribute operator.
152+
153+
Examples
154+
--------
155+
>>> from ansys.dpf import core as dpf
156+
>>> op = dpf.operators.utility.cyclic_support_get_attribute()
157+
>>> my_cyclic_support = dpf.CyclicSupport()
158+
>>> op.inputs.cyclic_support.connect(my_cyclic_support)
159+
>>> my_property_name = str()
160+
>>> op.inputs.property_name.connect(my_property_name)
161+
"""
162+
163+
def __init__(self, op: Operator):
164+
super().__init__(cyclic_support_get_attribute._spec().inputs, op)
165+
self._cyclic_support = Input(
166+
cyclic_support_get_attribute._spec().input_pin(0), 0, op, -1
167+
)
168+
self._inputs.append(self._cyclic_support)
169+
self._property_name = Input(
170+
cyclic_support_get_attribute._spec().input_pin(1), 1, op, -1
171+
)
172+
self._inputs.append(self._property_name)
173+
174+
@property
175+
def cyclic_support(self) -> Input:
176+
r"""Allows to connect cyclic_support input to the operator.
177+
178+
Returns
179+
-------
180+
input:
181+
An Input instance for this pin.
182+
183+
Examples
184+
--------
185+
>>> from ansys.dpf import core as dpf
186+
>>> op = dpf.operators.utility.cyclic_support_get_attribute()
187+
>>> op.inputs.cyclic_support.connect(my_cyclic_support)
188+
>>> # or
189+
>>> op.inputs.cyclic_support(my_cyclic_support)
190+
"""
191+
return self._cyclic_support
192+
193+
@property
194+
def property_name(self) -> Input:
195+
r"""Allows to connect property_name input to the operator.
196+
197+
Accepted inputs are: 'element_duplicate_offset' and 'node_duplicate_offset' (returns int).
198+
199+
Returns
200+
-------
201+
input:
202+
An Input instance for this pin.
203+
204+
Examples
205+
--------
206+
>>> from ansys.dpf import core as dpf
207+
>>> op = dpf.operators.utility.cyclic_support_get_attribute()
208+
>>> op.inputs.property_name.connect(my_property_name)
209+
>>> # or
210+
>>> op.inputs.property_name(my_property_name)
211+
"""
212+
return self._property_name
213+
214+
215+
class OutputsCyclicSupportGetAttribute(_Outputs):
216+
"""Intermediate class used to get outputs from
217+
cyclic_support_get_attribute operator.
218+
219+
Examples
220+
--------
221+
>>> from ansys.dpf import core as dpf
222+
>>> op = dpf.operators.utility.cyclic_support_get_attribute()
223+
>>> # Connect inputs : op.inputs. ...
224+
>>> result_property = op.outputs.property()
225+
"""
226+
227+
def __init__(self, op: Operator):
228+
super().__init__(cyclic_support_get_attribute._spec().outputs, op)
229+
self.property_as_string = Output(
230+
_modify_output_spec_with_one_type(
231+
cyclic_support_get_attribute._spec().output_pin(0), "string"
232+
),
233+
0,
234+
op,
235+
)
236+
self._outputs.append(self.property_as_string)
237+
self.property_as_int32 = Output(
238+
_modify_output_spec_with_one_type(
239+
cyclic_support_get_attribute._spec().output_pin(0), "int32"
240+
),
241+
0,
242+
op,
243+
)
244+
self._outputs.append(self.property_as_int32)

0 commit comments

Comments
 (0)