diff --git a/xrspatial/tests/test_perlin.py b/xrspatial/tests/test_perlin.py index bf3fdc9e6..04d99ff04 100644 --- a/xrspatial/tests/test_perlin.py +++ b/xrspatial/tests/test_perlin.py @@ -319,17 +319,17 @@ def test_perlin_preserves_dims_and_attrs(): assert out.attrs == src.attrs -def test_perlin_drops_input_coords(): - # Pins current behavior: perlin() rebuilds the output from dims + attrs but - # not coords, so input coordinate variables are dropped. This is a known - # bug -- see the perlin "drops input coordinates from output" issue. Flip - # this to assert the coords ARE preserved once that is fixed. +def test_perlin_preserves_input_coords(): + # perlin() now carries the input coordinate variables through to the output + # (see #3470). The output keeps the same lat/lon coords as the input. src = xr.DataArray(np.zeros((10, 12), dtype=np.float32), dims=['lat', 'lon']) src['lat'] = np.arange(10) src['lon'] = np.arange(12) out = perlin(src) - assert 'lat' not in out.coords - assert 'lon' not in out.coords + assert 'lat' in out.coords + assert 'lon' in out.coords + np.testing.assert_array_equal(out['lat'].values, src['lat'].values) + np.testing.assert_array_equal(out['lon'].values, src['lon'].values) def test_perlin_docstring_documents_name():