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

set does not update layerdims of a DimStack #897

Closed
tiemvanderdeure opened this issue Jan 8, 2025 · 3 comments · Fixed by #908
Closed

set does not update layerdims of a DimStack #897

tiemvanderdeure opened this issue Jan 8, 2025 · 3 comments · Fixed by #908
Labels
bug Something isn't working

Comments

@tiemvanderdeure
Copy link
Collaborator

MWE

using DimensionalData
ds = DimStack((; a = rand(X(1:10))))
ds2 = set(ds, :X => :Y)
ds2.a #errors
DimensionalData.layerdims(ds2) # still X

# but this does work
ds3 = set(ds, :X => Irregular())

For some reason it just doesn't change the layerdims, probably we just need to map over them?

A workaround is maplayers(l -> set(l, :X => :Y), ds) which does work.

@tiemvanderdeure tiemvanderdeure changed the title set fails on DimStack if Dimension type is changed set does not update layerdims of a DimStack Jan 8, 2025
@rafaqz
Copy link
Owner

rafaqz commented Jan 8, 2025

Ugh yes that's a bug

@tiemvanderdeure
Copy link
Collaborator Author

Ugh yes that's a bug

And even a relatively ugly one. I'm very surprised no one's run into this one yet.

@rafaqz
Copy link
Owner

rafaqz commented Jan 8, 2025

Yeah me too, I think maybe it got lost in a change somewhere and wasn't tested

@rafaqz rafaqz added the bug Something isn't working label Jan 13, 2025
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
None yet
Development

Successfully merging a pull request may close this issue.

2 participants