From f317e67a8ba5c904fe0040464915e178dc8f4499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ZHU=20Yuhao=20=E6=9C=B1=E5=AE=87=E6=B5=A9?= Date: Wed, 29 Jan 2025 00:07:26 +0100 Subject: [PATCH 1/7] To PR 199 --- docs/changelog.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/changelog.md b/docs/changelog.md index dc26a786..943cd076 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -2,6 +2,14 @@ This is a list of RELEASED changes for the NuMojo Package. +## xx/xx/2025 (v0.6) + +### ⭐️ New + +### 🦋 Changed + +- Update functions in the `random` module, add `randint`, and accept `Shape` as the first argument ([PR #199](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/199)). + ## 26/01/2025 (v0.5) ### ⭐️ New From dd65fd32ecde4e39af487606337c14ffd4f9f4a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ZHU=20Yuhao=20=E6=9C=B1=E5=AE=87=E6=B5=A9?= Date: Wed, 29 Jan 2025 21:56:13 +0100 Subject: [PATCH 2/7] To PR 200 --- docs/changelog.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/changelog.md b/docs/changelog.md index 943cd076..dcd39996 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -9,6 +9,11 @@ This is a list of RELEASED changes for the NuMojo Package. ### 🦋 Changed - Update functions in the `random` module, add `randint`, and accept `Shape` as the first argument ([PR #199](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/199)). +- Update functions in the `statistics` module. Add the parameter `returned_dtype` to functions which defaults to `f64`. Add `variance()` and `std()` ([PR #200](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/200)). + +### ❌ Removed + +- Remove `cumvariance`, `cumstd`, `cumpvariance`, `cumpstd` ([PR #200](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/200)). ## 26/01/2025 (v0.5) From 33deaab1493504e99f3c3bf37bd99c86d2986564 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ZHU=20Yuhao=20=E6=9C=B1=E5=AE=87=E6=B5=A9?= Date: Sun, 2 Feb 2025 16:01:55 +0100 Subject: [PATCH 3/7] To PR 206 --- docs/changelog.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/changelog.md b/docs/changelog.md index dcd39996..dddab6d0 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -6,10 +6,13 @@ This is a list of RELEASED changes for the NuMojo Package. ### ⭐️ New +- Implement `broadcast_to()` for `NDArray`. The function broadcasts an ndarray to any compatible shape ([PR #202](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/202)). + ### 🦋 Changed - Update functions in the `random` module, add `randint`, and accept `Shape` as the first argument ([PR #199](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/199)). - Update functions in the `statistics` module. Add the parameter `returned_dtype` to functions which defaults to `f64`. Add `variance()` and `std()` ([PR #200](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/200)). +- Add boundary checks for `NDArrayShape` and `NDArrayStrides` to ensure safe use. Improve the docstring ([PR #205](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/205), [PR #206](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/206)). ### ❌ Removed From 5490bf087fbb06932781c8e97968b41350556ea2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ZHU=20Yuhao=20=E6=9C=B1=E5=AE=87=E6=B5=A9?= Date: Sun, 16 Feb 2025 15:34:43 +0100 Subject: [PATCH 4/7] Up to 213 --- docs/changelog.md | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index dddab6d0..5a80f794 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -6,18 +6,38 @@ This is a list of RELEASED changes for the NuMojo Package. ### ⭐️ New -- Implement `broadcast_to()` for `NDArray`. The function broadcasts an ndarray to any compatible shape ([PR #202](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/202)). +- For `NDArray` type: + - Implement `broadcast_to()` for `NDArray`. The function broadcasts an array to any compatible shape ([PR #202](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/202)). +- Add `NDAxisIter` type as a iterator that returns, in each iteration, a 1-d array along that axis ([PR #212](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/212)). +- Add `Flags` type for storing information on memory layout of arrays. The `Flags` type replaces the current `Dict[String, Bool]` type ([PR #210](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/210)). +- Add `apply_func_on_array_with_dim_reduction()`, `apply_func_on_array_without_dim_reduction()` to allow applying functions working on 1-d array to any axis ([PR #213](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/213)). ### 🦋 Changed -- Update functions in the `random` module, add `randint`, and accept `Shape` as the first argument ([PR #199](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/199)). -- Update functions in the `statistics` module. Add the parameter `returned_dtype` to functions which defaults to `f64`. Add `variance()` and `std()` ([PR #200](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/200)). +- Update the syntax to accommodate to Mojo 25.1 ([PR #211](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/211)). + - Change constructors, e.g., `str()` to `String()`. + - Change `index()` function to `Int()`. + - Change the function `isdigit()` to method. + - Stop using `NDArray.__init__()` to construct arrays but `NDArray()`. +- Update functions in the `random` module: + - Add `randint()`, and accept `Shape` as the first argument ([PR #199](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/199)). +- Update functions in the `statistics` module: + - Add the parameter `returned_dtype` to functions which defaults to `f64` ([PR #200](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/200)). + - Add `variance()` and `std()` ([PR #200](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/200)). Allow calculating variance and std of an array by axis ([PR #207](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/207)). + - Allow `median()` and `mode()` functions to work on any axis. +- Update functions in the `sotring` module: + - Considerably improve the performance of `sort()` function ([PR #213](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/213)). +- Update the behaviors of 0-d array (numojo scalar). Although the syntax `a.item(0)` or `a[Item(0)]` is always preferred, we also allow some basic operations on 0-d array. 0-d array can now be unpacked to get the corresponding mojo scalar either by `[]` or by `item()` [PR #209](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/209). - Add boundary checks for `NDArrayShape` and `NDArrayStrides` to ensure safe use. Improve the docstring ([PR #205](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/205), [PR #206](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/206)). ### ❌ Removed - Remove `cumvariance`, `cumstd`, `cumpvariance`, `cumpstd` ([PR #200](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/200)). +### 📚 Documentatory and testing + +- Updates the roadmap document according to our current progress ([PR #208](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/208)). + ## 26/01/2025 (v0.5) ### ⭐️ New From 134c3d4b3864536ef82043101c8307a04ad344b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ZHU=20Yuhao=20=E6=9C=B1=E5=AE=87=E6=B5=A9?= Date: Wed, 26 Feb 2025 20:21:01 +0100 Subject: [PATCH 5/7] Up to #222 --- docs/changelog.md | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index 5a80f794..36bcbe22 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -2,15 +2,20 @@ This is a list of RELEASED changes for the NuMojo Package. -## xx/xx/2025 (v0.6) +## 28/02/2025 (v0.6) ### ⭐️ New -- For `NDArray` type: - - Implement `broadcast_to()` for `NDArray`. The function broadcasts an array to any compatible shape ([PR #202](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/202)). -- Add `NDAxisIter` type as a iterator that returns, in each iteration, a 1-d array along that axis ([PR #212](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/212)). -- Add `Flags` type for storing information on memory layout of arrays. The `Flags` type replaces the current `Dict[String, Bool]` type ([PR #210](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/210)). -- Add `apply_func_on_array_with_dim_reduction()`, `apply_func_on_array_without_dim_reduction()` to allow applying functions working on 1-d array to any axis ([PR #213](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/213)). +- Implement the `broadcast_to()` method for `NDArray`. This function broadcasts an array to any compatible shape ([PR #202](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/202)). +- Add the `apply_along_axis()` function that executes a function working on 1-d arrays on n-d arrays along the given axis ([PR #213](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/213), [PR #218](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/218)). +- Implement the `diagonal()` function and the `NDArray.diagonal()` method ([PR #217](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/217)). +- Implement the `compress()` function and the `NDArray.compress()` method ([PR #219](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/219)). +- Implement the `clip()` function and the `NDArray.clip()` method ([PR #220](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/220)). +- Add the `_NDAxisIter` type as a iterator that returns, in each iteration, a 1-d array along that axis. The iterator traverse the array either by C-order or F-order ([PR #212](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/212), [PR #214](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/214)). +- Add the `ith()` method to the `_NDArrayIter` type and to the `_NDIter` type to get the i-th item ([PR #219](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/219), [PR #221](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/221)). +- Add the `Flags` type for storing information on memory layout of arrays. The `Flags` type replaces the current `Dict[String, Bool]` type ([PR #210](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/210), [PR #214](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/214)). +- Add the `swapaxes()` methods for the `NDArrayShape` type and the `NDArrayStrides` type ([PR #221](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/221)). +- Add the `offset()` methods for the `Item` type to get the offset of an index in the underlying buffer. Allow the `Item` object to be constructed from index and shape ([PR #221](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/221)). ### 🦋 Changed @@ -25,17 +30,31 @@ This is a list of RELEASED changes for the NuMojo Package. - Add the parameter `returned_dtype` to functions which defaults to `f64` ([PR #200](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/200)). - Add `variance()` and `std()` ([PR #200](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/200)). Allow calculating variance and std of an array by axis ([PR #207](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/207)). - Allow `median()` and `mode()` functions to work on any axis. -- Update functions in the `sotring` module: - - Considerably improve the performance of `sort()` function ([PR #213](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/213)). -- Update the behaviors of 0-d array (numojo scalar). Although the syntax `a.item(0)` or `a[Item(0)]` is always preferred, we also allow some basic operations on 0-d array. 0-d array can now be unpacked to get the corresponding mojo scalar either by `[]` or by `item()` [PR #209](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/209). +- Update functions in the `sorting` module: + - Considerably improve the performance of `sort()` function ([PR #213](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/213), [PR #214](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/214)). + - Allow `argsort` by any axis for both C-order and F-order arrays ([PR #214](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/214)). +- Update function in the `math.extrema` module ([PR #216](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/216)): + - Allow the `max()` and `min()` functions to work on any axis. + - Update the `max()` and `min()` methods for the `NDArray` type. +- Update the behaviors of 0-d array (numojo scalar). Although the syntax `a.item(0)` or `a[Item(0)]` is always preferred, we also allow some basic operations on 0-d array. 0-d array can now be unpacked to get the corresponding mojo scalar either by `[]` or by `item()` ([PR #209](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/209)). - Add boundary checks for `NDArrayShape` and `NDArrayStrides` to ensure safe use. Improve the docstring ([PR #205](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/205), [PR #206](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/206)). +- Significantly increase the speed of printing large arrays ([PR #215](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/215)). +- Replace the `NDArray.num_elements()` method by the `NDArray.size` attribute for all modules ([PR #216](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/216)). ### ❌ Removed -- Remove `cumvariance`, `cumstd`, `cumpvariance`, `cumpstd` ([PR #200](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/200)). +- Remove the `cumvariance`, `cumstd`, `cumpvariance`, `cumpstd` functions ([PR #200](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/200)). +- Remove the `maxT()` and `minT()` functions ([PR #216](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/216)). + +### 🛠️ Fixed + +- Re-write the `ravel()` function so that it will not break for F-order arrays ([PR #214](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/214)). +- Fix the `NDArray.sort()` method (in-place sort). The default axis is changed to `-1` ([PR #217](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/217)). +- Fix the `NDArray.__bool__()` method which may returns incorrect results ([PR #219](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/219)). ### 📚 Documentatory and testing +- Update the docstring of all methods belonging to the `NDArray` type, following the Mojo Docstring Style Guide. Provide more detailed error messages in the internal functions of `NDArray` to enhance clarity and traceability of errors ([PR #222](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/222)). - Updates the roadmap document according to our current progress ([PR #208](https://github.com/Mojo-Numerics-and-Algorithms-group/NuMojo/pull/208)). ## 26/01/2025 (v0.5) From fe2b3607f89119d512c1727637db80673fb9a035 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ZHU=20Yuhao=20=E6=9C=B1=E5=AE=87=E6=B5=A9?= Date: Wed, 26 Feb 2025 20:22:49 +0100 Subject: [PATCH 6/7] Update version number in readme --- README.MD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.MD b/README.MD index b3554478..5f7952e7 100644 --- a/README.MD +++ b/README.MD @@ -201,7 +201,7 @@ You can add `numojo` in the dependencies section of your toml file. ```toml [dependencies] -numojo = "==0.5" +numojo = "=0.6" ``` ### Build package From f7cb6073f7f9edf58cfe0eebd65e987b1b2bbdb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ZHU=20Yuhao=20=E6=9C=B1=E5=AE=87=E6=B5=A9?= Date: Thu, 27 Feb 2025 16:42:19 +0100 Subject: [PATCH 7/7] Update readme file --- README.MD | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/README.MD b/README.MD index 5f7952e7..6e2f1fa9 100644 --- a/README.MD +++ b/README.MD @@ -42,26 +42,26 @@ Our primary objective is to develop a fast, comprehensive numerics library in Mo Core data types: -- Native n-dimensional array (`numojo.core.ndarray.NDArray`). -- Native 2-dimensional array, i.e., matrix (`numojo.core.matrix.Matrix`). -- Native n-dimensional complex array (`numojo.core.complex_ndarray.ComplexNDArray`) +- Native n-dimensional array (`numojo.NDArray`). +- Native 2-dimensional array, i.e., matrix (`numojo.Matrix`). +- Native n-dimensional complex array (`numojo.ComplexNDArray`) - Native fixed-dimension array (to be implemented when trait parameterization is available). Routines and objects: -- Array creation routines (`numojo.routines.creation`) -- Array manipulation routines (`numojo.routines.manipulation`) -- Input and output (`numojo.routines.io`) -- Linear algebra (`numojo.routines.linalg`) -- Logic functions (`numojo.routines.logic`) -- Mathematical functions (`numojo.routines.math`) -- Exponents and logarithms (`numojo.routines.exponents`) -- Extrema finding (`numojo.routines.extrema`) -- Rounding (`numojo.routines.rounding`) -- Trigonometric functions (`numojo.routines.trig`) -- Random sampling (`numojo.routines.random`) -- Sorting, searching, and counting (`numojo.routines.sorting`, `numojo.routines.searching`) -- Statistics (`numojo.routines.statistics`) +- Array creation routines (`numojo.creation`) +- Array manipulation routines (`numojo.manipulation`) +- Input and output (`numojo.io`) +- Linear algebra (`numojo.linalg`) +- Logic functions (`numojo.logic`) +- Mathematical functions (`numojo.math`) +- Exponents and logarithms (`numojo.exponents`) +- Extrema finding (`numojo.extrema`) +- Rounding (`numojo.rounding`) +- Trigonometric functions (`numojo.trig`) +- Random sampling (`numojo.random`) +- Sorting and searching (`numojo.sorting`, `numojo.searching`) +- Statistics (`numojo.statistics`) - etc... Please find all the available functions and objects [here](docs/features.md).