ansys.dpf.core.operators.serialization.serializer#
- class ansys.dpf.core.operators.serialization.serializer(stream_type=None, file_path=None, any_input1=None, any_input2=None, config=None, server=None)#
Bases:
ansys.dpf.core.dpf_operator.Operator
Take any input and serialize them in a file.
- Parameters:
- Returns:
file_path
- Return type:
str
Examples
>>> from ansys.dpf import core as dpf
>>> # Instantiate operator >>> op = dpf.operators.serialization.serializer()
>>> # Make input connections >>> my_stream_type = int() >>> op.inputs.stream_type.connect(my_stream_type) >>> my_file_path = str() >>> op.inputs.file_path.connect(my_file_path) >>> my_any_input1 = dpf.Any() >>> op.inputs.any_input1.connect(my_any_input1) >>> my_any_input2 = dpf.Any() >>> op.inputs.any_input2.connect(my_any_input2)
>>> # Instantiate operator and connect inputs in one line >>> op = dpf.operators.serialization.serializer( ... stream_type=my_stream_type, ... file_path=my_file_path, ... any_input1=my_any_input1, ... any_input2=my_any_input2, ... )
>>> # Get output data >>> result_file_path = op.outputs.file_path()
- _inputs#
- _outputs#
- static _spec() ansys.dpf.core.operators.specification.Specification #
- static default_config(server: ansys.dpf.core.server_types.AnyServerType = None) ansys.dpf.core.config.Config #
Returns the default config of the operator.
This config can then be changed to the user needs and be used to instantiate the operator. The Configuration allows to customize how the operation will be processed by the operator.
- Parameters:
server – Server with channel connected to the remote or local instance. When
None
, attempts to use the global server.- Returns:
A new Config instance equivalent to the default config for this operator.
- Return type:
config
- property inputs: InputsSerializer#
Enables to connect inputs to the operator
- Returns:
An instance of InputsSerializer.
- Return type:
inputs
- property outputs: OutputsSerializer#
Enables to get outputs of the operator by evaluating it
- Returns:
An instance of OutputsSerializer.
- Return type:
outputs