Skip to content

Commit 3ec6e05

Browse files
authored
Merge pull request #684 from mrava87/build-nodtcwt
build: disable dtcwt example and test to be able to support numpy v2 in CI and doc
2 parents 94b783f + 986d55d commit 3ec6e05

12 files changed

Lines changed: 42 additions & 57 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ docs/build
3333
docs/source/api/generated
3434
docs/source/gallery
3535
docs/source/tutorials
36+
docs/source/sg_execution_times.rst
3637

3738
# Pylint #
3839
pylint_plot.py

.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ version: 2
99
build:
1010
os: ubuntu-20.04
1111
tools:
12-
python: "3.9"
12+
python: "3.11"
1313

1414
# Build documentation in the docs/ directory with Sphinx
1515
sphinx:

docs/source/conf.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,16 @@
6060
numpydoc_class_members_toctree = False
6161

6262
sphinx_gallery_conf = {
63-
# path to your examples scripts
63+
# Path to examples scripts
6464
"examples_dirs": [
6565
"../../examples",
6666
"../../tutorials",
6767
],
68-
# path where to save gallery generated examples
68+
# Path where to save gallery generated examples
6969
"gallery_dirs": ["gallery", "tutorials"],
7070
"filename_pattern": r"\.py",
71+
# Examples to skip when building the gallery
72+
"ignore_pattern": r"plot_dtcwt\.py$",
7173
# Remove the "Download all examples" button from the top level gallery
7274
"download_all_examples": False,
7375
# Sort gallery example by file name instead of number of lines (default)

docs/source/installation.rst

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -322,10 +322,6 @@ In alphabetic order:
322322
dtcwt
323323
-----
324324

325-
.. warning::
326-
327-
``dtcwt`` is not yet supported with Numpy 2.
328-
329325
`dtcwt <https://dtcwt.readthedocs.io/en/0.12.0/>`_ is a library used to implement the DT-CWT operators.
330326

331327
Install it via ``pip`` with:
@@ -334,7 +330,9 @@ Install it via ``pip`` with:
334330
335331
>> pip install dtcwt
336332
337-
333+
.. warning::
334+
``dtcwt`` does not support NumPy 2 yet, so make sure you use NumPy 1.x
335+
to be able to use the ``DTCWT`` operator.
338336

339337
Devito
340338
------
@@ -439,6 +437,7 @@ It can also be checked dynamically with ``numba.config.NUMBA_DEFAULT_NUM_THREADS
439437

440438
PyMC and PyTensor
441439
-----------------
440+
442441
`PyTensor <https://pytensor.readthedocs.io/en/latest/>`_ is used to allow seamless integration between PyLops and
443442
`PyMC <https://www.pymc.io/welcome.html>`_ operators.
444443
Install both of them via ``conda`` with:
@@ -453,10 +452,7 @@ or via ``pip`` with
453452
454453
>> pip install pytensor pymc
455454
456-
.. note::
457-
PyTensor does not support NumPy 2 yet, so make sure you use NumPy 1.x with PyTensor and PyMC.
458-
459-
.. note::
455+
.. warning::
460456
OSX users may experience a ``CompileError`` error when using PyTensor. This can be solved by adding
461457
``pytensor.config.gcc__cxxflags = "-Wno-c++11-narrowing"`` after ``import pytensor``.
462458

environment-dev-arm.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,11 @@ channels:
33
- defaults
44
- conda-forge
55
- numba
6-
- pytorch
76
dependencies:
8-
- python>=3.9.0
7+
- python>=3.11.0
98
- pip
10-
- numpy>=1.21.0
11-
- scipy>=1.11.0
12-
- pytorch>=1.2.0
13-
- cpuonly
14-
- jax
9+
- numpy>=2.0.0
10+
- scipy>=1.13.0
1511
- pyfftw
1612
- pywavelets
1713
- sympy
@@ -28,10 +24,12 @@ dependencies:
2824
- isort
2925
- black
3026
- pip:
27+
- torch
3128
- devito
32-
- dtcwt
29+
# - dtcwt (until numpy>=2.0.0 is supported)
3330
- scikit-fmm
3431
- spgl1
32+
- jax
3533
- pytest-runner
3634
- setuptools_scm
3735
- pydata-sphinx-theme

environment-dev-gpu.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ channels:
66
dependencies:
77
- python>=3.11.0
88
- pip
9-
- numpy>=1.21.0
10-
- scipy>=1.11.0
9+
- numpy>=2.0.0
10+
- scipy>=1.13.0
1111
- cupy
1212
- sympy
1313
- matplotlib

environment-dev.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,11 @@ channels:
33
- defaults
44
- conda-forge
55
- numba
6-
- pytorch
76
dependencies:
8-
- python>=3.9.0
7+
- python>=3.11.0
98
- pip
10-
- numpy>=1.21.0
11-
- scipy>=1.11.0
12-
- pytorch>=1.2.0
13-
- cpuonly
14-
- jax
9+
- numpy>=2.0.0
10+
- scipy>=1.13.0
1511
- pyfftw
1612
- pywavelets
1713
- sympy
@@ -29,10 +25,12 @@ dependencies:
2925
- isort
3026
- black
3127
- pip:
28+
- torch
3229
- devito
33-
- dtcwt
30+
# - dtcwt (until numpy>=2.0.0 is supported)
3431
- scikit-fmm
3532
- spgl1
33+
- jax
3634
- pytest-runner
3735
- setuptools_scm
3836
- pydata-sphinx-theme

pytests/test_dtcwt.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,10 @@ def sequential_array(shape):
2222
@pytest.mark.skipif(
2323
int(os.environ.get("TEST_CUPY_PYLOPS", 0)) == 1, reason="Not CuPy enabled"
2424
)
25+
@pytest.mark.skipif(int(np_version[0]) >= 2, reason="dtcwt does not support numpy v2")
2526
@pytest.mark.parametrize("par", [(par1), (par2)])
2627
def test_dtcwt1D_input1D(par):
2728
"""Test for DTCWT with 1D input"""
28-
if int(np_version[0]) >= 2:
29-
return
3029

3130
t = sequential_array((par["ny"],))
3231

@@ -41,11 +40,10 @@ def test_dtcwt1D_input1D(par):
4140
@pytest.mark.skipif(
4241
int(os.environ.get("TEST_CUPY_PYLOPS", 0)) == 1, reason="Not CuPy enabled"
4342
)
43+
@pytest.mark.skipif(int(np_version[0]) >= 2, reason="dtcwt does not support numpy v2")
4444
@pytest.mark.parametrize("par", [(par1), (par2)])
4545
def test_dtcwt1D_input2D(par):
4646
"""Test for DTCWT with 2D input (forward-inverse pair)"""
47-
if int(np_version[0]) >= 2:
48-
return
4947

5048
t = sequential_array(
5149
(
@@ -65,11 +63,10 @@ def test_dtcwt1D_input2D(par):
6563
@pytest.mark.skipif(
6664
int(os.environ.get("TEST_CUPY_PYLOPS", 0)) == 1, reason="Not CuPy enabled"
6765
)
66+
@pytest.mark.skipif(int(np_version[0]) >= 2, reason="dtcwt does not support numpy v2")
6867
@pytest.mark.parametrize("par", [(par1), (par2)])
6968
def test_dtcwt1D_input3D(par):
7069
"""Test for DTCWT with 3D input (forward-inverse pair)"""
71-
if int(np_version[0]) >= 2:
72-
return
7370

7471
t = sequential_array((par["ny"], par["ny"], par["ny"]))
7572

@@ -84,11 +81,10 @@ def test_dtcwt1D_input3D(par):
8481
@pytest.mark.skipif(
8582
int(os.environ.get("TEST_CUPY_PYLOPS", 0)) == 1, reason="Not CuPy enabled"
8683
)
84+
@pytest.mark.skipif(int(np_version[0]) >= 2, reason="dtcwt does not support numpy v2")
8785
@pytest.mark.parametrize("par", [(par1), (par2)])
8886
def test_dtcwt1D_birot(par):
8987
"""Test for DTCWT birot (forward-inverse pair)"""
90-
if int(np_version[0]) >= 2:
91-
return
9288

9389
birots = ["antonini", "legall", "near_sym_a", "near_sym_b"]
9490

requirements-dev-gpu.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
numpy>=1.21.0
2-
scipy>=1.11.0
1+
numpy>=2.0.0
2+
scipy>=1.13.0
33
cupy-cuda12x
44
torch
55
numba

requirements-dev.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
numpy>=1.21.0
2-
scipy>=1.11.0
1+
numpy>=2.0.0
2+
scipy>=1.13.0
33
jax
44
numba
55
pyfftw
@@ -8,7 +8,7 @@ spgl1
88
scikit-fmm
99
sympy
1010
devito
11-
dtcwt
11+
# dtcwt (until numpy>=2.0.0 is supported)
1212
matplotlib
1313
ipython
1414
pytest
@@ -29,4 +29,4 @@ isort
2929
black
3030
flake8
3131
mypy
32-
pytensor
32+
pytensor>=2.28.0

0 commit comments

Comments
 (0)