rafaqz / DimensionalData.jl

Named dimensions and indexing for julia arrays and other data
https://rafaqz.github.io/DimensionalData.jl/stable/
MIT License
278 stars 41 forks source link

Invalid assignment to DimArray indexed by DimSelectors #758

Closed ggebbie closed 3 months ago

ggebbie commented 3 months ago

Great package! I use it a lot.

Here's what I'd like to accomplish (assignment/update to a DimSelectors index):

A = rand(X(1.0:0.2:2.0), Y(10:2:20))
 B = rand(X(1.0:0.2:1.6), Y(10:2:20))

 A[DimSelectors(B)] # all ok with output to screen
 A[DimSelectors(B)] += B # long error including "Use stardard indices, `Selector`s, or `Val` for compile-time `At`."

I didn't expect my naive formulation to work, but I haven't found a workaround yet. Closed issue #683 seems close. I am guessing that rebuild may be one way to accomplish my goal.

rafaqz commented 3 months ago

Thanks, seems there are a few bugs there, will fix.

ggebbie commented 3 months ago

I confirm that the bug fix works for me. Thanks a ton! This bug fix will help me showcase DimensionalData.jl in a computational notebook that will accompany a manuscript submission to Journal of Advances in Modeling Earth Systems .

rafaqz commented 2 months ago

Amazing, post the paper when its out :)