@@ -303,21 +303,31 @@ class SemiconductorMedium(AbstractChargeMedium):
303303 units = ELECTRON_VOLT ,
304304 )
305305
306- N_a : Union [NonNegativeFloat , SpatialDataArray , tuple [DopingBoxType , ...]] = Field (
306+ N_a : Union [
307+ tuple [DopingBoxType , ...],
308+ list [DopingBoxType ],
309+ SpatialDataArray ,
310+ NonNegativeFloat ,
311+ ] = Field (
307312 (),
308313 title = "Doping: Acceptor concentration" ,
309314 description = "Concentration of acceptor impurities, which create mobile holes, resulting in p-type material. "
310315 "Can be specified as a single float for uniform doping, a :class:`SpatialDataArray` for a custom profile, "
311- "or a tuple of geometric shapes to define specific doped regions." ,
316+ "or a tuple/list of geometric shapes to define specific doped regions." ,
312317 units = PERCMCUBE ,
313318 )
314319
315- N_d : Union [NonNegativeFloat , SpatialDataArray , tuple [DopingBoxType , ...]] = Field (
320+ N_d : Union [
321+ tuple [DopingBoxType , ...],
322+ list [DopingBoxType ],
323+ SpatialDataArray ,
324+ NonNegativeFloat ,
325+ ] = Field (
316326 (),
317327 title = "Doping: Donor concentration" ,
318328 description = "Concentration of donor impurities, which create mobile electrons, resulting in n-type material. "
319329 "Can be specified as a single float for uniform doping, a :class:`SpatialDataArray` for a custom profile, "
320- "or a tuple of geometric shapes to define specific doped regions." ,
330+ "or a tuple/list of geometric shapes to define specific doped regions." ,
321331 units = PERCMCUBE ,
322332 )
323333
@@ -363,9 +373,14 @@ def check_eg_uses_model(
363373 @field_validator ("N_d" )
364374 @classmethod
365375 def check_nd_uses_model (
366- cls , val : Union [NonNegativeFloat , SpatialDataArray , tuple [DopingBoxType , ...]]
376+ cls ,
377+ val : Union [
378+ NonNegativeFloat , SpatialDataArray , tuple [DopingBoxType , ...], list [DopingBoxType ]
379+ ],
367380 ) -> Union [SpatialDataArray , tuple [DopingBoxType , ...]]:
368381 """Issue deprecation warning if float is provided"""
382+ if isinstance (val , list ):
383+ return tuple (val )
369384 if isinstance (val , (float , int )):
370385 log .warning (
371386 "Passing a float to 'N_d' is deprecated and will be removed in future versions. "
@@ -377,9 +392,14 @@ def check_nd_uses_model(
377392 @field_validator ("N_a" )
378393 @classmethod
379394 def check_na_uses_model (
380- cls , val : Union [NonNegativeFloat , SpatialDataArray , tuple [DopingBoxType , ...]]
395+ cls ,
396+ val : Union [
397+ NonNegativeFloat , SpatialDataArray , tuple [DopingBoxType , ...], list [DopingBoxType ]
398+ ],
381399 ) -> Union [SpatialDataArray , tuple [DopingBoxType , ...]]:
382400 """Issue deprecation warning if float is provided"""
401+ if isinstance (val , list ):
402+ return tuple (val )
383403 if isinstance (val , (float , int )):
384404 log .warning (
385405 "Passing a float to 'N_a' is deprecated and will be removed in future versions. "
0 commit comments