def test_xy_node_network(simple_network): vals = plane(simple_network, "values", "node", normal=_NORMAL) truth = _plane_function(simple_network.x_of_node, simple_network.y_of_node, point=_POINT, normal=_NORMAL) assert_array_equal(vals, truth)
def test_xy_face_raster(four_by_four_raster): vals = plane(four_by_four_raster, "values", "face", normal=_NORMAL) truth = _plane_function( four_by_four_raster.x_of_face, four_by_four_raster.y_of_face, point=_POINT, normal=_NORMAL, ) assert_array_equal(vals, truth)
def test_xy_face_raster(four_by_four_raster): vals = plane(four_by_four_raster, "values", "face", normal=_NORMAL) truth = _plane_function( four_by_four_raster.xy_of_face[:, 0], four_by_four_raster.xy_of_face[:, 1], point=_POINT, normal=_NORMAL, ) assert_array_equal(vals, truth)
def test_xy_node_raster(four_by_four_raster): vals = plane(four_by_four_raster, "values", "node", normal=_NORMAL) truth = _plane_function( four_by_four_raster.x_of_node, four_by_four_raster.y_of_node, point=_POINT, normal=_NORMAL, ) assert_array_equal(vals, truth)
def test_xy_face_network(simple_network): with pytest.raises(ValueError): plane(simple_network, "values", "face", normal=_NORMAL)
def test_xy_node_network(simple_network): vals = plane(simple_network, "values", "node", normal=_NORMAL) truth = _plane_function( simple_network.x_of_node, simple_network.y_of_node, point=_POINT, normal=_NORMAL ) assert_array_equal(vals, truth)
def test_no_xy_values(four_by_four_raster): with pytest.raises(ValueError): plane(four_by_four_raster, "values", "patch")
def test_vertical_plane(four_by_four_raster): with pytest.raises(ValueError): plane(four_by_four_raster, "values", normal=(0.0, 1.0, 0.0))
def test_xy_face_network(simple_network): with pytest.raises(ValueError): plane(simple_network, "values", "face", normal=_NORMAL)
def test_no_xy_values(four_by_four_raster): with pytest.raises(ValueError): plane(four_by_four_raster, "values", "patch")
def test_vertical_plane(four_by_four_raster): with pytest.raises(ValueError): plane(four_by_four_raster, "values", normal=(0.0, 1.0, 0.0))