* fix the `np.delete` bug
* fix the `np.delete` bug, add unittest code
* increment the version number and update the change log
* update the expected file `delete.py.exp`
* ndarray_set_value: in CircuitPython 9
* mp_obj_slice_indices: ditto
* Use modern MP_REGISTER_MODULE calls: ditto
* use MP_OBJ_SENTINEL to forward to locals dict (was never necessary?)
* Fix -Wunused-variable diagnostic when !ULAB_SUPPORTS_COMPLEX
`o_in` is only used in the SUPPORTS_COMPLEX case, so the variable
definition needs to be moved accordingly.
* update version and changelog
* add optional out keyword argument to math functions
* fix the keyword handling in sqrt
* run micropython build on ubuntu 20.04 instead of latest
* fix unused variable error in vector_generic_vector
This is useful for generating FIR filters using code snippets generated at
https://fiiir.com/ (at least those with a rectangular window type; other
window types need additional functions but we can revisit it later if needed)
I think this will come in handy for folks who are using the advanced
features of our audio synthesizer module, synthio.
e.g., the following block now gives highly similar results on ulab
or numpy:
```py
try:
import numpy as np
except:
from ulab import numpy as np
# Example code, computes the coefficients of a low-pass windowed-sinc filter.
# Configuration.
fS = 48000 # Sampling rate.
fL = 4000 # Cutoff frequency.
N = 23 # Filter length, must be odd.
# Compute sinc filter.
h = np.sinc(2 * fL / fS * (np.arange(N) - (N - 1) / 2))
# Normalize to get unity gain.
h /= np.sum(h)
# Applying the filter to a signal s can be as simple as writing
# s = np.convolve(s, h)
* Fix create_arange crashing when stop == start
This is due to len being equal to zero, which made (len - 1) equal to MAX_UINT16
* trailing whitespaces
* implement floor division
* fix 3D, 4D loops
* add missing array declaration in 3D, and 4D
* Add test cases for floor division and fix it for ints (#599)
* Add test cases for floor division
* Fix define name in comment
* Fix floor division of ints
---------
Co-authored-by: Maciej Sokołowski <matemaciek@gmail.com>
Older compilers (eg for esp8266) cannot see that "const uint32_t" is a true
constant at compile time, so use an assigned enum instead.
Don't do this for object representation D because that requires a 64-bit
integer.
Signed-off-by: Damien George <damien@micropython.org>
Now, requesting to allocate an array that is too big gives the exception
'array is too big', like numpy.
This does depend on a gcc extension, `__builtin_mul_overflow`, present
since at least version 5. This extension is also supported in clang.
msvc is probably the only compiler of note that does not support it.
Closes: #576
Prior to this fix the code was using the mp_float_t data type for uint16
and producing incorrect sort results.
Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Damien George <damien@micropython.org>
* Fix missing comma in type definition
Signed-off-by: Damien George <damien@micropython.org>
* Make sure all files have a new-line at the end
Some very old compilers don't like files without a new-line at the end.
Signed-off-by: Damien George <damien@micropython.org>
* Use math.isclose for universal_functions expm1 test
Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Damien George <damien@micropython.org>
* build.sh: Fix unix executable path.
This was updated recently to no longer copy to the ports/unix directory.
Use the version in the build directory instead if available.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* Update to new style mp_obj_type_t definitions.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
A given use of ULAB_DEFINE_FLOAT_CONST may already have the correct form
of the float constant, so wrapping it in MICROPY_FLOAT_CONST may be the
wrong thing to do. So let the user of ULAB_DEFINE_FLOAT_CONST control how
the constant is formed.
Signed-off-by: Damien George <damien.p.george@gmail.com>
REPR_A is used for e.g., broadcom build raspberrypi_pi4b.
This is a trick, so that the appended 'f' is attached to the "0.".
Without this, a diagnostic occurred:
```
../../extmod/ulab/code/numpy/../ndarray.h:27:34: error: invalid suffix "FF" on floating constant
```