Exemple #1
0
def test_get_grid_origin():
    client, local = make_bmi_classes(True)
    varname = local.get_output_var_names()[0]
    grid_id = local.get_var_grid(varname)
    result = client.get_grid_origin(grid_id,
                                    reserve_grid_padding(client, grid_id))
    expected = local.get_grid_origin(grid_id,
                                     reserve_grid_padding(local, grid_id))
    numpy.testing.assert_allclose(result, expected)
    del client
 def test_get_grid_origin(self, walrus_input, walrus_model):
     walrus_model.initialize(str(walrus_input))
     grid_id = walrus_model.get_var_grid('Q')
     assert len(walrus_model.get_grid_origin(grid_id, reserve_grid_padding(walrus_model, grid_id))) == 2
Exemple #3
0
 def getGridOrigin(self, request, context):
     try:
         values = reserve_grid_padding(self.bmi_model_, request.grid_id)
         return bmi_pb2.GetGridOriginResponse(origin=self.bmi_model_.get_grid_origin(request.grid_id, values))
     except Exception as e:
         self.exception_handler(e, context)
Exemple #4
0
def test_get_grid_origin():
    server, local = make_bmi_classes(True)
    grid_id, request = make_grid_request(local)
    result = server.getGridOrigin(request, reserve_grid_padding(local, grid_id)).origin
    expected = local.get_grid_origin(grid_id, reserve_grid_padding(local, grid_id))
    numpy.testing.assert_allclose(result, expected)