The var_value_convert.py module#
Summary#
Produces a gRPC   | 
Raised if an attempt is made to convert a value with a known but  | 
Given an   | 
|
Given a ModelCenter type string, create the corresponding  | 
|
Given a value of   | 
|
Given a value of   | 
|
Produce an   | 
|
Create an equivalent   | 
Description#
Defines methods for converting between a gRPC message and an IVariableValue.
For more information, see IVariableValue in the PyAnsys Tools Variable Interop documentation.
Module detail#
- var_value_convert.interop_type_to_mc_type_string(original: ansys.tools.variableinterop.VariableType) str#
 Given an
atvi.VariableType, create the corresponding ModelCenter type string.
- var_value_convert.mc_type_string_to_interop_type(original: str) ansys.tools.variableinterop.VariableType#
 Given a ModelCenter type string, create the corresponding
atvi.VariableType.
- var_value_convert.grpc_type_enum_to_interop_type(original: ansys.api.modelcenter.v0.variable_value_messages_pb2.VariableType) ansys.tools.variableinterop.VariableType#
 Given a value of
VariableType, return the appropriate value ofatvi.VariableType.
- var_value_convert.interop_type_to_grpc_type_enum(original: ansys.tools.variableinterop.VariableType) ansys.api.modelcenter.v0.variable_value_messages_pb2.VariableType#
 Given a value of
atvi.VaribleType, return the appropriate value ofVariableType.Note
This method does not handle reference types as they map to
atvi.VariableType.UNKNOWNand are thus indistinguishable from actual unknown types.
- var_value_convert.convert_grpc_value_to_atvi(original: ansys.api.modelcenter.v0.variable_value_messages_pb2.VariableValue, engine_is_local: bool = True) ansys.tools.variableinterop.IVariableValue#
 Produce an
atvi.IVariableValueobject from a gRPC message.- Parameters:
 - original
VariableValue Original gRPC message.
- engine_is_localbool
 Whether the engine that created the file is running on the local machine. The default is
True. IfFalse, the engine is running on a remote machine
- original
 - Returns:
 Convertedvalue.
- var_value_convert.convert_interop_value_to_grpc(original: ansys.tools.variableinterop.IVariableValue, local_file_context_stack: contextlib.ExitStack | None = None, engine_is_local=False) ansys.api.modelcenter.v0.variable_value_messages_pb2.VariableValue#
 Create an equivalent
VariableValuemessage from aatvi.IVariableValueobject.