66from pathlib import Path
77import subprocess
88from typing import TYPE_CHECKING
9- from typing import Optional
109
1110import gmsh
1211import numpy as np
@@ -157,7 +156,7 @@ def delaunay_3d(
157156 if isinstance (target_sizes , float ):
158157 target_sizes = [target_sizes ] * edge_source .number_of_points
159158
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 )):
161160 id_ = i + 1
162161 gmsh .model .geo .add_point (point [0 ], point [1 ], point [2 ], target_size , id_ )
163162
@@ -246,11 +245,11 @@ def frontal_delaunay_2d( # noqa: C901, PLR0912
246245 if isinstance (target_sizes , float ):
247246 target_sizes = [target_sizes ] * (len (edge_source .interiors ) + 1 )
248247
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 ):
250249 sizes = [target_size ] * (len (linearring .coords ) - 1 ) if isinstance (target_size , float ) else target_size
251250 coords = linearring .coords [:- 1 ].copy ()
252251 tags = []
253- for size , coord in zip (sizes , coords ):
252+ for size , coord in zip (sizes , coords , strict = False ):
254253 x , y , z = coord
255254 tags .append (gmsh .model .geo .add_point (x , y , z , size ))
256255 curve_tags = []
@@ -269,7 +268,7 @@ def frontal_delaunay_2d( # noqa: C901, PLR0912
269268 target_sizes = [target_sizes ] * edge_source .number_of_points
270269
271270 embedded_points = []
272- for target_size , point in zip (target_sizes , points ):
271+ for target_size , point in zip (target_sizes , points , strict = False ):
273272 embedded_points .append (gmsh .model .geo .add_point (point [0 ], point [1 ], point [2 ], target_size ))
274273
275274 for i in range (lines [0 ] - 1 ):
@@ -334,7 +333,7 @@ def generate_mesh(dim: int) -> pv.UnstructuredGrid:
334333 # Cells
335334 cells = {}
336335
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 ):
338337 assert (np .diff (tags ) > 0 ).all () # noqa: S101
339338
340339 celltype = gmsh_to_pyvista_type [type_ ]
@@ -498,7 +497,7 @@ def cell_size(self: Delaunay3D, size: int) -> None:
498497class Delaunay2D2 :
499498 """Delaunay2D class."""
500499
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 :
502501 """Create a Delaunay2D object."""
503502 self .shell = shapely .Polygon (shell )
504503 self .holes = [shapely .Polygon (hole ) for hole in holes ] if holes else []
0 commit comments