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

Indexing into a multi-dimensional DimStack is broken if any layer is a nested DimArray #891

Closed
tiemvanderdeure opened this issue Jan 5, 2025 · 1 comment

Comments

@tiemvanderdeure
Copy link
Collaborator

I'll admit I don't make objects like this every day, but definitely a bug:

a = [rand(X(1:4)) for z in Z(1:2), y in Y(1:2)]
ds = DimStack((;a))
ds1 = ds[1]
typeof(ds1)

ds1 is a 0-dimensional DimStack for some reason, where it should be just a NamedTuple with a DimArray

@tiemvanderdeure
Copy link
Collaborator Author

Not too hard to find where this one is, it even has a TODO

newlayers = unrolled_map(f, values(s))
# Decide to rewrap as an AbstractDimStack, or return a scalar
if _any_dimarray(newlayers)
# TODO rethink this for many-layered stacks

I'll have a stab at a fix

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

No branches or pull requests

1 participant