Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_reproject_with_extra_dims sometimes fails on Python3.5 #14

Closed
jnhansen opened this issue Sep 8, 2019 · 0 comments · Fixed by #15
Closed

test_reproject_with_extra_dims sometimes fails on Python3.5 #14

jnhansen opened this issue Sep 8, 2019 · 0 comments · Fixed by #15
Assignees
Labels
bug Something isn't working
Projects
Milestone

Comments

@jnhansen
Copy link
Owner

jnhansen commented Sep 8, 2019

test_reproject_with_extra_dims sometimes fails:


___________________________________ test_reproject_with_extra_dims[dims4] ___________________________________

dims = {'band': 5, 'extra': 2, 'time': 10, 'x': 20, ...}

    @pytest.mark.parametrize('dims', [
        {'y': 20, 'x': 20, 'time': 10, 'band': 5},
        {'x': 20, 'y': 20, 'time': 10, 'band': 5},
        {'time': 10, 'band': 5, 'x': 20, 'y': 20},
        {'time': 10, 'x': 20, 'band': 5, 'y': 20},
        {'y': 20, 'x': 20, 'time': 10, 'band': 5, 'extra': 2}
    ])
    def test_reproject_with_extra_dims(dims):
        crs1 = _parse_crs('+init=epsg:4326')
        crs2 = _parse_crs('+init=epsg:3395')
        ds = generate_test_dataset(
            dims=dims, crs=crs1
        )
    
        proj = Reprojection(crs=crs2)
        reprojected = proj.apply(ds)
    
        # Check that a reprojected slice of the dataset is the same as
        # the slice of the reprojection of the entire dataset.
        slices = [
            {'band': 3},
            {'time': slice(1, 3)}
        ]
        for s in slices:
            xr_assert_equal(
                proj.apply(ds.isel(**s)),
>               reprojected.isel(**s)
            )
E           AssertionError: Left and right Dataset objects are not equal
E           
E           
E           Differing data variables:
E           L   C12__im  (time, extra, y, x) float64 -0.4385 0.295 0.5144 ... 0.0594 -0.1833
E           R   C12__im  (time, y, x, extra) float64 -0.4385 0.7736 ... -0.1302 -0.1833
E           L   C12__re  (time, extra, y, x) float64 0.5077 0.1089 0.2545 ... 0.6105 0.2276
E           R   C12__re  (time, y, x, extra) float64 0.5077 0.1572 0.1089 ... -0.51 0.2276
E           L   C22      (time, extra, y, x) float64 -0.1661 -1.155 ... -0.6713 -0.06515
E           R   C22      (time, y, x, extra) float64 -0.1661 -0.3903 ... 0.1816 -0.06515
E           L   C11      (time, extra, y, x) float64 -0.6673 0.6047 -0.325 ... 0.5696 0.1056
E           R   C11      (time, y, x, extra) float64 -0.6673 0.03727 ... 0.01081 0.1056

nd/tests/test_warp.py:535: AssertionError
@jnhansen jnhansen added the bug Something isn't working label Sep 8, 2019
@jnhansen jnhansen self-assigned this Sep 8, 2019
@jnhansen jnhansen added this to Issues in nd 0.1 via automation Sep 10, 2019
@jnhansen jnhansen added this to the 0.1 milestone Sep 10, 2019
@jnhansen jnhansen moved this from Issues to Done in nd 0.1 Sep 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
nd 0.1
  
Done
Development

Successfully merging a pull request may close this issue.

1 participant