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

Open
tiemvanderdeure opened this issue Jan 8, 2025 · 3 comments
Open

set does not update layerdims of a DimStack #897

tiemvanderdeure opened this issue Jan 8, 2025 · 3 comments

Comments

@tiemvanderdeure
Copy link
Contributor

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
Contributor 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

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

2 participants