SciML / RecursiveArrayTools.jl

Tools for easily handling objects like arrays of arrays and deeper nestings in scientific machine learning (SciML) and other applications
https://docs.sciml.ai/RecursiveArrayTools/stable/
Other
212 stars 57 forks source link

Documentation does not reflect deprecation of linear indexing #343

Open j-fu opened 8 months ago

j-fu commented 8 months ago

The documentation does not reflect the deprecation of linear indexing (which I find a bit sad BTW):

https://github.com/SciML/RecursiveArrayTools.jl/blob/80f2c8621dc45f1ab5b3fa1ccd9a81111277c40f/src/vector_of_array.jl#L14

ChrisRackauckas commented 8 months ago

which I find a bit sad BTW

Note that we are doing this in order to bring it back in the future, but under a proper AbstractArray definition, i.e. that it is A[i * nj] = A[i,j] like a matrix. Currently this is not true because A[i] returns the i'th column, which makes it not an AbstractArray, which then breaks a lot of downstream integration. So we plan to bring this back as an AbstractArray (this is the bigger change, removing <: AbstractArray because it's required to ensure AD correctness), but since that would change the meaning of A[i] we need a deprecation period so as to help people update their code before imposing a new meaning to it.

j-fu commented 8 months ago

Ah ok. Sounds reasonable. I already had the idea to make my own getindex for my subtype, so may be this strategy should be explained a bit in the docs. My code doesn't depend on it, but a couple of examples, so I will just update them at some point.