From 6d7983cc1086107f3b0389692b4ff7aca928e0fd Mon Sep 17 00:00:00 2001 From: dvezinet Date: Thu, 18 Sep 2025 14:43:45 +0000 Subject: [PATCH 01/14] [#141] Better debugging of sample3d func --- bsplines2d/_class01_sample3d.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/bsplines2d/_class01_sample3d.py b/bsplines2d/_class01_sample3d.py index 029cb70..f833f7c 100644 --- a/bsplines2d/_class01_sample3d.py +++ b/bsplines2d/_class01_sample3d.py @@ -370,7 +370,11 @@ def func( if debug is True: # coordinates - rr, zz, pp, dV = func_RZphi_from_ind(ind) + rr, zz, pp, dV = func_RZphi_from_ind( + indr=ind[0, :], + indz=ind[1, :], + indphi=ind[2, :], + ) # title tit = ( @@ -425,8 +429,12 @@ def func( ax1.fill(phor0, phor1, fc=(0.5, 0.5, 0.5, 0.5)) # points - ax0.plot(rr, zz, '.') - ax1.plot(rr*np.cos(pp), rr*np.sin(pp), '.') + if rr.size == 0: + msg = f"\n\t- ind.size = {ind.size}\n\t- rr.size = rr.size\n" + print(msg) + else: + ax0.plot(rr, zz, '.') + ax1.plot(rr*np.cos(pp), rr*np.sin(pp), '.') return ind[0, :], ind[1, :], ind[2, :] From 7d648dda9d9350834c196a99beb50c4ce158df47 Mon Sep 17 00:00:00 2001 From: dvezinet Date: Thu, 5 Feb 2026 03:24:32 +0000 Subject: [PATCH 02/14] [#144] Propagated --- bsplines2d/_class02_plot_as_profile2d.py | 30 ++++++++++++++++++------ bsplines2d/_class11_plot.py | 20 ++++++++++++---- 2 files changed, 39 insertions(+), 11 deletions(-) diff --git a/bsplines2d/_class02_plot_as_profile2d.py b/bsplines2d/_class02_plot_as_profile2d.py index 86f40d5..8866ff5 100644 --- a/bsplines2d/_class02_plot_as_profile2d.py +++ b/bsplines2d/_class02_plot_as_profile2d.py @@ -142,6 +142,7 @@ def plot_as_profile2d( keybs=v0['keybs'], # ref vector dref_vector=dref_vectorZ, + dref_vector_name='dref_vectorZ', ref_vector_strategy=ref_vector_strategy, uniform=uniform, # details @@ -563,16 +564,18 @@ def _get_dkey( if ndim >= 3: keyZ = coll2.get_ref_vector( ref=lr1d[0], + dref_vector_name='dref_vectorZ', **dref_vectorZ, )[3] # uniform = ds._plot_as_array._check_uniform_lin( - # k0=keyZ, ddata=coll2.ddata, + # k0=keyZ, ddata=coll2.ddata, # ) # if not uniform: - # keyZ = None + # keyZ = None if ndim == 4: keyU = coll2.get_ref_vector( ref=lr1d[1], + dref_vector_name='dref_vectorU', **dref_vectorU, )[3] @@ -580,8 +583,14 @@ def _get_dkey( 'deg': deg, 'interp': interp, 'key': kdata, - 'keyX': coll2.get_ref_vector(ref=rX)[3], - 'keyY': coll2.get_ref_vector(ref=rY)[3], + 'keyX': coll2.get_ref_vector( + ref=rX, + dref_vector_name='rX (bspline2d)', + )[3], + 'keyY': coll2.get_ref_vector( + ref=rY, + dref_vector_name='rY(bspline2d)', + )[3], 'keyZ': keyZ, 'keyU': keyU, } @@ -782,6 +791,7 @@ def _plot_submesh( keybs=None, # ref vetcor dref_vector=None, + dref_vector_name=None, ref_vector_strategy=None, uniform=None, # plot_details @@ -850,6 +860,7 @@ def _plot_submesh( keybs=keybs, collax=collax, dref_vector=dref_vector, + dref_vector_name=dref_vector_name, ref_vector_strategy=ref_vector_strategy, plot_details=plot_details, ) @@ -947,7 +958,7 @@ def _plot_submesh( if dvminmax.get('data', {}).get('min') is not None: ax.set_ylim(bottom=dvminmax['data']['min']) - if dvminmax.get('data', {}).get('min') is not None: + if dvminmax.get('data', {}).get('min') is not None: ax.set_ylim(top=dvminmax['data']['max']) return collax, dgroup @@ -961,6 +972,7 @@ def _plot_profile2d_polar_add_radial( collax=None, # ref_vector dref_vector=None, + dref_vector_name=None, ref_vector_strategy=None, # details plot_details=None, @@ -1019,7 +1031,10 @@ def _plot_profile2d_polar_add_radial( # ---- # reft - refc = [rr for rr in coll.ddata[key]['ref'] if rr in coll.ddata[kr2d]['ref']] + refc = [ + rr for rr in coll.ddata[key]['ref'] + if rr in coll.ddata[kr2d]['ref'] + ] if len(refc) == 1: refc = refc[0] else: @@ -1030,6 +1045,7 @@ def _plot_profile2d_polar_add_radial( keys=[key, kr2d], ref=refc, strategy=ref_vector_strategy, + dref_vector_name=dref_vector_name, **dref_vector, )[1:] @@ -1190,4 +1206,4 @@ def _plot_profile2d_submesh_create_axes( 'textY': {'handle': ax5}, 'textZ': {'handle': ax6}, } - return dax \ No newline at end of file + return dax diff --git a/bsplines2d/_class11_plot.py b/bsplines2d/_class11_plot.py index 084e9e4..a7e603f 100644 --- a/bsplines2d/_class11_plot.py +++ b/bsplines2d/_class11_plot.py @@ -493,12 +493,24 @@ def _plot_profiles2d_prepare( refmap = coll2.ddata[keymap]['ref'] dkeys = { 'key': keymap, - 'keyX': coll2.get_ref_vector(key0=keymap, ref=refmap[-2])[3], - 'keyY': coll2.get_ref_vector(key0=keymap, ref=refmap[-1])[3], + 'keyX': coll2.get_ref_vector( + key0=keymap, + ref=refmap[-2], + dref_vector_name=f"keymap='{keymap}' refmap[-2]='{refmap[-2]}'", + )[3], + 'keyY': coll2.get_ref_vector( + key0=keymap, + ref=refmap[-1], + dref_vector_name=f"keymap='{keymap}' refmap[-1]='{refmap[-1]}'", + )[3], 'keyZ': None, } if ndim == 3: - keyZ = coll2.get_ref_vector(key0=keymap, ref=refmap[0])[3] + keyZ = coll2.get_ref_vector( + key0=keymap, + ref=refmap[0], + dref_vector_name=f"keymap='{keymap}' refmap[0]='{refmap[0]}'", + )[3] import datastock as ds uniform = ds._plot_as_array._check_uniform_lin( k0=keyZ, ddata=coll2.ddata, @@ -898,4 +910,4 @@ def _plot_profile2d_polar_create_axes( 'textY': {'handle': ax5, 'type': 'text'}, 'textZ': {'handle': ax6, 'type': 'text'}, } - return dax \ No newline at end of file + return dax From b73786755cee908e0e1a764f7d1f86404e1f7233 Mon Sep 17 00:00:00 2001 From: dvezinet Date: Thu, 5 Feb 2026 14:22:16 +0000 Subject: [PATCH 03/14] [#144] Minor cleanup --- bsplines2d/_class02_interpolate.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/bsplines2d/_class02_interpolate.py b/bsplines2d/_class02_interpolate.py index d90eec6..d841183 100644 --- a/bsplines2d/_class02_interpolate.py +++ b/bsplines2d/_class02_interpolate.py @@ -227,6 +227,7 @@ def interpolate( coll=coll, kd0=kd0, keys=keys, + refbs=coll.dobj[wbs][kbs0]['ref'], ref_com=ref_com, # coordinates x0=x0, @@ -800,6 +801,7 @@ def _submesh_ref_com( coll=None, kd0=None, keys=None, + refbs=None, ref_com=None, # coordinates x0=None, @@ -809,23 +811,21 @@ def _submesh_ref_com( # find possible matches ref0 = coll.ddata[kd0[0]]['ref'] - lrcom = [ - (rr, ref0.index(rr)) - for ii, rr in enumerate(ref0) - if rr in list(itt.chain.from_iterable([ - coll.ddata[kk]['ref'] for kk in keys - ])) - and ii in [0, len(ref0) - 1] - ] + lref = list(set([ + rr for kk in keys + for rr in coll.ddata[kk]['ref'] + if rr not in refbs + and rr in ref0 + ])) # ---------- # unused options if ref_com is None: - if len(lrcom) > 0: + if len(lref) > 0: msg = ( f"\nPossible common ref for data {keys} and subkey '{kd0}':\n" - + "\n".join([f"\t- {rr}" for rr in lrcom]) + + "\n".join([f"\t- {rr}" for rr in lref]) + "\nIf you wish to use one, specify with ref_com=..." ) warnings.warn(msg) @@ -834,11 +834,10 @@ def _submesh_ref_com( # -------------- # if ref_com - lok = [rr[0] for rr in lrcom] ref_com = ds._generic_check._check_var( ref_com, 'ref_com', types=str, - allowed=lok, + allowed=lref, ) # ----------- From 751ba659b4c7c1dc76cfde00ad8c83f2a980addd Mon Sep 17 00:00:00 2001 From: dvezinet Date: Thu, 5 Feb 2026 16:48:38 +0000 Subject: [PATCH 04/14] [#144] Updated for datastock >= 0.0.56 --- pyproject.toml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5fed50a..42d980b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,10 +38,11 @@ maintainers = [ keywords = [ "data", "analysis", "interactive", "bsplines", "Collection", "mesh", ] -requires-python = ">=3.8" +# for datastock >= 0.0.56 + end of life of 3.9 +requires-python = ">=3.10" dependencies = [ "contourpy", - 'datastock>=0.0.55', + 'datastock>=0.0.56', ] From 44b537eb959565e252e82a08b5d9e02d1f73df4c Mon Sep 17 00:00:00 2001 From: dvezinet Date: Thu, 5 Feb 2026 16:53:12 +0000 Subject: [PATCH 05/14] [#144] python >= 3.10 in GA --- .github/workflows/python-publish-wheel.yml | 2 +- .github/workflows/python-testing-matrix.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-publish-wheel.yml b/.github/workflows/python-publish-wheel.yml index 7e5c882..a175790 100644 --- a/.github/workflows/python-publish-wheel.yml +++ b/.github/workflows/python-publish-wheel.yml @@ -24,7 +24,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/python-testing-matrix.yml b/.github/workflows/python-testing-matrix.yml index 89a1609..9d6edca 100644 --- a/.github/workflows/python-testing-matrix.yml +++ b/.github/workflows/python-testing-matrix.yml @@ -18,7 +18,7 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest, macos-latest] # , windows-latest due to TcK install errors - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] steps: From 5de97ae8fa42695de9030b34699ef973d212b258 Mon Sep 17 00:00:00 2001 From: dvezinet Date: Thu, 5 Feb 2026 17:08:59 +0000 Subject: [PATCH 06/14] [#144] Bounding scipy < 1.16.0 --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 42d980b..aa9de2e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,6 +41,7 @@ keywords = [ # for datastock >= 0.0.56 + end of life of 3.9 requires-python = ">=3.10" dependencies = [ + "scipy<1.16.0", # until https://github.com/ToFuProject/bsplines2d/issues/126 solved "contourpy", 'datastock>=0.0.56', ] From 793cb2cf8c9290fbf92f01eadcaf64b9bff9fb25 Mon Sep 17 00:00:00 2001 From: dvezinet Date: Thu, 5 Feb 2026 17:30:52 +0000 Subject: [PATCH 07/14] [#144] Fixed np.in1d() <-> np.isin( --- bsplines2d/_class01_checks_2d_tri.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/bsplines2d/_class01_checks_2d_tri.py b/bsplines2d/_class01_checks_2d_tri.py index b92c584..f0dfb8f 100644 --- a/bsplines2d/_class01_checks_2d_tri.py +++ b/bsplines2d/_class01_checks_2d_tri.py @@ -160,7 +160,6 @@ def check( subbs = subbs0 submesh = submesh0 - # -------------- # to dict @@ -312,7 +311,7 @@ def _check_knotscents( assert isinstance(out, np.ndarray) except Exception as err: msg = str(err) + ( - "\nArg trifind must return an array of indices when fed with arrays " + "\nArg trifind must return an array of indices when fed an arrays " "of (R, Z) coordinates!\n" f"\ttrifind(np.r_[0], np.r_[0.]) = {out}\n" f"\t- ntri = {ntri}\n" @@ -406,7 +405,7 @@ def _mesh2DTri_conformity(knots=None, indices=None, key=None): c0 = np.all(indu >= 0) and indu.size == nknots # unused knots - ino = (~np.in1d( + ino = (~np.isin( range(0, nknots), indu, assume_unique=False, @@ -448,7 +447,7 @@ def _remove_unused_knots(knots, indices, keep): indu = np.unique(indices[keep, :]) # cumulated differences in indices - keep_pts = np.in1d(np.arange(knots.shape[0]), indu) + keep_pts = np.isin(np.arange(knots.shape[0]), indu) icum = np.cumsum(~keep_pts) # update @@ -631,4 +630,4 @@ def _to_dict( if k0 not in latt: dobj[coll._which_mesh][key][k0] = v0 - return dref, ddata, dobj \ No newline at end of file + return dref, ddata, dobj From d972b19903fa300dd6f46bbac3cd52e1d36c8284 Mon Sep 17 00:00:00 2001 From: dvezinet Date: Thu, 5 Feb 2026 20:27:13 +0000 Subject: [PATCH 08/14] [#144] --no-build --- .github/workflows/python-testing-matrix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-testing-matrix.yml b/.github/workflows/python-testing-matrix.yml index 9d6edca..4a5e958 100644 --- a/.github/workflows/python-testing-matrix.yml +++ b/.github/workflows/python-testing-matrix.yml @@ -33,7 +33,7 @@ jobs: # Install library - name: Install the project - run: uv sync --all-extras --dev + run: uv sync --all-extras --dev --no-build # Run tests - name: Run tests From 1cb8365fa46e5f4918e0eab8a8fcbf704a738c61 Mon Sep 17 00:00:00 2001 From: dvezinet Date: Thu, 5 Feb 2026 20:32:56 +0000 Subject: [PATCH 09/14] [#144] --no-build-package scipy --- .github/workflows/python-testing-matrix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-testing-matrix.yml b/.github/workflows/python-testing-matrix.yml index 4a5e958..1e7de41 100644 --- a/.github/workflows/python-testing-matrix.yml +++ b/.github/workflows/python-testing-matrix.yml @@ -33,7 +33,7 @@ jobs: # Install library - name: Install the project - run: uv sync --all-extras --dev --no-build + run: uv sync --all-extras --dev --no-build-package scipy # Run tests - name: Run tests From 34ec7cf001a2671aa3955f36ddb25e6b7640c1de Mon Sep 17 00:00:00 2001 From: dvezinet Date: Thu, 5 Feb 2026 20:37:35 +0000 Subject: [PATCH 10/14] [#144] Build issue was caused by python 3.14 vs scipy <= 1.16.0 --- .github/workflows/python-publish-wheel.yml | 2 +- .github/workflows/python-testing-matrix.yml | 3 ++- pyproject.toml | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-publish-wheel.yml b/.github/workflows/python-publish-wheel.yml index a175790..b62cf73 100644 --- a/.github/workflows/python-publish-wheel.yml +++ b/.github/workflows/python-publish-wheel.yml @@ -24,7 +24,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] + python-version: ["3.10", "3.11", "3.12", "3.13"] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/python-testing-matrix.yml b/.github/workflows/python-testing-matrix.yml index 1e7de41..881c1ba 100644 --- a/.github/workflows/python-testing-matrix.yml +++ b/.github/workflows/python-testing-matrix.yml @@ -18,7 +18,8 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest, macos-latest] # , windows-latest due to TcK install errors - python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] + # scipy 1.15.3 and 1.16.0 have no wheel for python 3.14 + python-version: ["3.10", "3.11", "3.12", "3.13"] steps: diff --git a/pyproject.toml b/pyproject.toml index aa9de2e..bfafe48 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,8 @@ keywords = [ "data", "analysis", "interactive", "bsplines", "Collection", "mesh", ] # for datastock >= 0.0.56 + end of life of 3.9 -requires-python = ">=3.10" +# scipy 1.15.3 and 1.16.0 have no wheel for python 3.14 +requires-python = ">=3.10,<3.14" dependencies = [ "scipy<1.16.0", # until https://github.com/ToFuProject/bsplines2d/issues/126 solved "contourpy", From f67c3b5f77ab20fbaa46f70153151654a29a3ed6 Mon Sep 17 00:00:00 2001 From: dvezinet Date: Thu, 5 Feb 2026 22:43:11 +0000 Subject: [PATCH 11/14] [#126] Attempt at fixing evaluate_spline for scipy >= 1.16.0 --- bsplines2d/_class02_bsplines_rect.py | 86 ++++++++++++++++++---------- 1 file changed, 55 insertions(+), 31 deletions(-) diff --git a/bsplines2d/_class02_bsplines_rect.py b/bsplines2d/_class02_bsplines_rect.py index 3b32c09..13f07b7 100644 --- a/bsplines2d/_class02_bsplines_rect.py +++ b/bsplines2d/_class02_bsplines_rect.py @@ -8,6 +8,7 @@ # Common import numpy as np +import scipy as scp import scipy.interpolate as scpinterp @@ -16,41 +17,64 @@ from . import _class02_bsplines_operators_rect -if hasattr(scpinterp._bspl, 'evaluate_spline'): - evaluate_spline = scpinterp._bspl.evaluate_spline +if hasattr(scpinterp, '_bspl'): -else: - msg = ( - "\n\n" - "bsplines2d using a new version of scipy" - " with no scpinterp._bspl.evaluate_spline()\n" - "Instead using scpinterp._bspl.evaluate_ndspline()\n" - "Prototypal and not thoroughly tested!\n" - ) - warnings.warn(msg) + if hasattr(scpinterp._bspl, 'evaluate_spline'): + evaluate_spline = scpinterp._bspl.evaluate_spline + + else: + msg = ( + "\n\n" + "bsplines2d using a new version of scipy" + " with no scpinterp._bspl.evaluate_spline()\n" + "Instead using scpinterp._bspl.evaluate_ndspline()\n" + "Prototypal and not thoroughly tested!\n" + ) + warnings.warn(msg) + + def evaluate_spline(t, c, k, xp, nu, extrapolate, out): + ndim = 1 + c1 = c.reshape(c.shape[:ndim] + (-1,)) + num_c_tr = c1.shape[-1] + strides_c1 = [stride // c.dtype.itemsize for stride in c.strides] + indices_k1d = np.unravel_index( + np.arange((k+1)**ndim), + (k+1,)*ndim, + )[0][:, None] + return scpinterp._bspl.evaluate_ndbspline( + xp[:, None], + t[None, :], + np.array([t.size], dtype=np.int32), + np.array([k], dtype=np.int32), + np.array([nu], dtype=np.int32), + extrapolate, + c.ravel(), + num_c_tr, + np.array(strides_c1, dtype=np.intp), + indices_k1d, + out, + ) + +# Should work for scipy >= 1.16.0 +elif ( + hasattr(scpinterp, '_bsplines') + and hasattr(scpinterp._bsplines, '_dierckx') + and hasattr(scpinterp._bsplines._dierckx, 'evaluate_spline') +): def evaluate_spline(t, c, k, xp, nu, extrapolate, out): - ndim = 1 - c1 = c.reshape(c.shape[:ndim] + (-1,)) - num_c_tr = c1.shape[-1] - strides_c1 = [stride // c.dtype.itemsize for stride in c.strides] - indices_k1d = np.unravel_index( - np.arange((k+1)**ndim), - (k+1,)*ndim, - )[0][:, None] - return scpinterp._bspl.evaluate_ndbspline( - xp[:, None], - t[None, :], - np.array([t.size], dtype=np.int32), - np.array([k], dtype=np.int32), - np.array([nu], dtype=np.int32), - extrapolate, - c.ravel(), - num_c_tr, - np.array(strides_c1, dtype=np.intp), - indices_k1d, - out, + out[:, 0] = scpinterp._bsplines._dierckx.evaluate_spline( + t, # 1d contiguous array of floats + c, # 2d contiguous array of floats + k, # int + nu, # int + extrapolate, # bool ) + return + +else: + msg = f"scipy {scp.__version__} has no evaluate_spline" + raise Exception(msg) # ################################################################ From 7f7086571e6bc6e00e8aee17102b63a9c2917ba3 Mon Sep 17 00:00:00 2001 From: dvezinet Date: Fri, 6 Feb 2026 16:29:29 +0000 Subject: [PATCH 12/14] [#126] fixed for scipy 1.14.0 to 1.17.0 --- bsplines2d/_class02_bsplines_rect.py | 38 +++++++++++++++------------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/bsplines2d/_class02_bsplines_rect.py b/bsplines2d/_class02_bsplines_rect.py index 13f07b7..222ba5f 100644 --- a/bsplines2d/_class02_bsplines_rect.py +++ b/bsplines2d/_class02_bsplines_rect.py @@ -17,7 +17,26 @@ from . import _class02_bsplines_operators_rect -if hasattr(scpinterp, '_bspl'): +# Should work for scipy >= 1.15.0 +# see https://github.com/ToFuProject/bsplines2d/pull/147 +if ( + hasattr(scpinterp, '_bsplines') + and hasattr(scpinterp._bsplines, '_dierckx') + and hasattr(scpinterp._bsplines._dierckx, 'evaluate_spline') +): + + def evaluate_spline(t, c, k, xp, nu, extrapolate, out): + out[...] = scpinterp._bsplines._dierckx.evaluate_spline( + t, # 1d contiguous array of floats + c, # 2d contiguous array of floats + k, # int + xp, # 1d contiguous array of floats + nu, # int + extrapolate, # bool + ) + return + +elif hasattr(scpinterp, '_bspl'): if hasattr(scpinterp._bspl, 'evaluate_spline'): evaluate_spline = scpinterp._bspl.evaluate_spline @@ -55,23 +74,6 @@ def evaluate_spline(t, c, k, xp, nu, extrapolate, out): out, ) -# Should work for scipy >= 1.16.0 -elif ( - hasattr(scpinterp, '_bsplines') - and hasattr(scpinterp._bsplines, '_dierckx') - and hasattr(scpinterp._bsplines._dierckx, 'evaluate_spline') -): - - def evaluate_spline(t, c, k, xp, nu, extrapolate, out): - out[:, 0] = scpinterp._bsplines._dierckx.evaluate_spline( - t, # 1d contiguous array of floats - c, # 2d contiguous array of floats - k, # int - nu, # int - extrapolate, # bool - ) - return - else: msg = f"scipy {scp.__version__} has no evaluate_spline" raise Exception(msg) From c053efd2c0450a04779229e80afefba073396871 Mon Sep 17 00:00:00 2001 From: dvezinet Date: Fri, 6 Feb 2026 16:30:52 +0000 Subject: [PATCH 13/14] [#126] relaxed constraint on scipy --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index bfafe48..adce479 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,7 +42,7 @@ keywords = [ # scipy 1.15.3 and 1.16.0 have no wheel for python 3.14 requires-python = ">=3.10,<3.14" dependencies = [ - "scipy<1.16.0", # until https://github.com/ToFuProject/bsplines2d/issues/126 solved + "scipy", # see https://github.com/ToFuProject/bsplines2d/pull/147 "contourpy", 'datastock>=0.0.56', ] From cb6c723c06b8a6fb36edd5f326dd081d8499f346 Mon Sep 17 00:00:00 2001 From: dvezinet Date: Fri, 6 Feb 2026 17:01:03 +0000 Subject: [PATCH 14/14] [#126] Fixed scipy 1.15.X vs 1.16.X --- bsplines2d/_class02_bsplines_rect.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/bsplines2d/_class02_bsplines_rect.py b/bsplines2d/_class02_bsplines_rect.py index 222ba5f..d13d478 100644 --- a/bsplines2d/_class02_bsplines_rect.py +++ b/bsplines2d/_class02_bsplines_rect.py @@ -25,16 +25,19 @@ and hasattr(scpinterp._bsplines._dierckx, 'evaluate_spline') ): - def evaluate_spline(t, c, k, xp, nu, extrapolate, out): - out[...] = scpinterp._bsplines._dierckx.evaluate_spline( - t, # 1d contiguous array of floats - c, # 2d contiguous array of floats - k, # int - xp, # 1d contiguous array of floats - nu, # int - extrapolate, # bool - ) - return + if scp.__version__.startswith('1.15'): + evaluate_spline = scpinterp._bsplines._dierckx.evaluate_spline + else: + def evaluate_spline(t, c, k, xp, nu, extrapolate, out): + out[...] = scpinterp._bsplines._dierckx.evaluate_spline( + t, # 1d contiguous array of floats + c, # 2d contiguous array of floats + k, # int + xp, # 1d contiguous array of floats + nu, # int + extrapolate, # bool + ) + return elif hasattr(scpinterp, '_bspl'):