Skip to content

Commit 815e903

Browse files
committed
Merge branch 'main' into 1.0.0_alpha
2 parents 1d9e9c9 + 82d40ff commit 815e903

17 files changed

Lines changed: 321 additions & 129 deletions

.ci/azure/setup_env.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ set -ex #echo on and exit if any line fails
44
# TF_BUILD is set to True on azure pipelines.
55
is_azure=$(echo "${TF_BUILD:-false}" | tr '[:upper:]' '[:lower:]')
66
do_doc=$(echo "${DOC_BUILD:-false}" | tr '[:upper:]' '[:lower:]')
7+
is_free_threaded=$(echo "${PYTHON_FREETHREADING:-false}" | tr '[:upper:]' '[:lower:]')
78

89
if ${is_azure}
910
then
@@ -13,8 +14,14 @@ then
1314
fi
1415
fi
1516

16-
cp .ci/environment_test.yml environment_test_with_pyversion.yml
17-
echo " - python="$PYTHON_VERSION >> environment_test_with_pyversion.yml
17+
if ${is_free_threaded}
18+
then
19+
cp .ci/environment_test_bare.yml environment_test_with_pyversion.yml
20+
echo " - python-freethreading="$PYTHON_VERSION >> environment_test_with_pyversion.yml
21+
else
22+
cp .ci/environment_test.yml environment_test_with_pyversion.yml
23+
echo " - python="$PYTHON_VERSION >> environment_test_with_pyversion.yml
24+
fi
1825

1926
conda env create --file environment_test_with_pyversion.yml
2027
rm environment_test_with_pyversion.yml

.ci/azure/test.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,21 @@ jobs:
55
linux-Python310:
66
image: ubuntu-latest
77
python.version: '3.10'
8-
coverage: True
98
linux-Python311:
109
image: ubuntu-latest
1110
python.version: '3.11'
11+
coverage: True
1212
linux-Python312:
1313
image: ubuntu-latest
1414
python.version: '3.12'
1515
linux-Python313:
1616
image: ubuntu-latest
1717
python.version: '3.13'
18+
linux-Python313t:
19+
image: ubuntu-latest
20+
python.version: '3.13'
21+
python.freethreading: True
22+
coverage: True
1823
osx-Python310:
1924
image: macOS-latest
2025
python.version: '3.10'
@@ -27,6 +32,10 @@ jobs:
2732
osx-Python313:
2833
image: macOS-latest
2934
python.version: '3.13'
35+
osx-Python313t:
36+
image: macOS-latest
37+
python.version: '3.13'
38+
python.freethreading: True
3039
win-Python310:
3140
image: windows-latest
3241
python.version: '3.10'
@@ -39,6 +48,10 @@ jobs:
3948
win-Python313:
4049
image: windows-latest
4150
python.version: '3.13'
51+
win-Python313t:
52+
image: windows-latest
53+
python.version: '3.13'
54+
python.freethreading: True
4255
displayName: "${{ variables.image }} ${{ variables.python.version }}"
4356
pool:
4457
vmImage: $(image)

.ci/environment_test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ dependencies:
1212
- matplotlib
1313

1414
# documentation
15-
- sphinx
16-
- pydata-sphinx-theme==0.15.4
17-
- sphinx-gallery>=0.1.13
18-
- numpydoc>=1.5
15+
- sphinx==8.1.3
16+
- pydata-sphinx-theme==0.16.1
17+
- sphinx-gallery==0.19.0
18+
- numpydoc==1.9.0
1919
- jupyter
2020
- graphviz
2121
- pillow
@@ -31,5 +31,5 @@ dependencies:
3131
- meson-python>=0.14.0
3232
- meson
3333
- ninja
34-
- cython>=0.29.35
34+
- cython>=3.1.0
3535
- setuptools_scm

.ci/environment_test_bare.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: discretize-test
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- numpy>=1.22.4
6+
- scipy>=1.8
7+
8+
# testing
9+
- sympy
10+
- pytest
11+
- pytest-cov
12+
13+
# Building
14+
- pip
15+
- meson-python>=0.14.0
16+
- meson
17+
- ninja
18+
- cython>=3.1.0
19+
- setuptools_scm

discretize/_extensions/interputils_cython.pyx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# cython: embedsignature=True, language_level=3
22
# cython: linetrace=True
3+
# cython: freethreading_compatible = True
34
import numpy as np
45
import cython
56
cimport numpy as np

discretize/_extensions/simplex_helpers.pyx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# distutils: language=c++
22
# cython: embedsignature=True, language_level=3
33
# cython: linetrace=True
4+
# cython: freethreading_compatible = True
45

56
from libcpp.pair cimport pair
67
from libcpp.unordered_map cimport unordered_map

discretize/_extensions/tree.pxd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,10 @@ cdef extern from "tree.h":
6868
inline Node* max_node()
6969
double operator[](int_t)
7070

71+
ctypedef int (*eval_func_ptr)(void*, Cell*)
7172
cdef cppclass PyWrapper:
7273
PyWrapper()
73-
void set(void*, int(*)(void*, Cell*))
74+
void set(void*, eval_func_ptr eval)
7475

7576
cdef cppclass Tree:
7677
int_t n_dim

0 commit comments

Comments
 (0)