Closed sethaxen closed 11 months ago
Ahh damn yes thats a bug. Will fix later today.
Actually seems that your a
dimension was already broken on v0.24.12 ? Its not ForwardOrdered
or Regular
so selectors wont work at all on it. The error is trying to avoid making broken buggy dimension like that.
I guess it could fall back to NoLookup
instead ? (although that wont be type stable)
Without lookups it works:
julia> x = DimArray(randn(2, 3), (:a, :b))
2×3 DimArray{Float64,2} with dimensions: Dim{:a}, Dim{:b}
0.399932 0.221793 -1.17104
1.58064 1.2108 -0.836461
julia> cat(x, x; dims=:a)
4×3 DimArray{Float64,2} with dimensions: Dim{:a}, Dim{:b}
0.399932 0.221793 -1.17104
1.58064 1.2108 -0.836461
0.399932 0.221793 -1.17104
1.58064 1.2108 -0.836461
In my use cases, we frequently load data from a netCDF file where default unit range lookups have been added for all dimensions. Now we might want to concatenate two such DimArray
s across dimensions. My users would be fine with a convenient syntax for indicating that the existing lookups should be discarded, but all of the following raise the same error:
julia> cat(x, x; dims=Dim{:a});
julia> cat(x, x; dims=Dim{:a}());
julia> cat(x, x; dims=Dim{:a}(LookupArrays.NoLookup()));
Is there a simple syntax I can recommend?
Ok great. I just tried something like that too, I thought I had allowed it but it doesnt get through.
The second two should work (but dont), as well as passing in new lookup values when you want that.
Using just a type or Symbol will give the current behavour, but a constructed dim like your example will fix it.
@sethaxen it looks like the fix is a breaking change. I think even though the current version broke things that were already bugs, it should have been a breaking change too as they still worked as basic arrays.
So maybe we can yank this version and push a new breaking release with the fix when its done?
I agree the fix should have been breaking. I ran into this again in a numerical algorithm that simply vcat
ed 2 arrays, which should always work without error but began erroring with this fix.
Ok I'll yank it
Sorry for the hassle
No problem at all!
@rafaqz is there any update on this? v0.24.14 was yanked, but the reported errors when using cat
began on v0.24.13, which is still the latest release.
Ah sorry I got the versions mixed up. Its fixed on master for a week now Ive just been on holiday and yhere were some CI problems
You could also yank 0.24.13
If you can please register the latest version when CI is green on master, I cant comment on the commit from my phone
Sure, will do
v0.24.13 seems to have broken this code that previously worked:
on v0.24.12:
on v0.24.14: