@@ -3279,7 +3279,8 @@ def __init__(self, norms, vmin=None, vmax=None, clip=False):
3279
3279
self .vmax = vmax
3280
3280
self .clip = clip
3281
3281
3282
- [n .callbacks .connect ('changed' , self ._changed ) for n in self ._norms ]
3282
+ for n in self ._norms :
3283
+ n .callbacks .connect ('changed' , self ._changed )
3283
3284
3284
3285
@property
3285
3286
def n_input (self ):
@@ -3299,11 +3300,7 @@ def vmin(self):
3299
3300
3300
3301
@vmin .setter
3301
3302
def vmin (self , value ):
3302
- if not np .iterable (value ):
3303
- value = [value ]* self .n_input
3304
- if len (value ) != self .n_input :
3305
- raise ValueError (f"Invalid vmin for `MultiNorm` with { self .n_input } "
3306
- " inputs." )
3303
+ value = np .broadcast_to (value , self .n_input )
3307
3304
with self .callbacks .blocked ():
3308
3305
for i , v in enumerate (value ):
3309
3306
if v is not None :
@@ -3316,11 +3313,7 @@ def vmax(self):
3316
3313
3317
3314
@vmax .setter
3318
3315
def vmax (self , value ):
3319
- if not np .iterable (value ):
3320
- value = [value ]* self .n_input
3321
- if len (value ) != self .n_input :
3322
- raise ValueError (f"Invalid vmax for `MultiNorm` with { self .n_input } "
3323
- " inputs." )
3316
+ value = np .broadcast_to (value , self .n_input )
3324
3317
with self .callbacks .blocked ():
3325
3318
for i , v in enumerate (value ):
3326
3319
if v is not None :
@@ -3333,8 +3326,7 @@ def clip(self):
3333
3326
3334
3327
@clip .setter
3335
3328
def clip (self , value ):
3336
- if not np .iterable (value ):
3337
- value = [value ]* self .n_input
3329
+ value = np .broadcast_to (value , self .n_input )
3338
3330
with self .callbacks .blocked ():
3339
3331
for i , v in enumerate (value ):
3340
3332
if v is not None :
0 commit comments