deserializer
#
- class ansys.dpf.core.operators.serialization.deserializer.deserializer(stream_type=None, file_path=None, config=None, server=None)#
Bases:
ansys.dpf.core.dpf_operator.Operator
Takes a file generated by the serializer and deserializes it into DPF’s entities.
- Parameters:
stream_type (int) – 0 for ascii (default), and 1 for binary
file_path (str) – File path
- Returns:
any_output1 (Any) – Number and types of outputs corresponding of the inputs used in the serialization
any_output2 (Any) – Number and types of outputs corresponding of the inputs used in the serialization
Examples
>>> from ansys.dpf import core as dpf
>>> # Instantiate operator >>> op = dpf.operators.serialization.deserializer()
>>> # 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)
>>> # Instantiate operator and connect inputs in one line >>> op = dpf.operators.serialization.deserializer( ... stream_type=my_stream_type, ... file_path=my_file_path, ... )
>>> # Get output data >>> result_any_output1 = op.outputs.any_output1() >>> result_any_output2 = op.outputs.any_output2()
Overview#
Returns the default config of the operator. |
Import detail#
from ansys.dpf.core.operators.serialization.deserializer import deserializer
Property detail#
- property deserializer.inputs#
Enables to connect inputs to the operator
- Returns:
inputs
- Return type:
- property deserializer.outputs#
Enables to get outputs of the operator by evaluating it
- Returns:
outputs
- Return type:
Method detail#
- static deserializer.default_config(server=None)#
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.DPFServer, optional) – Server with channel connected to the remote or local instance. When
None
, attempts to use the global server.