From 7d648dda9d9350834c196a99beb50c4ce158df47 Mon Sep 17 00:00:00 2001 From: dvezinet Date: Thu, 5 Feb 2026 03:24:32 +0000 Subject: [PATCH 1/9] [#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 2/9] [#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 3/9] [#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 4/9] [#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 5/9] [#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 6/9] [#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 7/9] [#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 8/9] [#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 9/9] [#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",