rafaqz / DimensionalData.jl

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

Alias for Ti, as time #499

Open lazarusA opened 1 year ago

lazarusA commented 1 year ago

Currently, when we ask for dimensions, and time is one of them we get :Ti as the name, is there an automatic way to get instead :time? In general we should get the actual name, and not Ti, which is not at all intuitive and useful.

rafaqz commented 1 year ago

Yeah Ti is pretty annying. Its because Dates exports Time and T means type.

We could just ditch using X/Y/Ti type wrappers and use Dim{:time} and time= keywords. I need to do a review of where the wrappers are actually useful and what to do instead.

Hugely breaking tho

rafaqz commented 1 year ago

I kinda like types for rand(X(5), Ti(10:10:100)) kind of things, its not possible with Symbol.

(Im on this tangent because aliases are not easy with how DD works)

lazarusA commented 1 year ago

I just want to get the time symbol if Ti is available 😂. I could just replace it on my workflow and move on with the next step. But it's really odd to have Ti in and doing d[time=1] working even though I don't get the name time when getting dims.

rafaqz commented 1 year ago

You can always hack key2dim and dim2key to make things whatever you want

lazarusA commented 1 year ago

We could just ditch using X/Y/Ti type wrappers and use Dim{:time} and time= keywords. I need to do a review of where the wrappers are actually useful and what to do instead.

coming back to this, maybe yes, it could be better to have Dim{:time}, even if its breaking 😆 .