Python gRPC server module#
Python implementation of the gRPC API Eigen example server.
- class ansys.eigen.python.grpc.server.GRPCDemoServicer[source]#
Bases:
GRPCDemoServicer
Provides methods that implement functionality of the API Eigen Example server.
- AddMatrices(request_iterator, context)[source]#
Add matrices.
- Parameters:
- request_iterator
iterator
Iterator to the stream of matrix messages provided.
- context
grpc.ServicerContext
gRPC-specific information.
- request_iterator
- Returns:
grpcdemo_pb2.Matrix
Matrix message.
- AddVectors(request_iterator, context)[source]#
Add vectors.
- Parameters:
- request_iterator
iterator
Iterator to the stream of vector messages provided.
- context
grpc.ServicerContext
gRPC-specific information.
- request_iterator
- Returns:
grpcdemo_pb2.Vector
Vector message.
- FlipVector(request_iterator, context)[source]#
Flip a given vector.
- Parameters:
- request_iterator
iterator
Iterator to the stream of vector messages provided.
- context
grpc.ServicerContext
gRPC-specific information.
- request_iterator
- Returns:
grpcdemo_pb2.Vector
Flipped vector message.
- MultiplyMatrices(request_iterator, context)[source]#
Multiply two matrices.
- Parameters:
- request_iterator
iterator
Iterator to the stream of Matrix messages provided.
- context
grpc.ServicerContext
gRPC-specific information.
- request_iterator
- Returns:
grpcdemo_pb2.Matrix
Matrix message.
- ansys.eigen.python.grpc.server.check_data_type(dtype, new_dtype)[source]#
Check if the new data type is the same as the previous data type.
- Parameters:
- dtype
numpy.type
Type of the numpy array before processing.
- new_dtype
numpy.type
Type of the numpy array to be processed.
- dtype
- Returns:
numpy.type
Type of the numpy array.
- Raises:
RuntimeError
In case there is already a type and it does not match that of the new_type argument.
- ansys.eigen.python.grpc.server.check_size(size, new_size)[source]#
Check if the new parsed size is the same as the previous size.
- Parameters:
- size
tuple
Size of the numpy array before processing.
- new_size
_type_
Size of the numpy array to process.
- size
- Returns:
tuple
Size of the numpy array.
- Raises:
RuntimeError
In case there is already a size and it does not match that of the new_size argument.