mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
* gRPC: Make names more consistent * gRPC: clean up case info and improve Python API for cases * gRPC: much more object oriented Python interface * Python: Make a proper pip-installable package * Update rips Python package to auto generate setup.py with version number * Python: add setup.py to gitignore * Python: Update Python RIPS interface * gRPC: Remove example client from cmake file and unit test * gRPC: Fix up unit test after merge and hide warnings * gRPC: fix up python client code
19 lines
459 B
Python
19 lines
459 B
Python
import grpc
|
|
import os
|
|
import sys
|
|
|
|
sys.path.insert(1, os.path.join(sys.path[0], '../generated'))
|
|
|
|
import Grid_pb2
|
|
import Grid_pb2_grpc
|
|
|
|
class Grid:
|
|
def __init__(self, index, case):
|
|
self.case = case
|
|
self.index = index
|
|
self.stub = Grid_pb2_grpc.GridStub(self.case.channel)
|
|
|
|
def dimensions(self):
|
|
return self.stub.GetDimensions(Grid_pb2.GridRequest(case_request = self.case.request, grid_index = self.index)).dimensions
|
|
|