Skip to content

Commit 4a98d89

Browse files
update operators (#995)
Co-authored-by: rlagha <[email protected]>
1 parent f136e31 commit 4a98d89

File tree

5 files changed

+51
-9
lines changed

5 files changed

+51
-9
lines changed

docs/source/_static/dpf_operators.html

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

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

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ class mesh_info_provider(Operator):
1818
1919
Parameters
2020
----------
21+
time_scoping : int, optional
22+
Optional time/frequency set id of the mesh.
2123
streams_container : StreamsContainer, optional
2224
Streams (mesh file container) (optional)
2325
data_sources : DataSources
@@ -33,13 +35,16 @@ class mesh_info_provider(Operator):
3335
>>> op = dpf.operators.metadata.mesh_info_provider()
3436
3537
>>> # Make input connections
38+
>>> my_time_scoping = int()
39+
>>> op.inputs.time_scoping.connect(my_time_scoping)
3640
>>> my_streams_container = dpf.StreamsContainer()
3741
>>> op.inputs.streams_container.connect(my_streams_container)
3842
>>> my_data_sources = dpf.DataSources()
3943
>>> op.inputs.data_sources.connect(my_data_sources)
4044
4145
>>> # Instantiate operator and connect inputs in one line
4246
>>> op = dpf.operators.metadata.mesh_info_provider(
47+
... time_scoping=my_time_scoping,
4348
... streams_container=my_streams_container,
4449
... data_sources=my_data_sources,
4550
... )
@@ -49,11 +54,18 @@ class mesh_info_provider(Operator):
4954
"""
5055

5156
def __init__(
52-
self, streams_container=None, data_sources=None, config=None, server=None
57+
self,
58+
time_scoping=None,
59+
streams_container=None,
60+
data_sources=None,
61+
config=None,
62+
server=None,
5363
):
5464
super().__init__(name="mesh_info_provider", config=config, server=server)
5565
self._inputs = InputsMeshInfoProvider(self)
5666
self._outputs = OutputsMeshInfoProvider(self)
67+
if time_scoping is not None:
68+
self.inputs.time_scoping.connect(time_scoping)
5769
if streams_container is not None:
5870
self.inputs.streams_container.connect(streams_container)
5971
if data_sources is not None:
@@ -68,6 +80,12 @@ def _spec():
6880
spec = Specification(
6981
description=description,
7082
map_input_pin_spec={
83+
0: PinSpecification(
84+
name="time_scoping",
85+
type_names=["int32"],
86+
optional=True,
87+
document="""Optional time/frequency set id of the mesh.""",
88+
),
7189
3: PinSpecification(
7290
name="streams_container",
7391
type_names=["streams_container"],
@@ -138,6 +156,8 @@ class InputsMeshInfoProvider(_Inputs):
138156
--------
139157
>>> from ansys.dpf import core as dpf
140158
>>> op = dpf.operators.metadata.mesh_info_provider()
159+
>>> my_time_scoping = int()
160+
>>> op.inputs.time_scoping.connect(my_time_scoping)
141161
>>> my_streams_container = dpf.StreamsContainer()
142162
>>> op.inputs.streams_container.connect(my_streams_container)
143163
>>> my_data_sources = dpf.DataSources()
@@ -146,13 +166,35 @@ class InputsMeshInfoProvider(_Inputs):
146166

147167
def __init__(self, op: Operator):
148168
super().__init__(mesh_info_provider._spec().inputs, op)
169+
self._time_scoping = Input(mesh_info_provider._spec().input_pin(0), 0, op, -1)
170+
self._inputs.append(self._time_scoping)
149171
self._streams_container = Input(
150172
mesh_info_provider._spec().input_pin(3), 3, op, -1
151173
)
152174
self._inputs.append(self._streams_container)
153175
self._data_sources = Input(mesh_info_provider._spec().input_pin(4), 4, op, -1)
154176
self._inputs.append(self._data_sources)
155177

178+
@property
179+
def time_scoping(self):
180+
"""Allows to connect time_scoping input to the operator.
181+
182+
Optional time/frequency set id of the mesh.
183+
184+
Parameters
185+
----------
186+
my_time_scoping : int
187+
188+
Examples
189+
--------
190+
>>> from ansys.dpf import core as dpf
191+
>>> op = dpf.operators.metadata.mesh_info_provider()
192+
>>> op.inputs.time_scoping.connect(my_time_scoping)
193+
>>> # or
194+
>>> op.inputs.time_scoping(my_time_scoping)
195+
"""
196+
return self._time_scoping
197+
156198
@property
157199
def streams_container(self):
158200
"""Allows to connect streams_container input to the operator.

src/ansys/dpf/core/operators/serialization/workflow_export_json.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def default_config():
6464

6565
@property
6666
def inputs(self):
67-
"""Enables to connect inputs to the operator
67+
"""Enables to connect inputs to the operator.
6868
6969
Returns
7070
--------
@@ -75,7 +75,7 @@ def inputs(self):
7575

7676
@property
7777
def outputs(self):
78-
"""Enables to get outputs of the operator by evaluating it
78+
"""Enables to get outputs of the operator by evaluating it.
7979
8080
Returns
8181
--------

src/ansys/dpf/core/operators/serialization/workflow_import_json.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def default_config():
5858

5959
@property
6060
def inputs(self):
61-
"""Enables to connect inputs to the operator
61+
"""Enables to connect inputs to the operator.
6262
6363
Returns
6464
--------
@@ -69,7 +69,7 @@ def inputs(self):
6969

7070
@property
7171
def outputs(self):
72-
"""Enables to get outputs of the operator by evaluating it
72+
"""Enables to get outputs of the operator by evaluating it.
7373
7474
Returns
7575
--------

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def default_config():
5858

5959
@property
6060
def inputs(self):
61-
"""Enables to connect inputs to the operator
61+
"""Enables to connect inputs to the operator.
6262
6363
Returns
6464
--------
@@ -69,7 +69,7 @@ def inputs(self):
6969

7070
@property
7171
def outputs(self):
72-
"""Enables to get outputs of the operator by evaluating it
72+
"""Enables to get outputs of the operator by evaluating it.
7373
7474
Returns
7575
--------

0 commit comments

Comments
 (0)