2019-06-03 07:33:16 -05:00
|
|
|
import grpc
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
2019-06-12 01:29:41 -05:00
|
|
|
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'generated'))
|
2019-06-03 07:33:16 -05:00
|
|
|
|
|
|
|
import Grid_pb2
|
|
|
|
import Grid_pb2_grpc
|
|
|
|
|
|
|
|
class Grid:
|
2019-06-11 08:15:26 -05:00
|
|
|
"""Grid Information. Not meant to be constructed separately
|
|
|
|
|
|
|
|
Create Grid objects using mathods on Case: Grid() and Grids()
|
|
|
|
"""
|
2019-06-03 07:33:16 -05:00
|
|
|
def __init__(self, index, case):
|
|
|
|
self.case = case
|
|
|
|
self.index = index
|
|
|
|
self.stub = Grid_pb2_grpc.GridStub(self.case.channel)
|
|
|
|
|
|
|
|
def dimensions(self):
|
2019-06-11 08:15:26 -05:00
|
|
|
"""The dimensions in i, j, k direction
|
|
|
|
|
|
|
|
Returns:
|
|
|
|
Vec3i: class with integer attributes i, j, k representing the extent in all three dimensions.
|
|
|
|
"""
|
2019-06-03 07:33:16 -05:00
|
|
|
return self.stub.GetDimensions(Grid_pb2.GridRequest(case_request = self.case.request, grid_index = self.index)).dimensions
|
|
|
|
|