Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ jobs:
# Linux arm64
- runs-on: ubuntu-22.04-arm
python-version: "3.14"
# Linux arm64, MSVC-style struct complex types forced, to exercise
# the operator-free complex code path on a C99-complex compiler
# (see PYWT_TEST_STRUCT_COMPLEX in pywt/_extensions/c/common.h)
- runs-on: ubuntu-22.04-arm
python-version: "3.14"
OPTIONS_NAME: "struct-complex"
# Linux amd64
- runs-on: ubuntu-latest
python-version: "3.12"
Expand Down Expand Up @@ -100,6 +106,8 @@ jobs:
elif [ "${REFGUIDE_CHECK}" == "1" ]; then
pip install sphinx numpydoc scipy-doctest
pip install . -v
elif [ "${OPTIONS_NAME}" == "struct-complex" ]; then
pip install . -v -Csetup-args=-Dc_args=-DPYWT_TEST_STRUCT_COMPLEX
else
pip install . -v
fi
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ doc/source/regression/*.ipynb
# Project working files
# Expanded Cython
pywt/_extensions/*.[ch]
pywt/_extensions/_c99_config.py
pywt/_extensions/config.pxi
cythonize.dat
pywt/version.py
build.log
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ project(
],
)

cython = find_program('cython')
cython = find_program('cython', version: '>=3.2.5')

py = import('python').find_installation(pure: false)
py_dep = py.dependency()
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
build-backend = "mesonpy"
requires = [
"meson-python>=0.18.0",
"Cython>=3.1.3",
"Cython>=3.2.5",

# numpy requirement for wheel builds for distribution on PyPI - building
# against 2.x yields wheels that are also compatible with numpy 1.x at
Expand Down
3 changes: 0 additions & 3 deletions pywt/_c99_config.py.in

This file was deleted.

24 changes: 0 additions & 24 deletions pywt/_dwt.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import numpy as np

from ._c99_config import _have_c99_complex
from ._extensions._dwt import downcoef as _downcoef
from ._extensions._dwt import dwt_axis, dwt_single, idwt_axis, idwt_single
from ._extensions._dwt import dwt_coeff_len as _dwt_coeff_len
Expand Down Expand Up @@ -161,12 +160,6 @@ def dwt(data, wavelet, mode='symmetric', axis=-1):
array([-0.70710678, -0.70710678, -0.70710678])

"""
if not _have_c99_complex and np.iscomplexobj(data):
data = np.asarray(data)
cA_r, cD_r = dwt(data.real, wavelet, mode, axis)
cA_i, cD_i = dwt(data.imag, wavelet, mode, axis)
return (cA_r + 1j*cA_i, cD_r + 1j*cD_i)

# accept array_like input; make a copy to ensure a contiguous array
dt = _check_dtype(data)
data = np.asarray(data, dtype=dt, order='C')
Expand Down Expand Up @@ -241,17 +234,6 @@ def idwt(cA, cD, wavelet, mode='symmetric', axis=-1):
raise ValueError("At least one coefficient parameter must be "
"specified.")

# for complex inputs: compute real and imaginary separately then combine
if not _have_c99_complex and (np.iscomplexobj(cA) or np.iscomplexobj(cD)):
if cA is None:
cD = np.asarray(cD)
cA = np.zeros_like(cD)
elif cD is None:
cA = np.asarray(cA)
cD = np.zeros_like(cA)
return (idwt(cA.real, cD.real, wavelet, mode, axis) +
1j*idwt(cA.imag, cD.imag, wavelet, mode, axis))

if cA is not None:
dt = _check_dtype(cA)
cA = np.asarray(cA, dtype=dt, order='C')
Expand Down Expand Up @@ -328,9 +310,6 @@ def downcoef(part, data, wavelet, mode='symmetric', level=1):
upcoef

"""
if not _have_c99_complex and np.iscomplexobj(data):
return (downcoef(part, data.real, wavelet, mode, level) +
1j*downcoef(part, data.imag, wavelet, mode, level))
# accept array_like input; make a copy to ensure a contiguous array
dt = _check_dtype(data)
data = np.asarray(data, dtype=dt, order='C')
Expand Down Expand Up @@ -387,9 +366,6 @@ def upcoef(part, coeffs, wavelet, level=1, take=0):
array([ 1., 2., 3., 4., 5., 6.])

"""
if not _have_c99_complex and np.iscomplexobj(coeffs):
return (upcoef(part, coeffs.real, wavelet, level, take) +
1j*upcoef(part, coeffs.imag, wavelet, level, take))
# accept array_like input; make a copy to ensure a contiguous array
dt = _check_dtype(coeffs)
coeffs = np.asarray(coeffs, dtype=dt, order='C')
Expand Down
Loading