@@ -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.
0 commit comments