Closed shivasankarka closed 2 months ago
I have one suggestion on the name of the function: use numojo.sort()
instead of numojo.sorted()
. This means that when the function is a function, it first creates a copy and then make the in-place sort; when the function is a method of NDArray, it just conduct an in-place sort of the array itself. That is:
var arr_sorted = nj.sort(ar) # creates a new array and sorts it
@forFudan Yes, you are right, I forgot to make that change. I will change it in the PR.
Magic 🪄 is here! Added .lock and .toml files with magic, the new modular package manager. Some useful tasks that are available are
magic run final
- This command runs tests, performs formatting and packages NuMojo. This is useful before making the final commit to ensure everything works.magic run test
- This command runs test, packages NuMojo.magic run format
- This command does the same asmojo format ./
magic run package
- This command does the same asmojo package numojo
some functions such as sort, flatten are done inplace for internal methods so that we have the following,
Added some other basic functions such as diagflat, tri, trace etc.
Added Transpose
T()
method to transpose inplace (support only 2D arrays for now)Added a new constructor to initialize arrays from numpy arrays (works only for float64 currently).