@@ -2540,19 +2540,20 @@ def _validate_2d_geometry_has_2d_medium(cls, val, values):
2540
2540
if val is None :
2541
2541
return val
2542
2542
2543
- for i , structure in enumerate (val ):
2544
- if isinstance (structure .medium , Medium2D ):
2545
- continue
2546
- for geom in flatten_groups (structure .geometry ):
2547
- zero_dims = geom .zero_dims
2548
- if len (zero_dims ) > 0 :
2549
- log .warning (
2550
- f"Structure at 'structures[{ i } ]' has geometry with zero size along "
2551
- f"dimensions { zero_dims } , and with a medium that is not a 'Medium2D'. "
2552
- "This is probably not correct, since the resulting simulation will "
2553
- "depend on the details of the numerical grid. Consider either "
2554
- "giving the geometry a nonzero thickness or using a 'Medium2D'."
2555
- )
2543
+ with log as consolidated_logger :
2544
+ for i , structure in enumerate (val ):
2545
+ if isinstance (structure .medium , Medium2D ):
2546
+ continue
2547
+ for geom in flatten_groups (structure .geometry ):
2548
+ zero_dims = geom .zero_dims
2549
+ if len (zero_dims ) > 0 :
2550
+ consolidated_logger .warning (
2551
+ f"Structure at 'structures[{ i } ]' has geometry with zero size along "
2552
+ f"dimensions { zero_dims } , and with a medium that is not a 'Medium2D'. "
2553
+ "This is probably not correct, since the resulting simulation will "
2554
+ "depend on the details of the numerical grid. Consider either "
2555
+ "giving the geometry a nonzero thickness or using a 'Medium2D'."
2556
+ )
2556
2557
2557
2558
return val
2558
2559
0 commit comments