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

Component array ordering flaky behavior #32

Open
giswqs opened this issue Jul 5, 2022 · 5 comments
Open

Component array ordering flaky behavior #32

giswqs opened this issue Jul 5, 2022 · 5 comments
Labels
bug Something isn't working stale

Comments

@giswqs
Copy link

giswqs commented Jul 5, 2022

One of the Binder examples is not working as expected.

import rioxarray

da = rioxarray.open_rasterio("bahamas_rgb.tif")
da = da.rio.reproject("EPSG:3857")

# Grab the mesh object for use with PyVista
mesh = da.pyvista.mesh(x="x", y="y", component="band")

# plot in 3D
mesh.plot(rgb=True, cpos="xy")

image

@banesullivan
Copy link
Member

This is a known, flaky issue. I'll see what I can do to track it down

@banesullivan banesullivan changed the title Binder example bug Component array ordering flaky behavior Jul 5, 2022
@banesullivan banesullivan added the bug Something isn't working label Jul 5, 2022
@banesullivan
Copy link
Member

This test captures it and I currently have it marked as xfail until I figure out what is going awry:

@pytest.mark.xfail(strict=False)
def test_rioxarray_multicomponent(bahamas_rgb):
da = rioxarray.open_rasterio(bahamas_rgb)
with pytest.warns(DataCopyWarning):
mesh = da.pyvista.mesh(x="x", y="y", component="band")
assert np.array_equal(mesh.x, da.x.values)
assert np.may_share_memory(mesh.x, da.x.values)
assert np.array_equal(mesh.y, da.y.values)
assert np.may_share_memory(mesh.y, da.y.values)
# Check multicomponent array
values = da.values.swapaxes(0, 2).swapaxes(0, 1).reshape(-1, 3)
assert np.allclose(mesh["data"], values) # TODO: this check is flaky which is very concerning

@banesullivan
Copy link
Member

For now, I have removed that example from the notebook. - components should be accessed one at a time for now

@giswqs giswqs closed this as completed Jun 5, 2023
@banesullivan banesullivan reopened this Jun 5, 2023
@banesullivan
Copy link
Member

I think this is still an issue -- keeping open

@giswqs
Copy link
Author

giswqs commented Jun 5, 2023

No problem. I was cleaning up the issues that I opened long time ago on many repos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

2 participants