Skip to content

bugfix/use-xarray-existing-dims - #243

Open
chenyangsu wants to merge 2 commits into
bioio-devs:mainfrom
chenyangsu:fix/xarray-existing-dims
Open

chenyangsu wants to merge 2 commits into
bioio-devs:mainfrom
chenyangsu:fix/xarray-existing-dims

Conversation

@chenyangsu

Copy link
Copy Markdown

Link to Relevant Issue

No existing issue.

Description of Changes

Passing an xr.DataArray with non-default dimensions to ArrayLikeReader or BioImage still appends _guess_dim_order(shape) (or dim_order) to _scene_dims_list, causing CoordinateValidationError on dims=["T", "Z", "Y", "X"] (tries to attach coordinate C), dims=["Z", "C", "Y", "X"] with shape (4, 3, 5, 6) (generates 4 channel names for a length-3 C axis), and dims=["C", "Y", "X"] without coords["C"].

Record this_scene.dims directly in _scene_dims_list when an xr.DataArray already has non-default dims, matching the ArrayLikeReader docstring that dim_order is ignored for labeled DataArray inputs. Happy to keep validating dim_order length when passed explicitly if you prefer.

Testing: pytest -> 119 passed, 10 xfailed (4 new regression tests failed on upstream/main); ruff check bioio and ruff format --check bioio passed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants