def test_grid_from_dict_radial(xy_of_center): kwds = {} if xy_of_center is not None: kwds["xy_of_center"] = xy_of_center expected = RadialModelGrid(3, 0.5, **kwds) actual = grid_from_dict("RadialModelGrid", (3, 0.5, kwds)) assert_array_almost_equal(expected.x_of_node, actual.x_of_node) assert_array_almost_equal(expected.y_of_node, actual.y_of_node)
def test_grid_from_dict_raster(xy_of_lower_left, xy_spacing): kwds = {} if xy_of_lower_left is not None: kwds["xy_of_lower_left"] = xy_of_lower_left if xy_spacing is not None: kwds["xy_spacing"] = xy_spacing expected = RasterModelGrid((3, 4), **kwds) actual = grid_from_dict("RasterModelGrid", [(3, 4), kwds]) assert_array_almost_equal(expected.x_of_node, actual.x_of_node) assert_array_almost_equal(expected.y_of_node, actual.y_of_node)
def test_grid_from_dict_hex(orientation, node_layout, xy_of_lower_left): kwds = dict(shape=(3, 4)) if orientation is not None: kwds["orientation"] = orientation if node_layout is not None: kwds["node_layout"] = node_layout if xy_of_lower_left is not None: kwds["xy_of_lower_left"] = xy_of_lower_left expected = HexModelGrid(**kwds) actual = grid_from_dict("HexModelGrid", kwds) assert_array_almost_equal(expected.x_of_node, actual.x_of_node) assert_array_almost_equal(expected.y_of_node, actual.y_of_node)