DimensionalData.jl icon indicating copy to clipboard operation
DimensionalData.jl copied to clipboard

Add dispatch for `Fix2` so `A[X(<(1))]` works

Open rafaqz opened this issue 9 months ago • 4 comments

And of course >, >= etc etc

(Suggested by @asinghvi17 in a slack conversation with @JamesWrigley)

rafaqz avatar Mar 20 '25 19:03 rafaqz

That's too specific IMO - best to try to call anything that doesn't have an explicit dispatch in a selector

asinghvi17 avatar Mar 20 '25 19:03 asinghvi17

Because if < works why not any fix, and why not x -> x isa T?

asinghvi17 avatar Mar 20 '25 19:03 asinghvi17

The idea is we dispatch on some subset of Fix2.

Basically because <(0) is pretty easy to understand as a selector.

I thought this was your idea 😂

The other ones are just Where. But <(0) has a specific optimisation: searchsorted to the value then return a range to the end.

rafaqz avatar Mar 20 '25 22:03 rafaqz

Ah yeah that's true, I probably forgot that when writing this :D

asinghvi17 avatar Mar 24 '25 22:03 asinghvi17