Skip to content

Commit 0d9c7bb

Browse files
update generated code (#1898)
Co-authored-by: rlagha <[email protected]>
1 parent aeca118 commit 0d9c7bb

File tree

7 files changed

+84
-4
lines changed

7 files changed

+84
-4
lines changed

doc/source/_static/dpf_operators.html

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

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

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ class deserializer(Operator):
1717
1818
Parameters
1919
----------
20+
stream_type : int
21+
0 for ascii (default), and 1 for binary
2022
file_path : str
2123
File path
2224
@@ -37,11 +39,14 @@ class deserializer(Operator):
3739
>>> op = dpf.operators.serialization.deserializer()
3840
3941
>>> # Make input connections
42+
>>> my_stream_type = int()
43+
>>> op.inputs.stream_type.connect(my_stream_type)
4044
>>> my_file_path = str()
4145
>>> op.inputs.file_path.connect(my_file_path)
4246
4347
>>> # Instantiate operator and connect inputs in one line
4448
>>> op = dpf.operators.serialization.deserializer(
49+
... stream_type=my_stream_type,
4550
... file_path=my_file_path,
4651
... )
4752
@@ -50,10 +55,12 @@ class deserializer(Operator):
5055
>>> result_any_output2 = op.outputs.any_output2()
5156
"""
5257

53-
def __init__(self, file_path=None, config=None, server=None):
58+
def __init__(self, stream_type=None, file_path=None, config=None, server=None):
5459
super().__init__(name="deserializer", config=config, server=server)
5560
self._inputs = InputsDeserializer(self)
5661
self._outputs = OutputsDeserializer(self)
62+
if stream_type is not None:
63+
self.inputs.stream_type.connect(stream_type)
5764
if file_path is not None:
5865
self.inputs.file_path.connect(file_path)
5966

@@ -64,6 +71,12 @@ def _spec():
6471
spec = Specification(
6572
description=description,
6673
map_input_pin_spec={
74+
-1: PinSpecification(
75+
name="stream_type",
76+
type_names=["int32"],
77+
optional=False,
78+
document="""0 for ascii (default), and 1 for binary""",
79+
),
6780
0: PinSpecification(
6881
name="file_path",
6982
type_names=["string"],
@@ -135,15 +148,39 @@ class InputsDeserializer(_Inputs):
135148
--------
136149
>>> from ansys.dpf import core as dpf
137150
>>> op = dpf.operators.serialization.deserializer()
151+
>>> my_stream_type = int()
152+
>>> op.inputs.stream_type.connect(my_stream_type)
138153
>>> my_file_path = str()
139154
>>> op.inputs.file_path.connect(my_file_path)
140155
"""
141156

142157
def __init__(self, op: Operator):
143158
super().__init__(deserializer._spec().inputs, op)
159+
self._stream_type = Input(deserializer._spec().input_pin(-1), -1, op, -1)
160+
self._inputs.append(self._stream_type)
144161
self._file_path = Input(deserializer._spec().input_pin(0), 0, op, -1)
145162
self._inputs.append(self._file_path)
146163

164+
@property
165+
def stream_type(self):
166+
"""Allows to connect stream_type input to the operator.
167+
168+
0 for ascii (default), and 1 for binary
169+
170+
Parameters
171+
----------
172+
my_stream_type : int
173+
174+
Examples
175+
--------
176+
>>> from ansys.dpf import core as dpf
177+
>>> op = dpf.operators.serialization.deserializer()
178+
>>> op.inputs.stream_type.connect(my_stream_type)
179+
>>> # or
180+
>>> op.inputs.stream_type(my_stream_type)
181+
"""
182+
return self._stream_type
183+
147184
@property
148185
def file_path(self):
149186
"""Allows to connect file_path input to the operator.

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

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ class serializer(Operator):
1616
1717
Parameters
1818
----------
19+
stream_type : int
20+
0 for ascii (default), and 1 for binary
1921
file_path : str
2022
any_input1 : Any
2123
Any input
@@ -34,6 +36,8 @@ class serializer(Operator):
3436
>>> op = dpf.operators.serialization.serializer()
3537
3638
>>> # Make input connections
39+
>>> my_stream_type = int()
40+
>>> op.inputs.stream_type.connect(my_stream_type)
3741
>>> my_file_path = str()
3842
>>> op.inputs.file_path.connect(my_file_path)
3943
>>> my_any_input1 = dpf.Any()
@@ -43,6 +47,7 @@ class serializer(Operator):
4347
4448
>>> # Instantiate operator and connect inputs in one line
4549
>>> op = dpf.operators.serialization.serializer(
50+
... stream_type=my_stream_type,
4651
... file_path=my_file_path,
4752
... any_input1=my_any_input1,
4853
... any_input2=my_any_input2,
@@ -53,11 +58,19 @@ class serializer(Operator):
5358
"""
5459

5560
def __init__(
56-
self, file_path=None, any_input1=None, any_input2=None, config=None, server=None
61+
self,
62+
stream_type=None,
63+
file_path=None,
64+
any_input1=None,
65+
any_input2=None,
66+
config=None,
67+
server=None,
5768
):
5869
super().__init__(name="serializer", config=config, server=server)
5970
self._inputs = InputsSerializer(self)
6071
self._outputs = OutputsSerializer(self)
72+
if stream_type is not None:
73+
self.inputs.stream_type.connect(stream_type)
6174
if file_path is not None:
6275
self.inputs.file_path.connect(file_path)
6376
if any_input1 is not None:
@@ -71,6 +84,12 @@ def _spec():
7184
spec = Specification(
7285
description=description,
7386
map_input_pin_spec={
87+
-1: PinSpecification(
88+
name="stream_type",
89+
type_names=["int32"],
90+
optional=False,
91+
document="""0 for ascii (default), and 1 for binary""",
92+
),
7493
0: PinSpecification(
7594
name="file_path",
7695
type_names=["string"],
@@ -146,6 +165,8 @@ class InputsSerializer(_Inputs):
146165
--------
147166
>>> from ansys.dpf import core as dpf
148167
>>> op = dpf.operators.serialization.serializer()
168+
>>> my_stream_type = int()
169+
>>> op.inputs.stream_type.connect(my_stream_type)
149170
>>> my_file_path = str()
150171
>>> op.inputs.file_path.connect(my_file_path)
151172
>>> my_any_input1 = dpf.Any()
@@ -156,13 +177,35 @@ class InputsSerializer(_Inputs):
156177

157178
def __init__(self, op: Operator):
158179
super().__init__(serializer._spec().inputs, op)
180+
self._stream_type = Input(serializer._spec().input_pin(-1), -1, op, -1)
181+
self._inputs.append(self._stream_type)
159182
self._file_path = Input(serializer._spec().input_pin(0), 0, op, -1)
160183
self._inputs.append(self._file_path)
161184
self._any_input1 = Input(serializer._spec().input_pin(1), 1, op, 0)
162185
self._inputs.append(self._any_input1)
163186
self._any_input2 = Input(serializer._spec().input_pin(2), 2, op, 1)
164187
self._inputs.append(self._any_input2)
165188

189+
@property
190+
def stream_type(self):
191+
"""Allows to connect stream_type input to the operator.
192+
193+
0 for ascii (default), and 1 for binary
194+
195+
Parameters
196+
----------
197+
my_stream_type : int
198+
199+
Examples
200+
--------
201+
>>> from ansys.dpf import core as dpf
202+
>>> op = dpf.operators.serialization.serializer()
203+
>>> op.inputs.stream_type.connect(my_stream_type)
204+
>>> # or
205+
>>> op.inputs.stream_type(my_stream_type)
206+
"""
207+
return self._stream_type
208+
166209
@property
167210
def file_path(self):
168211
"""Allows to connect file_path input to the operator.
1 KB
Binary file not shown.
0 Bytes
Binary file not shown.
776 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)