6
6
from pathlib import Path
7
7
import subprocess
8
8
from typing import TYPE_CHECKING
9
- from typing import Optional
10
9
11
10
import gmsh
12
11
import numpy as np
@@ -157,7 +156,7 @@ def delaunay_3d(
157
156
if isinstance (target_sizes , float ):
158
157
target_sizes = [target_sizes ] * edge_source .number_of_points
159
158
160
- for i , (point , target_size ) in enumerate (zip (points , target_sizes )):
159
+ for i , (point , target_size ) in enumerate (zip (points , target_sizes , strict = False )):
161
160
id_ = i + 1
162
161
gmsh .model .geo .add_point (point [0 ], point [1 ], point [2 ], target_size , id_ )
163
162
@@ -246,11 +245,11 @@ def frontal_delaunay_2d( # noqa: C901, PLR0912
246
245
if isinstance (target_sizes , float ):
247
246
target_sizes = [target_sizes ] * (len (edge_source .interiors ) + 1 )
248
247
249
- for target_size , linearring in zip (target_sizes , [edge_source .exterior , * list (edge_source .interiors )]):
248
+ for target_size , linearring in zip (target_sizes , [edge_source .exterior , * list (edge_source .interiors )], strict = False ):
250
249
sizes = [target_size ] * (len (linearring .coords ) - 1 ) if isinstance (target_size , float ) else target_size
251
250
coords = linearring .coords [:- 1 ].copy ()
252
251
tags = []
253
- for size , coord in zip (sizes , coords ):
252
+ for size , coord in zip (sizes , coords , strict = False ):
254
253
x , y , z = coord
255
254
tags .append (gmsh .model .geo .add_point (x , y , z , size ))
256
255
curve_tags = []
@@ -269,7 +268,7 @@ def frontal_delaunay_2d( # noqa: C901, PLR0912
269
268
target_sizes = [target_sizes ] * edge_source .number_of_points
270
269
271
270
embedded_points = []
272
- for target_size , point in zip (target_sizes , points ):
271
+ for target_size , point in zip (target_sizes , points , strict = False ):
273
272
embedded_points .append (gmsh .model .geo .add_point (point [0 ], point [1 ], point [2 ], target_size ))
274
273
275
274
for i in range (lines [0 ] - 1 ):
@@ -334,7 +333,7 @@ def generate_mesh(dim: int) -> pv.UnstructuredGrid:
334
333
# Cells
335
334
cells = {}
336
335
337
- for type_ , tags , node_tags in zip (element_types , element_tags , element_node_tags ):
336
+ for type_ , tags , node_tags in zip (element_types , element_tags , element_node_tags , strict = False ):
338
337
assert (np .diff (tags ) > 0 ).all () # noqa: S101
339
338
340
339
celltype = gmsh_to_pyvista_type [type_ ]
@@ -498,7 +497,7 @@ def cell_size(self: Delaunay3D, size: int) -> None:
498
497
class Delaunay2D2 :
499
498
"""Delaunay2D class."""
500
499
501
- def __init__ (self , shell : shapely .Polygon , holes : Optional [ list [shapely .Polygon ]] = None ) -> None :
500
+ def __init__ (self , shell : shapely .Polygon , holes : list [shapely .Polygon ] | None = None ) -> None :
502
501
"""Create a Delaunay2D object."""
503
502
self .shell = shapely .Polygon (shell )
504
503
self .holes = [shapely .Polygon (hole ) for hole in holes ] if holes else []
0 commit comments