Skip to content

Feedback on Ndarray/Ndarray-linalg (from Reddit) #649

Open
@LukeMathWalker

Description

@LukeMathWalker

Some interesting feedback on using ndarray and ndarray-linalg to port a numerical routine from Python to Rust: Reddit thread

Actionable highlights:

  • NumPy to ndarray documentation

The ndarray for numpy users document was a tremendous help. I really appreciate it and all the work the developers have put into making it.
I'd love to see the numpy-to-ndarray docs expanded. I know that the developers of ndarray are trying to make most function calls as general as possible, but I might request that some more of these general functions get added to the ndarray for numpy users document (either how to implement them or where to go for the implementation). For instance: the max/min and argmax/argmin functions.

  • Crate organization

On the topic of max/argmax functions, I implemented my own but I just saw that ndarray-stats has them. I am a bit confused why/how the ndarray and the semi-associated subcrates are being partitioned. For instance, the other stats functions in ndarray-stats seem pretty high level and make sense. However, the "max" function seems like something that should either be implemented in the ndarray crate itself (like the "sum" function/method has been) or "max" should be part of another "ndarray-lowlevelmath" crate.

  • Array indexing

Not being able to slice/index ndarrays with other ndarrays was a bit of a pain point. It's mentioned that you can't do that with ndarray on the ndarray for numpy users document. Are there plans to implement indexing by array?

  • Best practice wrt views/references/etc.

I'm not sure how / when to use views of arrays and when to use references. This is likely my lack of experience with Rust, but I don't know what the pros and cons of each are or when I should write a function that takes an array view versus a reference to an array. I haven't seen any tutorial information on this (so if anyone could point me to a document I'd be super appreciative).

Sweet closure 😛

My project that uses Python will really be improved greatly by switching to Rust and I'm thrilled that so much work has been done on the ndarray and associated crates in the last year that is enabling my work!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions