@@ -1073,9 +1073,9 @@ def from_layer_bounds(
10731073 min_steps_along_axis : np .PositiveFloat = None ,
10741074 bounds_refinement : GridRefinement = None ,
10751075 bounds_snapping : Literal ["bounds" , "lower" , "upper" , "center" ] = "lower" ,
1076- corner_finder : CornerFinderSpec = None ,
1076+ corner_finder : CornerFinderSpec = CornerFinderSpec () ,
10771077 corner_snapping : bool = True ,
1078- corner_refinement : GridRefinement = None ,
1078+ corner_refinement : GridRefinement = GridRefinement () ,
10791079 refinement_inside_sim_only : bool = True ,
10801080 gap_meshing_iters : pd .NonNegativeInt = 1 ,
10811081 dl_min_from_gap_width : bool = True ,
@@ -1115,11 +1115,6 @@ def from_layer_bounds(
11151115 >>> layer = LayerRefinementSpec.from_layer_bounds(axis=2, bounds=(0,1))
11161116
11171117 """
1118- if corner_finder is None :
1119- corner_finder = CornerFinderSpec ()
1120- if corner_refinement is None :
1121- corner_refinement = GridRefinement ()
1122-
11231118 center = Box .unpop_axis ((bounds [0 ] + bounds [1 ]) / 2 , (0 , 0 ), axis )
11241119 size = Box .unpop_axis ((bounds [1 ] - bounds [0 ]), (inf , inf ), axis )
11251120
@@ -1147,9 +1142,9 @@ def from_bounds(
11471142 min_steps_along_axis : np .PositiveFloat = None ,
11481143 bounds_refinement : GridRefinement = None ,
11491144 bounds_snapping : Literal ["bounds" , "lower" , "upper" , "center" ] = "lower" ,
1150- corner_finder : CornerFinderSpec = None ,
1145+ corner_finder : CornerFinderSpec = CornerFinderSpec () ,
11511146 corner_snapping : bool = True ,
1152- corner_refinement : GridRefinement = None ,
1147+ corner_refinement : GridRefinement = GridRefinement () ,
11531148 refinement_inside_sim_only : bool = True ,
11541149 gap_meshing_iters : pd .NonNegativeInt = 1 ,
11551150 dl_min_from_gap_width : bool = True ,
@@ -1191,11 +1186,6 @@ def from_bounds(
11911186 >>> layer = LayerRefinementSpec.from_bounds(axis=2, rmin=(0,0,0), rmax=(1,1,1))
11921187
11931188 """
1194- if corner_finder is None :
1195- corner_finder = CornerFinderSpec ()
1196- if corner_refinement is None :
1197- corner_refinement = GridRefinement ()
1198-
11991189 box = Box .from_bounds (rmin = rmin , rmax = rmax )
12001190 if axis is None :
12011191 axis = np .argmin (box .size )
@@ -1222,9 +1212,9 @@ def from_structures(
12221212 min_steps_along_axis : np .PositiveFloat = None ,
12231213 bounds_refinement : GridRefinement = None ,
12241214 bounds_snapping : Literal ["bounds" , "lower" , "upper" , "center" ] = "lower" ,
1225- corner_finder : CornerFinderSpec = None ,
1215+ corner_finder : CornerFinderSpec = CornerFinderSpec () ,
12261216 corner_snapping : bool = True ,
1227- corner_refinement : GridRefinement = None ,
1217+ corner_refinement : GridRefinement = GridRefinement () ,
12281218 refinement_inside_sim_only : bool = True ,
12291219 gap_meshing_iters : pd .NonNegativeInt = 1 ,
12301220 dl_min_from_gap_width : bool = True ,
@@ -1259,10 +1249,6 @@ def from_structures(
12591249 Take into account autodetected minimal PEC gap width when determining ``dl_min``.
12601250
12611251 """
1262- if corner_finder is None :
1263- corner_finder = CornerFinderSpec ()
1264- if corner_refinement is None :
1265- corner_refinement = GridRefinement ()
12661252
12671253 all_bounds = tuple (structure .geometry .bounds for structure in structures )
12681254 rmin = tuple (min (b [i ] for b , _ in all_bounds ) for i in range (3 ))
@@ -2734,7 +2720,7 @@ def auto(
27342720 layer_refinement_specs : list [LayerRefinementSpec ] = (),
27352721 dl_min : pd .NonNegativeFloat = 0.0 ,
27362722 min_steps_per_sim_size : pd .PositiveFloat = 10.0 ,
2737- mesher : MesherType = None ,
2723+ mesher : MesherType = GradedMesher () ,
27382724 ) -> GridSpec :
27392725 """Use the same :class:`AutoGrid` along each of the three directions.
27402726
@@ -2768,8 +2754,6 @@ def auto(
27682754 GridSpec
27692755 :class:`GridSpec` with the same automatic nonuniform grid settings in each direction.
27702756 """
2771- if mesher is None :
2772- mesher = GradedMesher ()
27732757
27742758 grid_1d = AutoGrid (
27752759 min_steps_per_wvl = min_steps_per_wvl ,
@@ -2813,7 +2797,7 @@ def quasiuniform(
28132797 max_scale : pd .PositiveFloat = 1.4 ,
28142798 override_structures : list [StructureType ] = (),
28152799 snapping_points : tuple [CoordinateOptional , ...] = (),
2816- mesher : MesherType = None ,
2800+ mesher : MesherType = GradedMesher () ,
28172801 ) -> GridSpec :
28182802 """Use the same :class:`QuasiUniformGrid` along each of the three directions.
28192803
@@ -2837,8 +2821,6 @@ def quasiuniform(
28372821 GridSpec
28382822 :class:`GridSpec` with the same uniform grid size in each direction.
28392823 """
2840- if mesher is None :
2841- mesher = GradedMesher ()
28422824
28432825 grid_1d = QuasiUniformGrid (dl = dl , max_scale = max_scale , mesher = mesher )
28442826 return cls (
0 commit comments