From 7592ada7c366da997703925eb7eebf9a35049c65 Mon Sep 17 00:00:00 2001 From: ndonkoHenri Date: Mon, 6 Jul 2026 22:38:17 +0200 Subject: [PATCH 1/2] recipe: pywavelets 1.9.0 PyWavelets for iOS and Android (flet-dev/flet#6649, unblocks neurokit2 which is pure-Python and installs from PyPI once this wheel exists). Minimal meson-python + Cython recipe (contourpy/pandas archetype): the sdist vendors all native code (plain C, no C++/OpenMP/BLAS), so no flet-lib* deps and zero patches. numpy resolved through the meson cross file's host-runnable python. Tested locally on Python 3.12: - full 6/6 build matrix green (3 iOS slices + 3 Android ABIs) - on-device recipe-tester 4/4 passed on iOS Simulator (arm64) and Android emulator (arm64-v8a): dwt/idwt round-trip, multilevel wavedec/waverec, swt/iswt, cwt with a complex Morlet wavelet. --- recipes/pywavelets/meta.yaml | 17 ++++++++ recipes/pywavelets/tests/test_pywavelets.py | 47 +++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 recipes/pywavelets/meta.yaml create mode 100644 recipes/pywavelets/tests/test_pywavelets.py diff --git a/recipes/pywavelets/meta.yaml b/recipes/pywavelets/meta.yaml new file mode 100644 index 0000000..5216e01 --- /dev/null +++ b/recipes/pywavelets/meta.yaml @@ -0,0 +1,17 @@ +package: + name: pywavelets + version: "1.9.0" + +requirements: + build: + - ninja + - meson + - cython + host: + - numpy ^2.0.0 + +build: + number: 1 + backend-args: + - -Csetup-args=--cross-file + - -Csetup-args={MESON_CROSS_FILE} diff --git a/recipes/pywavelets/tests/test_pywavelets.py b/recipes/pywavelets/tests/test_pywavelets.py new file mode 100644 index 0000000..69c9521 --- /dev/null +++ b/recipes/pywavelets/tests/test_pywavelets.py @@ -0,0 +1,47 @@ +import numpy as np + + +def test_dwt_roundtrip(): + """dwt/idwt round-trip -> exercises the _dwt extension + c_wt convolution.""" + import pywt + + x = np.linspace(0.0, 1.0, 64) + ca, cd = pywt.dwt(x, "db2") + y = pywt.idwt(ca, cd, "db2") + assert np.allclose(x, y[: len(x)]) + + +def test_wavedec_multilevel(): + """wavedec/waverec multilevel -> exercises the _pywt wavelet objects.""" + import pywt + + x = np.sin(np.linspace(0.0, 8.0 * np.pi, 128)) + coeffs = pywt.wavedec(x, "haar", level=3) + assert len(coeffs) == 4 + y = pywt.waverec(coeffs, "haar") + assert np.allclose(x, y[: len(x)]) + + +def test_swt(): + """Stationary wavelet transform -> exercises the _swt extension.""" + import pywt + + x = np.arange(32, dtype=np.float64) + coeffs = pywt.swt(x, "db1", level=2) + assert len(coeffs) == 2 + y = pywt.iswt(coeffs, "db1") + assert np.allclose(x, y) + + +def test_cwt_complex_wavelet(): + """cwt with a complex Morlet -> exercises the _cwt extension and the + C99 complex code paths in the vendored C library.""" + import pywt + + t = np.linspace(0.0, 1.0, 200) + x = np.sin(40.0 * np.pi * t) + coefs, freqs = pywt.cwt(x, np.arange(1, 16), "cmor1.5-1.0") + assert coefs.shape == (15, 200) + assert np.iscomplexobj(coefs) + assert np.isfinite(coefs).all() + assert len(freqs) == 15 From 65d10da9a6a40cd527e8129007ab1fdb15a2ba26 Mon Sep 17 00:00:00 2001 From: ndonkoHenri Date: Mon, 6 Jul 2026 22:41:45 +0200 Subject: [PATCH 2/2] update --- recipes/pywavelets/meta.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/recipes/pywavelets/meta.yaml b/recipes/pywavelets/meta.yaml index 5216e01..2f5533f 100644 --- a/recipes/pywavelets/meta.yaml +++ b/recipes/pywavelets/meta.yaml @@ -2,6 +2,12 @@ package: name: pywavelets version: "1.9.0" +build: + number: 1 + backend-args: + - -Csetup-args=--cross-file + - -Csetup-args={MESON_CROSS_FILE} + requirements: build: - ninja @@ -9,9 +15,3 @@ requirements: - cython host: - numpy ^2.0.0 - -build: - number: 1 - backend-args: - - -Csetup-args=--cross-file - - -Csetup-args={MESON_CROSS_FILE}