@@ -3226,16 +3226,16 @@ def inverse(self, value):
3226
3226
3227
3227
class MultiNorm (Normalize ):
3228
3228
"""
3229
- A mixin class which contains multiple scalar norms
3229
+ A class which contains multiple scalar norms
3230
3230
"""
3231
3231
3232
3232
def __init__ (self , norms , vmin = None , vmax = None , clip = False ):
3233
3233
"""
3234
3234
Parameters
3235
3235
----------
3236
- norms : List of (str, `Normalize` or None)
3236
+ norms : list of (str, `Normalize` or None)
3237
3237
The constituent norms. The list must have a minimum length of 2.
3238
- vmin, vmax : float, None, or list of float or None
3238
+ vmin, vmax : float or None or list of ( float or None)
3239
3239
Limits of the constituent norms.
3240
3240
If a list, each value is assigned to each of the constituent
3241
3241
norms. Single values are repeated to form a list of appropriate size.
@@ -3279,14 +3279,17 @@ def __init__(self, norms, vmin=None, vmax=None, clip=False):
3279
3279
3280
3280
@property
3281
3281
def n_variables (self ):
3282
+ """Number of norms held by this `MultiNorm`."""
3282
3283
return len (self ._norms )
3283
3284
3284
3285
@property
3285
3286
def norms (self ):
3287
+ """The individual norms held but this `MultiNorm`"""
3286
3288
return self ._norms
3287
3289
3288
3290
@property
3289
3291
def vmin (self ):
3292
+ """The lower limit of each constituent norm."""
3290
3293
return tuple (n .vmin for n in self ._norms )
3291
3294
3292
3295
@vmin .setter
@@ -3300,6 +3303,7 @@ def vmin(self, value):
3300
3303
3301
3304
@property
3302
3305
def vmax (self ):
3306
+ """The upper limit of each constituent norm."""
3303
3307
return tuple (n .vmax for n in self ._norms )
3304
3308
3305
3309
@vmax .setter
@@ -3313,6 +3317,7 @@ def vmax(self, value):
3313
3317
3314
3318
@property
3315
3319
def clip (self ):
3320
+ """The clip behaviour of each constituent norm."""
3316
3321
return tuple (n .clip for n in self ._norms )
3317
3322
3318
3323
@clip .setter
@@ -3339,17 +3344,17 @@ def __call__(self, value, clip=None):
3339
3344
3340
3345
Parameters
3341
3346
----------
3342
- value
3343
- Data to normalize. Must be of length `n_variables` or have a data type with
3344
- `n_variables` fields.
3347
+ value : array-like
3348
+ Data to normalize. Must be of length `n_variables` or be a structured
3349
+ array or scalar with `n_variables` fields.
3345
3350
clip : list of bools or bool, optional
3346
3351
See the description of the parameter *clip* in Normalize.
3347
3352
If ``None``, defaults to ``self.clip`` (which defaults to
3348
3353
``False``).
3349
3354
3350
3355
Returns
3351
3356
-------
3352
- List
3357
+ list
3353
3358
Normalized input values as a list of length `n_variables`
3354
3359
3355
3360
Notes
@@ -3373,8 +3378,8 @@ def inverse(self, value):
3373
3378
Parameters
3374
3379
----------
3375
3380
value
3376
- Normalized value. Must be of length `n_variables` or have a data type with
3377
- `n_variables` fields.
3381
+ Normalized value. Must be of length `n_variables` or be a structured array
3382
+ or scalar with `n_variables` fields.
3378
3383
"""
3379
3384
value = self ._iterable_variates_in_data (value , self .n_variables )
3380
3385
result = [n .inverse (v ) for n , v in zip (self .norms , value )]
@@ -3401,8 +3406,8 @@ def autoscale_None(self, A):
3401
3406
Parameters
3402
3407
----------
3403
3408
A
3404
- Data, must be of length `n_variables` or have a data type with
3405
- `n_variables` fields.
3409
+ Data, must be of length `n_variables` or be a structured array or scalar
3410
+ with `n_variables` fields.
3406
3411
"""
3407
3412
with self .callbacks .blocked ():
3408
3413
A = self ._iterable_variates_in_data (A , self .n_variables )
@@ -3411,7 +3416,7 @@ def autoscale_None(self, A):
3411
3416
self ._changed ()
3412
3417
3413
3418
def scaled (self ):
3414
- """Return whether both *vmin* and *vmax* are set on all constituent norms"""
3419
+ """Return whether both *vmin* and *vmax* are set on all constituent norms. """
3415
3420
return all ([n .scaled () for n in self .norms ])
3416
3421
3417
3422
@staticmethod
@@ -3437,8 +3442,8 @@ def _iterable_variates_in_data(data, n_variables):
3437
3442
data = [data [descriptor [0 ]] for descriptor in data .dtype .descr ]
3438
3443
if len (data ) != n_variables :
3439
3444
raise ValueError ("The input to this `MultiNorm` must be of shape "
3440
- f"({ n_variables } , ...), or have a data type with "
3441
- f"{ n_variables } fields." )
3445
+ f"({ n_variables } , ...), or be structured array or scalar "
3446
+ f"with { n_variables } fields." )
3442
3447
return data
3443
3448
3444
3449
0 commit comments