Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
If a single scene image is opened, the return is
data.data
which is just the array from the xarray.DataArrayIf a multi scene file is opened (using the scene selector widget) the return from the
open_scene
is an image layer withdata
, the actual xarray.DataArray.Napari actually handles this just fine, but some downstream plugins do not, expecting numpy arrays (e.g. napari-matplotlib). This is sort of something they should be better at handling, perhaps using
np.asarray
, but at the same time I feel like these two should work the same?I think this plugin should/could be the default beyond builtins, so probably standardizing on the array and not xarray.DataArray is best, so probably
data.data
is preferred as a default behavior.As the person partially responsible for the scene selector, I think this was an oversight on my part...
So in this PR I just make that small change and update the test accordingly.
At the same time, I can understand just returning the xarray.DataArray. But then for consistency, the single scene should just return
data
.Pull request recommendations:
Thanks for contributing!