Skip to content

Commit

Permalink
Version 1.9.8: unfixed numpy from 1.22
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremitu committed Jan 15, 2024
1 parent 647b755 commit 82d9415
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 50 deletions.
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ include PythonWrapper_README.md
recursive-include Include *.h
recursive-include PrivateInclude *.h
recursive-include PythonWrapper/cmsisdsp_pkg/src *.h
include cmsisdsp/cg/scheduler/templates/*
include Source/DistanceFunctions/arm_boolean_distance_template.h

2 changes: 1 addition & 1 deletion PythonWrapper/build/create.bat
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake -DHOST=YES ^
-DLOOPUNROLL=ON ^
-DWRAPPER=YES ^
-DCMSISDSP="path to CMSIS-DSP folder" ^
-DCMSISDSP=".." ^
-DCMAKE_C_FLAGS_RELEASE="-std=c11 -Ofast -ffast-math -DNDEBUG -Wall -Wextra" ^
-DCMAKE_CXX_FLAGS_RELEASE="-fno-rtti -std=c++11 -Ofast -ffast-math -DNDEBUG -Wall -Wextra -Wno-unused-parameter" ^
-G "Unix Makefiles" ..
Expand Down
4 changes: 2 additions & 2 deletions PythonWrapper/build_linux/create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ cmake -DHOST=YES \
-DLOOPUNROLL=ON \
-DWRAPPER=YES \
-DCMAKE_POSITION_INDEPENDENT_CODE=YES \
-DCMSISDSP="path to CMSIS-DSP folder" \
-DCMSISDSP=".." \
-DCMAKE_C_FLAGS_RELEASE="-std=c11 -Ofast -ffast-math -DNDEBUG -Wall -Wextra" \
-DCMAKE_CXX_FLAGS_RELEASE="-fno-rtti -std=c++11 -Ofast -ffast-math -DNDEBUG -Wall -Wextra -Wno-unused-parameter" \
-G "Unix Makefiles" ..

# For Mac universal lib
# -arch x86_64 -arch arm64 -mmacosx-version-min=11.0
# -arch x86_64 -arch arm64 -mmacosx-version-min=11.0
8 changes: 4 additions & 4 deletions PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_distance.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ cmsis_arm_dtw_init_window_q7(PyObject *obj,
arm_matrix_instance_q7 pSrc_converted; // input


if (PyArg_ParseTuple(args,"iiO",&winType,&winSize,&pSrc));
if (PyArg_ParseTuple(args,"iiO",&winType,&winSize,&pSrc))
{

q7MatrixFromNumpy(&pSrc_converted,pSrc);
Expand Down Expand Up @@ -267,7 +267,7 @@ cmsis_arm_dtw_distance_f32(PyObject *obj,
arm_matrix_instance_f32 dtw_converted;


if (PyArg_ParseTuple(args,"OO",&pDist,&pWin));
if (PyArg_ParseTuple(args,"OO",&pDist,&pWin))
{

f32MatrixFromNumpy(&pDist_converted,pDist);
Expand Down Expand Up @@ -348,7 +348,7 @@ cmsis_arm_dtw_path_f32(PyObject *obj,
Py_DECREF(pDstOBJ);
return(pythonResult);
}

Py_RETURN_NONE;
}

static PyMethodDef CMSISDSPMethods[] = {
Expand Down Expand Up @@ -450,4 +450,4 @@ void CAT(init,MODINITNAME)(void)
#ifdef IS_PY3K
return module;
#endif
}
}
4 changes: 2 additions & 2 deletions PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
#include <numpy/numpyconfig.h>

// API version used on google colab
// List on https://github.com/numpy/numpy/blob/main/numpy/core/include/numpy/numpyconfig.h
// List in https://github.com/numpy/numpy numpyconfig.h
#if (NPY_API_VERSION != 0x0000000F )
#error("Error building with wrong NumPy API version")
//#error("Error building with wrong NumPy API version")
#endif

#ifdef WIN
Expand Down
40 changes: 20 additions & 20 deletions PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_window.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ cmsis_arm_welch_f64(PyObject *obj, PyObject *args)
{


float32_t *pDst=NULL; // output
float64_t *pDst=NULL; // output
int nb; // input

if (PyArg_ParseTuple(args,"i",&nb))
Expand Down Expand Up @@ -125,7 +125,7 @@ cmsis_arm_bartlett_f64(PyObject *obj, PyObject *args)
{


float32_t *pDst=NULL; // output
float64_t *pDst=NULL; // output
int nb; // input

if (PyArg_ParseTuple(args,"i",&nb))
Expand Down Expand Up @@ -178,7 +178,7 @@ cmsis_arm_hamming_f64(PyObject *obj, PyObject *args)
{


float32_t *pDst=NULL; // output
float64_t *pDst=NULL; // output
int nb; // input

if (PyArg_ParseTuple(args,"i",&nb))
Expand Down Expand Up @@ -231,7 +231,7 @@ cmsis_arm_hanning_f64(PyObject *obj, PyObject *args)
{


float32_t *pDst=NULL; // output
float64_t *pDst=NULL; // output
int nb; // input

if (PyArg_ParseTuple(args,"i",&nb))
Expand Down Expand Up @@ -284,7 +284,7 @@ cmsis_arm_nuttall3_f64(PyObject *obj, PyObject *args)
{


float32_t *pDst=NULL; // output
float64_t *pDst=NULL; // output
int nb; // input

if (PyArg_ParseTuple(args,"i",&nb))
Expand Down Expand Up @@ -337,7 +337,7 @@ cmsis_arm_nuttall4_f64(PyObject *obj, PyObject *args)
{


float32_t *pDst=NULL; // output
float64_t *pDst=NULL; // output
int nb; // input

if (PyArg_ParseTuple(args,"i",&nb))
Expand Down Expand Up @@ -390,7 +390,7 @@ cmsis_arm_nuttall3a_f64(PyObject *obj, PyObject *args)
{


float32_t *pDst=NULL; // output
float64_t *pDst=NULL; // output
int nb; // input

if (PyArg_ParseTuple(args,"i",&nb))
Expand Down Expand Up @@ -443,7 +443,7 @@ cmsis_arm_nuttall3b_f64(PyObject *obj, PyObject *args)
{


float32_t *pDst=NULL; // output
float64_t *pDst=NULL; // output
int nb; // input

if (PyArg_ParseTuple(args,"i",&nb))
Expand Down Expand Up @@ -496,7 +496,7 @@ cmsis_arm_nuttall4a_f64(PyObject *obj, PyObject *args)
{


float32_t *pDst=NULL; // output
float64_t *pDst=NULL; // output
int nb; // input

if (PyArg_ParseTuple(args,"i",&nb))
Expand Down Expand Up @@ -549,7 +549,7 @@ cmsis_arm_blackman_harris_92db_f64(PyObject *obj, PyObject *args)
{


float32_t *pDst=NULL; // output
float64_t *pDst=NULL; // output
int nb; // input

if (PyArg_ParseTuple(args,"i",&nb))
Expand Down Expand Up @@ -602,7 +602,7 @@ cmsis_arm_nuttall4b_f64(PyObject *obj, PyObject *args)
{


float32_t *pDst=NULL; // output
float64_t *pDst=NULL; // output
int nb; // input

if (PyArg_ParseTuple(args,"i",&nb))
Expand Down Expand Up @@ -655,7 +655,7 @@ cmsis_arm_nuttall4c_f64(PyObject *obj, PyObject *args)
{


float32_t *pDst=NULL; // output
float64_t *pDst=NULL; // output
int nb; // input

if (PyArg_ParseTuple(args,"i",&nb))
Expand Down Expand Up @@ -708,7 +708,7 @@ cmsis_arm_hft90d_f64(PyObject *obj, PyObject *args)
{


float32_t *pDst=NULL; // output
float64_t *pDst=NULL; // output
int nb; // input

if (PyArg_ParseTuple(args,"i",&nb))
Expand Down Expand Up @@ -761,7 +761,7 @@ cmsis_arm_hft95_f64(PyObject *obj, PyObject *args)
{


float32_t *pDst=NULL; // output
float64_t *pDst=NULL; // output
int nb; // input

if (PyArg_ParseTuple(args,"i",&nb))
Expand Down Expand Up @@ -814,7 +814,7 @@ cmsis_arm_hft116d_f64(PyObject *obj, PyObject *args)
{


float32_t *pDst=NULL; // output
float64_t *pDst=NULL; // output
int nb; // input

if (PyArg_ParseTuple(args,"i",&nb))
Expand Down Expand Up @@ -867,7 +867,7 @@ cmsis_arm_hft144d_f64(PyObject *obj, PyObject *args)
{


float32_t *pDst=NULL; // output
float64_t *pDst=NULL; // output
int nb; // input

if (PyArg_ParseTuple(args,"i",&nb))
Expand Down Expand Up @@ -920,7 +920,7 @@ cmsis_arm_hft169d_f64(PyObject *obj, PyObject *args)
{


float32_t *pDst=NULL; // output
float64_t *pDst=NULL; // output
int nb; // input

if (PyArg_ParseTuple(args,"i",&nb))
Expand Down Expand Up @@ -973,7 +973,7 @@ cmsis_arm_hft196d_f64(PyObject *obj, PyObject *args)
{


float32_t *pDst=NULL; // output
float64_t *pDst=NULL; // output
int nb; // input

if (PyArg_ParseTuple(args,"i",&nb))
Expand Down Expand Up @@ -1026,7 +1026,7 @@ cmsis_arm_hft223d_f64(PyObject *obj, PyObject *args)
{


float32_t *pDst=NULL; // output
float64_t *pDst=NULL; // output
int nb; // input

if (PyArg_ParseTuple(args,"i",&nb))
Expand Down Expand Up @@ -1079,7 +1079,7 @@ cmsis_arm_hft248d_f64(PyObject *obj, PyObject *args)
{


float32_t *pDst=NULL; // output
float64_t *pDst=NULL; // output
int nb; // input

if (PyArg_ParseTuple(args,"i",&nb))
Expand Down
15 changes: 6 additions & 9 deletions PythonWrapper_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,13 @@ The signal processing chain can thus be tested and developed in a Python environ
A tutorial is also available but with less details than this README:
https://developer.arm.com/documentation/102463/latest/

This wrapper is also containing the scripts for the new [CMSIS-DSP compute graph framework](https://github.com/ARM-software/CMSIS-DSP/tree/main/ComputeGraph) (CG).

CG is also including some nodes to communicate with Modelica using the VHT Modelica blocks developed as part of our [VHT-SystemModeling](https://github.com/ARM-software/VHT-SystemModeling) demos.

An history of the changes to this wrapper is available at the end of the README.

# How to build and install

## Tested configurations

The building of this package has been tested on Windows with the Python install from python.org and Microsoft Visual 2017.
The building of this package has been tested on Windows with the Python install from python.org and Microsoft Visual Studio 2022 and on Ubuntu 22.04.

It has also been tested with `cygwin`. In that case, `python-devel` must be installed too. On Mac, it was tested with standard XCode installation.

Expand All @@ -43,8 +39,6 @@ You must have a recent `pip` (to automatically install the dependencies like `Nu

DSP examples are available in the [CMSIS-DSP PythonWrapper examples](https://github.com/ARM-software/CMSIS-DSP/tree/main/PythonWrapper/examples) folder.

Synchronous Data Flow examples are available in the [ComputeGraph](https://github.com/ARM-software/CMSIS-DSP/tree/main/ComputeGraph) folder of [CMSIS-DSP](https://github.com/ARM-software/CMSIS-DSP) .

You can also install and run it from [Google colab](https://colab.research.google.com/):

This [link](https://colab.research.google.com/github/ARM-software/CMSIS-DSP/blob/main/PythonWrapper/examples/cmsisdsp_tests.ipynb) will open a Jupyter notebook in [Google colab](https://colab.research.google.com/) for testing. This notebook is from the [examples](https://github.com/ARM-software/CMSIS-DSP/tree/main/PythonWrapper/examples) in the CMSIS-DSP GitHub repository.
Expand Down Expand Up @@ -236,12 +230,15 @@ MEL filters are represented as 3 arrays to encode a sparse array.

`datatype` is an API on top of `fixedpoint` to provide more reuse when converting between data formats.

The wrapper is now containing the compute graph Python scripts and you should refer the the documentation in `DSP/ComputeGraph` folder to know how to use those tools.



# Change history

## Version 1.9.8:
* Compute graph API has been removed
* Dependency on numpy 1.22 has been lifted, tested through numpy 1.26
* Inconsistencies in distance and window modules have been fixed.

## Version 1.9.7:

* Upgrade for compatibility with google colab
Expand Down
2 changes: 1 addition & 1 deletion cmsisdsp/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Python wrapper version
__version__ = "1.9.7"
__version__ = "1.9.8"
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
requires = [
"setuptools>=42",
"wheel",
"numpy>=1.22, < 1.23"
"numpy>=1.22"
]
build-backend = "setuptools.build_meta"
build-backend = "setuptools.build_meta"
12 changes: 4 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,7 @@ def build():

setup (name = 'cmsisdsp',
version = main_ns['__version__'],
packages=["cmsisdsp",
"cmsisdsp.cg",
"cmsisdsp.cg.nodes",
"cmsisdsp.cg.nodes.host",
"cmsisdsp.cg.scheduler",
"cmsisdsp.cg.scheduler.templates"],
packages=["cmsisdsp"],
description = 'CMSIS-DSP Python API',
long_description=open("PythonWrapper_README.md").read(),
long_description_content_type='text/markdown',
Expand Down Expand Up @@ -205,7 +200,8 @@ def build():
"Intended Audience :: Developers",
],
keywords=['development','dsp','cmsis','cmsis-dsp','Arm','signal processing','maths','ml','cortex-m','cortex-a'],
install_requires=['numpy>=1.22, < 1.23 ',
install_requires=[
'numpy>=1.22',
'networkx>=3.0',
'jinja2>= 3.1.2, <4.0',
'sympy>=1.7.1',
Expand All @@ -218,4 +214,4 @@ def build():
)


build()
build()

0 comments on commit 82d9415

Please sign in to comment.