Skip to content

Commit a198719

Browse files
Fix: Add py314, zip(required=true) for most
1 parent fa7a744 commit a198719

33 files changed

Lines changed: 206 additions & 149 deletions

.github/workflows/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
strategy:
1111
matrix:
1212
arch: [x86_64]
13-
cw_build: ["cp39-*", "cp310-*", "cp311-*", "cp312-*", "cp313-*"]
13+
cw_build: ["cp310-*", "cp311-*", "cp312-*", "cp313-*", "cp314-*"]
1414

1515
steps:
1616
- uses: actions/checkout@v4
@@ -35,7 +35,7 @@ jobs:
3535
strategy:
3636
matrix:
3737
arch: [arm64]
38-
cw_build: ["cp39-*", "cp310-*", "cp311-*", "cp312-*", "cp313-*"]
38+
cw_build: ["cp310-*", "cp311-*", "cp312-*", "cp313-*", "cp314-*"]
3939

4040
steps:
4141
- uses: actions/checkout@v4
@@ -60,7 +60,7 @@ jobs:
6060
strategy:
6161
matrix:
6262
arch: [x86_64]
63-
cw_build: ["cp39*many*", "cp310*many*", "cp311*many*", "cp312*many*", "cp313*many*"]
63+
cw_build: ["cp310*many*", "cp311*many*", "cp312*many*", "cp313*many*", "cp314*many*"]
6464

6565
steps:
6666
- uses: actions/checkout@v4
@@ -85,7 +85,7 @@ jobs:
8585
strategy:
8686
matrix:
8787
arch: [AMD64]
88-
cw_build: ["cp39-*", "cp310-*", "cp311-*", "cp312-*", "cp313-*"]
88+
cw_build: ["cp310-*", "cp311-*", "cp312-*", "cp313-*", "cp314-*"]
8989

9090
steps:
9191
- uses: actions/checkout@v4

.github/workflows/test_full.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
SPLINEPY_GITHUB_ACTIONS_BUILD: True
1919
strategy:
2020
matrix:
21-
python-version: [3.9, "3.10", "3.11", "3.12", "3.13"]
21+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
2222
os: [ubuntu-latest, macos-latest, windows-latest]
2323

2424
steps:

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ repos:
2424
- id: check-yaml
2525
- id: debug-statements
2626
- id: end-of-file-fixer
27+
exclude: '^tests/data/.*$'
2728
- id: mixed-line-ending
2829
- id: requirements-txt-fixer
2930
- id: trailing-whitespace

docs/source/handle_markdown.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import pathlib
1717
import re
1818
import warnings
19-
from typing import List, Tuple
2019

2120
# Path to this file.
2221
file_path = os.path.abspath(os.path.dirname(__file__))
@@ -38,7 +37,7 @@ def get_markdown_links(line: str) -> str:
3837
return possible or ""
3938

4039

41-
def get_special_links(line: str) -> List[Tuple[str, str]]:
40+
def get_special_links(line: str) -> list[tuple[str, str]]:
4241
"""Get the special links from a string.
4342
4443
Args:

examples/show_readme.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
para_queries = []
9898
phys_queries = []
9999
colors = ["red", "yellow", "blue"]
100-
for q, pc, c in zip(queries, physical_coordinates, colors):
100+
for q, pc, c in zip(queries, physical_coordinates, colors, strict=False):
101101
para_q, phys_q = gus.Vertices([q]), gus.Vertices([pc])
102102
para_q.show_options["c"] = c
103103
para_q.show_options["r"] = 10

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ classifiers=[
1515
"Development Status :: 4 - Beta",
1616
"License :: OSI Approved :: MIT License",
1717
"Programming Language :: Python",
18-
"Programming Language :: Python :: 3.9",
1918
"Programming Language :: Python :: 3.10",
2019
"Programming Language :: Python :: 3.11",
2120
"Programming Language :: Python :: 3.12",
2221
"Programming Language :: Python :: 3.13",
22+
"Programming Language :: Python :: 3.14",
2323
"Natural Language :: English",
2424
"Topic :: Scientific/Engineering",
2525
]
@@ -91,7 +91,7 @@ lint.select = [
9191
"A", # flake8-builtins
9292
]
9393
lint.fixable = ["ALL"]
94-
target-version = "py38"
94+
target-version = "py312"
9595
lint.ignore = [
9696
"PLR2004", # TODO!
9797
"PLR0912", # Too many branches

splinepy/bspline.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,7 @@ def insert_knots(self, parametric_dimension, knots):
108108

109109
if min(knots) < min(self.knot_vectors[parametric_dimension]):
110110
raise ValueError(
111-
"One of the query knots not in valid knot range. "
112-
"(Too small)"
111+
"One of the query knots not in valid knot range. (Too small)"
113112
)
114113

115114
inserted = _splinepy_core.insert_knots(
@@ -171,7 +170,7 @@ def determine_new_knots(kv_unique, n_knots):
171170
return new_knots
172171

173172
# determine new knots for each para_dim and insert the knots
174-
for para_dim, n_k in zip(para_dims, n_knots):
173+
for para_dim, n_k in zip(para_dims, n_knots, strict=True):
175174
new_knots = determine_new_knots(
176175
# recompute unique to allow duplicating para_dims.
177176
kv_unique=self.unique_knots[para_dim],
@@ -303,8 +302,7 @@ def remove_knots(self, parametric_dimension, knots, tolerance=None):
303302

304303
if min(knots) < min(self.knot_vectors[parametric_dimension]):
305304
raise ValueError(
306-
"One of the query knots not in valid knot range. "
307-
"(Too small)"
305+
"One of the query knots not in valid knot range. (Too small)"
308306
)
309307

310308
removed = _splinepy_core.remove_knots(

splinepy/helpme/check.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ def valid_queries(spline, queries):
3838
error_query = _np.argmin(queries, axis=0)[error_dim]
3939
raise ValueError(
4040
f"Query request out of bounds in parametric dimension "
41-
f"{error_dim}. Detected query {queries[error_query,:]} at "
41+
f"{error_dim}. Detected query {queries[error_query, :]} at "
4242
f"positions {error_query}, which is out of bounds with "
43-
f"minimum values {bounds[0,:]}."
43+
f"minimum values {bounds[0, :]}."
4444
)
4545

4646
# Check maximum value
@@ -50,9 +50,9 @@ def valid_queries(spline, queries):
5050
error_query = _np.argmax(queries, axis=0)[error_dim]
5151
raise ValueError(
5252
f"Query request out of bounds in parametric dimension "
53-
f"{error_dim}. Detected query {queries[error_query,:]} at "
53+
f"{error_dim}. Detected query {queries[error_query, :]} at "
5454
f"positions {error_query}, which is out of bounds with "
55-
f"maximum values {bounds[1,:]}."
55+
f"maximum values {bounds[1, :]}."
5656
)
5757
return True
5858

@@ -78,7 +78,7 @@ def clamped_knot_vectors(spline, warning=True):
7878
if degrees is None or knot_vectors is None:
7979
return None
8080

81-
for d, kv in zip(degrees, knot_vectors):
81+
for d, kv in zip(degrees, knot_vectors, strict=True):
8282
kv_arr = _np.asanyarray(kv)
8383

8484
front = all(abs(kv_arr[: (d + 1)] - kv_arr[0]) < _settings.TOLERANCE)

splinepy/helpme/create.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,7 @@ def extruded(spline, extrusion_vector=None):
106106
)
107107
else:
108108
raise ValueError(
109-
"Dimension Mismatch between extrusion extrusion vector "
110-
"and spline."
109+
"Dimension Mismatch between extrusion extrusion vector and spline."
111110
)
112111

113112
# Start Extrusion
@@ -222,7 +221,7 @@ def revolved(
222221
# rotation-matrix is only implemented for 2D and 3D problems
223222
if cps.shape[1] not in {2, 3}:
224223
raise NotImplementedError(
225-
"Sorry," "revolutions only implemented for 2D and 3D splines"
224+
"Sorry,revolutions only implemented for 2D and 3D splines"
226225
)
227226

228227
# Angle must be (0, pi) non including
@@ -406,6 +405,7 @@ def determinant_spline(spline):
406405
spline.unique_knots,
407406
spline.knot_multiplicities,
408407
multiplicity_increase,
408+
strict=True,
409409
):
410410
# increase knot multiplicities:
411411
# @ each inner knot -> mult_inc + 1
@@ -420,7 +420,9 @@ def determinant_spline(spline):
420420
[
421421
len(kvs_ds) - d_ds - 1
422422
for kvs_ds, d_ds in zip(
423-
knot_vectors_determinant_spline, degrees_determinant_spline
423+
knot_vectors_determinant_spline,
424+
degrees_determinant_spline,
425+
strict=True,
424426
)
425427
]
426428
)
@@ -506,7 +508,7 @@ def parametric_view(spline, axes=True, conform=False):
506508
# process knots to insert
507509
if spline.has_knot_vectors:
508510
for i, (kv, d) in enumerate(
509-
zip(spline.knot_vectors, spline.degrees)
511+
zip(spline.knot_vectors, spline.degrees, strict=True)
510512
):
511513
n_repeating = int(d + 1)
512514
query = kv[n_repeating:-n_repeating]

splinepy/io/gismo.py

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ def add_assembly_options(
270270
children_list = []
271271

272272
for label, description, value, number_type in zip(
273-
labels, descriptions, values, number_types
273+
labels, descriptions, values, number_types, strict=True
274274
):
275275
children_list.append(
276276
{
@@ -644,7 +644,9 @@ def export(
644644
boundary_data.text = "\n".join(
645645
[
646646
str(patch_id + index_offset) + " " + str(local_face_id + 1)
647-
for (patch_id, local_face_id) in zip(*face_id_list)
647+
for (patch_id, local_face_id) in zip(
648+
*face_id_list, strict=True
649+
)
648650
]
649651
)
650652
else:
@@ -657,7 +659,9 @@ def export(
657659
boundary_data.text = "\n".join(
658660
[
659661
str(sid + index_offset) + " " + str(bid + 1)
660-
for (sid, bid) in zip(boundary_spline, boundary_face)
662+
for (sid, bid) in zip(
663+
boundary_spline, boundary_face, strict=True
664+
)
661665
]
662666
)
663667
###
@@ -685,7 +689,9 @@ def export(
685689
bc.text = "\n".join(
686690
[
687691
str(sid) + " " + str(bid + 1)
688-
for (sid, bid) in zip(bc_data_i[0], bc_data_i[1])
692+
for (sid, bid) in zip(
693+
bc_data_i[0], bc_data_i[1], strict=True
694+
)
689695
]
690696
)
691697

@@ -704,9 +710,9 @@ def export(
704710
as_base64=as_base64,
705711
field_mask=field_mask,
706712
)
707-
field_xml.find("MultiPatch").find("patches").text = (
708-
f"{index_offset} " f"{n_patches - 1 + index_offset}"
709-
)
713+
field_xml.find("MultiPatch").find(
714+
"patches"
715+
).text = f"{index_offset} {n_patches - 1 + index_offset}"
710716
if int(_python_version.split(".")[1]) >= 9 and indent:
711717
_ET.indent(field_xml)
712718
file_content = _ET.tostring(field_xml)
@@ -723,7 +729,7 @@ def export(
723729
if n_patches != len(multipatch.patches):
724730
raise RuntimeError("Help - some patches were not recognised")
725731

726-
patch_range.text = f"{index_offset} " f"{n_patches - 1 + index_offset}"
732+
patch_range.text = f"{index_offset} {n_patches - 1 + index_offset}"
727733

728734
# Add additional options to the xml file
729735
if additional_blocks is not None:
@@ -976,12 +982,11 @@ def make_dictionary(ETelement):
976982
list_of_options.append(make_dictionary(child))
977983
else:
978984
_debug(
979-
f"Found unsupported keyword {child.tag}, which will be"
980-
" ignored"
985+
f"Found unsupported keyword {child.tag}, which will be ignored"
981986
)
982987
continue
983988

984-
_debug(f"Found a total of {len(list_of_splines)} " f"BSplines and NURBS")
989+
_debug(f"Found a total of {len(list_of_splines)} BSplines and NURBS")
985990
multipatch = _Multipatch(list_of_splines)
986991
if interface_array is not None:
987992
if invalid_integer in interface_array:

0 commit comments

Comments
 (0)