From fab8a1e6a8d39bf250a508185b40922290027cb5 Mon Sep 17 00:00:00 2001 From: Christophe Favergeon Date: Fri, 20 Jan 2023 13:39:47 +0100 Subject: [PATCH] Correction to python wrapper build so that the result can be used on google colab --- PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_module.h | 9 ++++++++- PythonWrapper/examples/example_1_11.py | 1 - PythonWrapper_README.md | 4 ++++ cmsisdsp/version.py | 2 +- pyproject.toml | 2 +- setup.py | 10 +++++----- 6 files changed, 19 insertions(+), 9 deletions(-) diff --git a/PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_module.h b/PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_module.h index f3c5fd5a..8088cf4a 100644 --- a/PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_module.h +++ b/PythonWrapper/cmsisdsp_pkg/src/cmsisdsp_module.h @@ -27,7 +27,14 @@ */ #ifndef CMSISMODULE_H #define CMSISMODULE_H -#define NPY_NO_DEPRECATED_API NPY_1_15_API_VERSION +#define NPY_NO_DEPRECATED_API NPY_1_21_API_VERSION + +#include + +// API version used on google colab +#if (NPY_API_VERSION != 0x0000000E ) +#error("Error building with wrong NumPy API version") +#endif #ifdef WIN #pragma warning( disable : 4013 ) diff --git a/PythonWrapper/examples/example_1_11.py b/PythonWrapper/examples/example_1_11.py index 5525e594..91ddf120 100644 --- a/PythonWrapper/examples/example_1_11.py +++ b/PythonWrapper/examples/example_1_11.py @@ -7,7 +7,6 @@ from colorama import init,Fore, Back, Style from numpy.testing import assert_allclose from numpy.linalg import norm -from dtw import * import matplotlib import matplotlib as mpl diff --git a/PythonWrapper_README.md b/PythonWrapper_README.md index 7ea725b4..9e7fefce 100644 --- a/PythonWrapper_README.md +++ b/PythonWrapper_README.md @@ -239,6 +239,10 @@ The wrapper is now containing the compute graph Python scripts and you should re # Change history +## Version 1.9.5: + +Same as 1.9.4 but will work in Google Colab. + ## Version 1.9.4: * Dynamic Time Warping API diff --git a/cmsisdsp/version.py b/cmsisdsp/version.py index b30bc6a7..d5ecdc81 100755 --- a/cmsisdsp/version.py +++ b/cmsisdsp/version.py @@ -1,2 +1,2 @@ # Python wrapper version -__version__ = "1.9.4" +__version__ = "1.9.5" diff --git a/pyproject.toml b/pyproject.toml index 3c5bf871..f948ba58 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,6 +2,6 @@ requires = [ "setuptools>=42", "wheel", - "numpy>=1.19" + "numpy>=1.21, < 1.22" ] build-backend = "setuptools.build_meta" \ No newline at end of file diff --git a/setup.py b/setup.py index 07bb6dcf..988bee54 100644 --- a/setup.py +++ b/setup.py @@ -299,11 +299,11 @@ def build(): "Intended Audience :: Developers", ], keywords=['development','dsp','cmsis','cmsis-dsp','Arm','signal processing','maths','ml','cortex-m','cortex-a'], - install_requires=['numpy>=1.19', - 'networkx>=2.5', - 'jinja2>= 2.0, <3.0', - 'sympy>=1.6', - 'markupsafe<2.1' + install_requires=['numpy>=1.21, < 1.22 ', + 'networkx>=3.0', + 'jinja2>= 2.11.3, <3.0', + 'sympy>=1.7.1', + 'markupsafe>=2.0.1, <2.1' ], project_urls={ # Optional 'Bug Reports': 'https://github.com/ARM-software/CMSIS-DSP/issues',