Releases: Mojo-Numerics-and-Algorithms-group/NuMojo
Releases · Mojo-Numerics-and-Algorithms-group/NuMojo
Numojo v0.7.0 for Mojo 25.3
01/06/2025 (v0.7.0)
⭐️ New
- Implement the
take_along_axis()method. This method allows you to take elements from an array along a specified axis, using the indices provided in another array (PR #226). - Add support for column-major memory layout for the
Matrixtype and for all matrix routines (PR #232, PR #233, PR #234). - Add eigenvalue decomposition for symmetric matrices (PR #238).
🦋 Changed
- Update the syntax to accommodate to Mojo 25.3 (PR #245).
- Migrate Magic to Pixi (PR #250).
- Improve the getter methods for
ComplexNDArray(PR #229). - Re-write the
argmax()andargmin()methods to return indices along given axis (PR #230). - Replaced IO backend with NumPy (PR #250).
❌ Removed
- Remove the
numojo.CDType(Complex Data Type) (PR #231). We will use the standardCDTypefrom Mojo instead. - Temporarily remove type coercion (
TypeCoercion) until a better solution is available (PR #242). For now, please use implicit casting to convert arrays to targeted data types. - Remove redundant
self: Self(PR #246).
🛠️ Fixed
- Fixed broken links in zhs and zht readme files (Issue #239, PR #240).
- Fix error in division of an array and a scalar (PR #244).
What's Changed
- [repo] Pull commits in
mainbranch intopre-0.7by @forfudan in #224 - [routines] Implement
take_along_axismethod by @forfudan in #226 - [repo] Merge hotfix from main to pre-0.7 by @forfudan in #228
- [core][complex ndarray] Improve ComplexNDArray getter methods by @shivasankarka in #229
- [routines] Re-write
argmaxandargminto returns indices along the given axis by @forfudan in #230 - [core][complex ndarray] Remove Complex DType by @shivasankarka in #231
- [matrix] Add support for column-major (F-contiguous) memory layout for improved decomposition performance by @durnwalder in #232
- [routines] Optimized QR Decomposition with SIMD and Column-Major Layout by @durnwalder in #233
- [Matrix][routines] Add Column-Major Memory Layout Support Across All Matrix Routines by @durnwalder in #234
- [Matrix][decompositions] Add Eigenvalue Decomposition for Symmetric Matrices by @durnwalder in #238
- [docs] Fixed broken links in zhs and zht readme files by @forfudan in #240
- [core][NDArray] Temporarily suspending Type Coercions by @shivasankarka in #242
- [fix][math] Fix error in Division of Array and a Scalar by @shivasankarka in #244
- [mojo] Update the syntax to accommodate the changes in Mojo 25.3 by @forfudan in #245
- [mojo] Remove redundant
self: Selfby @soraros in #246 - [routines] Add stable sort and re-write in-place sort by @forfudan in #249
- [mojo][io] Magic to Pixi + replaced IO backend with numpy by @shivasankarka in #250
- [docs] Update the changelog for v0.7.0 by @forfudan in #243
- [conflict] Merge branch 'main' into
pre-0.7to resolve the conflict by @forfudan in #252 - [conflict] Merge main (v0.6.1) into pre-0.7 to resolve the conflict by @forfudan in #253
- [release] Merge pre-0.7 into main for the release of v0.7.0 by @forfudan in #251
New Contributors
Full Changelog: v0.6.1...v0.7.0
v0.6.1
What's Changed
Full Changelog: v0.6...v0.6.1
Numojo v0.6 for Mojo 25.1
What's Changed
- [routine][random] Update the random module + unify behaviors + add
randintby @forfudan in #199 - [routine][statistics] Update the
statisticsmodule + addreturned_dtype+ unify functions by @forfudan in #200 - [doc] Delete docs/readthedocs directory by @MadAlex1997 in #203
- [manipulation routines] Implement
broadcast_to()forNDArrayby @forfudan in #202 - [shape][safe] Add boundary checks for values of
NDArrayShape+ better docstrings by @forfudan in #205 - [strides][safe] Add boundary checks for values of
NDArrayStrides+ better docstrings by @forfudan in #206 - [statistics] Allow calculating variance and std of an array by axis by @forfudan in #207
- [ndarray][doc] Improve behaviors of 0darray + more docstring by @forfudan in #209
- [doc] Update the Roadmap document + other cleansing by @forfudan in #208
- [core][flags] Add
Flagstype for storing information on memory layout by @forfudan in #210 - [mojo] Update the code to accommodate to Mojo v25.1 by @forfudan in #211
- [ndarray] Add
NDAxisIterstruct anditer_by_axismethod that iterate array by any axis by @forfudan in #212 - [routines][generic] Add functionality to allow functions on 1-d array to work on any axis by @forfudan in #213
- [sorting][core] Refine
argsort,sort,ravel, and_NDAxisIterby @forfudan in #214 - [core][print] Significantly increase the speed of printing arrays by @forfudan in #215
- [extrema][optimize] Update
maxandminfunctions to allow any order and any axis + some optimization work by @forfudan in #216 - [diagonal][sort] Add
diagonalfunction + fixNDArray.sort()method by @forfudan in #217 - [routines] Finalize
apply_along _axis()and place it in a dedicated module for functional programming by @forfudan in #218 - [routine] Add
compress()function + allowNDArrayIterby any axis + fix__bool__()by @forfudan in #219 - [routines] Implement
clip()function by @forfudan in #220 - [doc][core][ndarray] Update Doctoring format & errors for
NDArrayby @shivasankarka in #222 - [core] Improve
NDIterto allow arbitrary axis to travel by @forfudan in #221 - [doc][changelog] Change log for the release v0.6 by @forfudan in #201
- [release] NuMojo v0.6 for MAX and mojo 25.1 by @forfudan in #223
Full Changelog: v0.5...v0.6
NuMojo v0.5 for Mojo 24.6
26/01/2025 (v0.5)
⭐️ New
- Add support for complex arrays
ComplexNDArray,ComplexSIMD,CDType(PR #165). Add creation routines for complex arrays (PR #195). - Add
TypeCoercionstruct that calculates the resultant type based on two initial data types. Apply type coercion to math functions (PR #164, PR #189). - Add
OwnDatatype as container of data buffer forNDArrayandMatrix. The property_bufis changed fromUnsafePointertoOwnData. IntroducedRefDatastruct andBufferabletrait. This step prepares for future support of array views and facilitates an easy transition once parameterized traits are integrated into Mojo (PR #175, PR #170, PR #178). - Add
NDItertype as a iterator over the array items according to a certain memory layout. UseNDArray.nditer()to construct the iterator (PR #188). - Add an additional data type mapping for
NDArray.to_numpy, i.e.,DType.indexis mapped tonumpy.intp(PR #157). - Add method
NDArray.resizethat reshapes the array in-place (PR #158). - Add a new property
flagsforNDArrayandMatrixto store memory layout of the array, e.g., c-continuous, f-continuous, own data. The memory layout is determined by both strides and shape of the array (PR #170, PR #178). - Add functions
to_tensorandfrom_tensor(also an overload ofarray) that convert betweenNDArrayand MAXTensor(Issue #183, PR #184). - Add several functions for linear algebra:
🦋 Changed
- Update several methods of
NDArraytype:- Make
loadandstoremethods safer by imposing boundary checks. Renamegetasloadand renamesetasstore(PR #166). - Update
itemmethod to allow negative index and conduct boundary checks on that (PR #167). - Update
itemfunction so that it allows both setting and getting values, e.g.,a.item(1,2)anda.item(1,2) = 10(PR #176). - Refine the
__init__overloads (PR #170).
- Make
- Allow getting items from
NDArraywith a list or array of indices, while the array can be multi-dimensional. Allow getting items fromNDArraywith a list or array of boolean values, while the array can be both one-dimensional or multi-dimensional (PR #180, PR #182). - Rename
Idxstruct asItem.You can get scalar from array usinga[item(1,2)](PR #176). - Update the constructor of the
Itemtype to allow passing int-like values in (PR #185). - Integrate
matsub-package intocoreandroutinesmodules, so that users can use a uniformed way to call functions for bothMatrixandNDArraytypes (PR #177). - Update the following functions to allow operation by any axis:
- Update
matmulto enable multiplication between two arrays of any dimensions (PR #159). - Refine the function
reshapeso that it is working on any dimensions and is working on both row-major and col-major. This also allows us to change the order with the codeA.reshape(A.shape, "F")). Also refine functionsflatten,ravel(PR #158). - Remove
sizeproperty fromNDArrayShapeand addsize_of_arraymethod to get the size of the corresponding array (PR #181). - Add
PrintOptiontype to customize string representation ofNDArray,NDArrayShape,NDArrayStrides, andItem, e.g.,str(),repr(),print(). Allow customized separators, paddings, number of items to display, width of formatting, etc, forNDArray._array_to_stringmethod. Auto-adjust width of formatted values and auto-determine wether scientific notations are needed (PR #185, PR #186, PR #190, PR #191, PR #192). - Rename the auxiliary function
_get_indexas_get_offset(PR #173). - Rename the underlying buffer of
Idxtype to_buf(PR #173). - Return a view instead of copy for iterator of
NDArray(PR #174).
❌ Removed
- Remove
orderproperty anddatatypeproperty fromNDArray. You can usea.flagsanda.dtypeinstead (PR #170). - Remove the property
coefficientofNDArraytype (PR #166). - Remove
offsetproperty from theNDArrayStridestype (PR #173).
🛠️ Fixed
- Removes
mutkeyword beforeselffromNDArray.__add__. - The methods
getandsetofNDArraydoes not check against big negative index values and this leads to overflows. This is fixed (PR #162). - Fix
__setitem__method so that it can read in variant of int and slices, e.g.,a[0, Slice(2, 4)] = a[3, Slice(0, 2)](PR #176).
📚 Documentatory and testing
- Add
readthedocspages to the repo under/docs/readthedocs(PR #194). - Add
magic run t,magic run f, andmagic run pfor the magic CLI. They first clear the terminal before runningtest,final, andpackage. - Allow partial testing via command, e.g.,
magic run test_creation, to avoid overheat. - Convert the readme file into pure markdown syntax (PR #187).
NuMojo v0.4 for Mojo 24.6
What's Changed
- [update][routines] Update
argsortfunction to allow sorting by any axis by @forfudan in #157 - [update][manipulation routines] Refine functions
reshape,resize,flatten,ravelby @forfudan in #158 - [update][linalg] Update
matmulto enable any dimensional arrays (n>0) by @forfudan in #159 - [fix][math routines] Allow
cumsumandcumprodby any axis by @forfudan in #160 - [fix][ndarray] Fix overflow due to negative
indexargument forgetandsetofNDArrayby @forfudan in #162 - [update][manipulation] Allow
flipby any axis by @forfudan in #163 - [update][core] Update several methods of
NDArraytype by @forfudan in #166 - [new][core] Type Coercions in Arithmetic dunder methods by @shivasankarka in #164
- [update][core] Update
itemmethod by @forfudan in #167 - [core][ndarray]
flagsreplacesorderproperty. Remove ...
NuMojo v0.4 for Mojo 24.6
This is a list of RELEASED changes for the NuMojo Package.
22/12/2024 (v0.4)
⭐️ New
- Implement a static-sized 2D Array type (
Matrixtype) innumojo.matsub-package.Matrixis a special case ofNDArraybut has been optimized since the number of dimensions is known at the compile time. It is useful when users only want to work with 2-dimensional arrays. The indexing and slicing is also more consistent withnumpy(PR #138, PR #141, PR #141). It provides:Matrixtype (2D array) with basic dunder methods and core methods.- Function to construct
Matrixfrom other data objects, e.g.,List,NDArray,String, andnumpyarray. - Arithmetic functions for item-wise calculation and broadcasting.
- Linear algebra: matrix mutiplication, decomposition, inverse of matrix, solve of linear system, Ordinary Least Square, etc.
- Auxilliary types, e.g.,
_MatrixIter.
- Implement more the array creation routines from numpy and expand the NuMojo array creation functionality (PR #137).
- Add
convolve2dand in thescience.signalmodule (PR #135). - Add more detailed error messages for
NDArraytype (PR #140).
🦋 Changed
- Adapt the code to the latest update of Mojo to V24.6 (PR #148).
Slice.stepis now returningOptional[int]. Thus, it is fixed by usingSlice.step.else_to(1).Formattableis now renamed toWritable(same applies towrite_toandstring.write).widthis now inferred from the SIMD's width. So this parameter must be removed when we callUnSafePointer'sloadandstoremethods. Due to this, the functionfill_pointer, which fill in a width of array with a scale, no longer work. It is replaced by copying with loop.Lifetimeis renamed asOrigin(same applies to the function__origin_of).inoutis renamed asmut.
- Rename the data buffer from
datato_buf(PR #136, PR #137) - To make
matmulflexible for different shapes of input arrays (PR #137). - Change the way to get the shape of the array:
array.shapereturns the shape of array asNDArrayShape(PR #137). - The array creation functions are unified in such a way (PR #139).
NDAarray.__init__()reads in shape information and initializes an empty ndarray.- All other creation routines are implemented by the functions in the
array_creation_routinemodule. For example, to create an array with filled value, the functionfullshould be used. To create an array from a list, the functionarrayshould be used.
- Re-organize the functions and modules by topic, so that it is more consistent with
numpy(Issue 144, PR #146). - Rename some attributes of
NDArrayand makesizean attribute instead of a method (PR #145). - Completely remove
import *in init files to fix namespace leak (PR #151). - Update function
sum(PR #149). transposenow allows arbitrary dimensions and permutations of axes (PR #152).- Change buffer type of
NDArrayShapeandNDArrayStridestoInt(PR #153). sortnow allows sorting by any axis for high dimensional arrays (PR #154).
❌ Removed
- Temporarily removed negative indexing support in slices since it causes error. Will add just feature in later updates (PR #133).
- Remove
inoutbeforeselfforNDArray.__getitem__(PR #137).
🛠️ Fixed
- Fixed and rewrote the
adjust_slicefunction that was causing errors (PR #133). - There is an error in fromstring that the negative signs are not read. It is fixed. Now a valid numeric should start with a digit, a dot, or a hyhen (PR #134).
📚 Documentary and testing
NuMojo v0.3.1 for Mojo 24.5
NuMojo v0.3 for Mojo 24.5
NuMojo released changelog
This is a list of RELEASED changes for the NuMojo Package.
14/10/2024 (v0.3)
⭐️ New
- Add support for
magicsystem and MAX 24.5 (PR #91 #109 by @shivasankarka). - Add some basic functions, e.g.,
diagflat,tri,trace,T(PR #91 by @shivasankarka). - Add a constructor which reads arrays from numpy arrays (PR #91 by @shivasankarka).
- Add functions
solveandinvfor solving linear algebraAX = YforX, finding inverse of a matrix, and conducting LU decomposition (PR #101 #104 #105 by @forfudan). - Add
itemsetmethod to fill a scalar into anNDArray(PR #102 by @forfudan). - Add
Idxstruct to represent the index of anNDArray(PR #118 by @shivasankarka). - Add NDArray initialization from numpy arrays (PR #118 by @shivasankarka).
- Created a new
iomodule with some basic functions, e.g.,format_float_scientific,loadtxt,savetxt(PR #118 by @shivasankarka).
🦋 Changed
- Make some methods, e.g.,
sort,flatten,inplace(Issue #87 by @mmenendezg, PR #91 by @shivasankarka). - Modify initialization of NDArray (PR #97 by @MadAlex1997)
- Added
Formattabletrait and fixed theprintfunction (PR #108 by @shivasankarka) - Refine the
NDArrayinitializers and array creation routines (Discussion #90, Issue #110).- Remove
randomargument fromNDArrayconstructors. Make random initializer a standalone functions (Issue #96 by @MadAlex1997, PR #97 by @MadAlex1997, PR #98 by @shivasankarka). - Remove initializers from
String. Makefromstringa standalone function (#113 by @forfudan). - Add several
arrayoverloads for initializingNDArray(PR #118 by @shivasankarka).
- Remove
- Modify the behavior of
__get__and__set__. Passing in a sequence ofIntorSlicereturns anNDArray. Passing in anIdxreturns a scalar. Allow users to set a multiple items in oneNDArraywith anotherNDArray, using__set__(PR #118 by @shivasankarka, Discussion #70).
❌ Removed
- Removed all instances of getters and setters with
List[Int],VariadicList[Int](PR #118 by @shivasankarka).
🛠️ Fixed
- Fix the issues in parallelization (due to Max 24.5) for some linear algebra functions, e.g,
matmul,solve,inv, etc (PR #115 #117 by @forfudan).
📚 Documentary and testing
- Add workflows with unit tests and linting (PR #95 by @sandstromviktor).
- Add multi-lingual support (Chinese, Japanese) for the readme file (PR #99 #120 by @forfudan, PR #100 by @shivasankarka).
- Update the test flow file to accommodate MAX 24.5 and the
magicsystem (PR #116 by @forfudan).
17/08/2024 (V0.2)
⭐️ New
Array operations:
- Introduced
diagflat()method for creating diagonal arrays - Implemented most basic array creation routines
- Implemented initializer from string
numojo.NDArray("[[1,2,3],[4,5,6]]") - Enhanced
NDArrayconstructor methods - Added boolean masking for NDArrays
- Introduced new mathematical methods:
floordiv,mod, and more __getitem__and__setitem__now fully compatible with NumPy behavior
Others:
- Introduced Rust-like data type aliases (e.g.,
DType.float64→f64) - Implemented function overloading for core mathematical operations (add, sub, etc.)
- Added a new differentiation module
🦋 Changed
- Improved slicing functionality to match NumPy behavior
❌ Removed
- Removed
in_dtypeandout_dtypeparameters for simplified type handling
📚 Documentatory and testing
Documentation updates:
- Expanded and updated README
- Improved docstrings for functions
- Added style guide and examples
Testing updates:
- Introduced new test files that are compatible with
mojo test.
Contributors
- @shivasankarka
- @forfudan
- @MadAlex1997
- @mmenendezg
- @sandstromviktor
NuMojo V0.2
NuMojo V0.2 Release Notes
Major Changes
- Removed
in_dtypeandout_dtypeparameters for simplified type handling - Introduced Rust-like data type aliases (e.g.,
DType.float64→f64) - Implemented function overloading for core mathematical operations (add, sub, etc.)
- Added a new differentiation module
New Features
Array Operations
- Introduced
diagflat()method for creating diagonal arrays - Implemented most basic array creation routines
- Implemented initializer from string
numojo.NDArray("[[1,2,3],[4,5,6]]") - Enhanced
NDArrayconstructor methods - Improved slicing functionality to match NumPy behavior
- Added boolean masking for NDArrays
- Introduced new mathematical methods:
floordiv,mod, and more __getitem__and__setitem__now fully compatible with NumPy behavior
Documentation Updates
- Expanded and updated README
- Improved docstrings for functions
- Added style guide and examples
Testing
- Introduced new test files that are compatible with
mojo test.
Compatibility
- Works with Mojo 24.4
- No external dependencies required
Notes
- Binary distributions are not included due to current limitations in Mojo's packaging system
Contributors
New Contributors
- @mmenendezg made their first contribution in #88
Full Changelog: v0.1...v0.2
NuMojo v0.1 for Mojo 24.4
The first tracked version of NuMojo, is compatible with Mojo 24.4. Binaries are not included (Mojo doesn't have a packaging system yet), but no dependencies other than Mojo compiler version 24.4.