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
2 changes: 1 addition & 1 deletion .github/workflows/python-testing-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, macos-latest] # , windows-latest due to TcK install errors
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
Expand Down
20 changes: 10 additions & 10 deletions bsplines2d/_class01_select.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ def _select_ind(
f"Provided: {ind.shape}"
)
raise Exception(msg)
# make sure R varies first
ind_tup = ind.T.nonzero()[::-1]
ind_tup = ind.nonzero()
ind_bool = ind

else:
Expand Down Expand Up @@ -197,18 +196,18 @@ def _select_ind(
ind_bool = ind_bool & cropiknots

# ind_tup is not 2d anymore
ind_tup = ind_bool.T.nonzero()[::-1] # R varies first
ind_tup = ind_bool.nonzero()
# warnings.warn("ind is not 2d anymore!")

elif ind_tup[0].shape == cropi.shape:
ind_bool = ind_bool & cropi
# ind_tup is not 2d anymore
ind_tup = ind_bool.T.nonzero()[::-1] # R varies first
ind_tup = ind_bool.nonzero()
# warnings.warn("ind is not 2d anymore!")

else:
ind_bool = ind_bool & cropi
ind_tup = ind_bool.T.nonzero()[::-1]
ind_tup = ind_bool.nonzero()
else:
ind_bool &= cropi

Expand All @@ -222,13 +221,14 @@ def _select_ind(
elif returnas is tuple:
out = ind_tup
elif returnas == 'tuple-flat':
# make sure R is varying first
out = (ind_tup[0].T.ravel(), ind_tup[1].T.ravel())
# make sure R is varying first => no!
out = (ind_tup[0].ravel(), ind_tup[1].ravel())
elif returnas is np.ndarray:
out = ind_tup[0] + ind_tup[1]*nR
# make sure R is varying first => no!
out = ind_tup[0]*nZ + ind_tup[1]
elif returnas == 'array-flat':
# make sure R is varying first
out = (ind_tup[0] + ind_tup[1]*nR).T.ravel()
# make sure R is varying first => no!
out = (ind_tup[0]*nZ + ind_tup[1]).ravel()
else:
out = ind_bool

Expand Down
7 changes: 5 additions & 2 deletions bsplines2d/_class02_bsplines_rect.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ def evaluate_spline(t, c, k, xp, nu, extrapolate, out):
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]
indices_k1d = np.unravel_index(
np.arange((k+1)**ndim),
(k+1,)*ndim,
)[0][:, None]
return scpinterp._bspl.evaluate_ndbspline(
xp[:, None],
t[None, :],
Expand Down Expand Up @@ -255,7 +258,7 @@ def ev_details(
self,
x0=None,
x1=None,
#derivatives
# derivatives
deriv=None,
# others
indbs_tf=None,
Expand Down
14 changes: 8 additions & 6 deletions bsplines2d/_class02_interpolate.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ def _check_keys(

if not (hasref and hasvect):
msg = (
f"Provided ref_key[{ii}] not a valid ref or ref vector!\n"
f"Provided ref_key[{ii}] invalid ref or ref vector!\n"
f"Provided: {rr}"
)
raise Exception(msg)
Expand Down Expand Up @@ -762,17 +762,19 @@ def _check_params_bsplines(
returnas = int

# compute validated indbs array with appropriate form
indbs_tf = coll.select_ind(
indbs_tf_new = coll.select_ind(
key=keybs,
returnas=returnas,
ind=indbs_tf,
crop=crop,
)

if isinstance(indbs_tf, tuple):
nbs = indbs_tf[0].size
if isinstance(indbs_tf_new, tuple):
nbs = indbs_tf_new[0].size
else:
nbs = indbs_tf.size
nbs = indbs_tf_new.size
else:
indbs_tf_new = indbs_tf

# ---------
# submesh
Expand All @@ -785,7 +787,7 @@ def _check_params_bsplines(
if coll.dobj[coll._which_mesh][keym]['subkey'] is None:
submesh = False

return val_out, crop, cropbs, indbs_tf, nbs, submesh
return val_out, crop, cropbs, indbs_tf_new, nbs, submesh


# ################################################################
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ keywords = [
requires-python = ">=3.8"
dependencies = [
"contourpy",
'datastock>=0.0.54',
'datastock>=0.0.55',
]


Expand Down
Loading