Allow dimensionality check for non Quantity arguments
This commit is contained in:
parent
245b8ee84a
commit
905aa2e627
|
@ -210,9 +210,10 @@ def check(ureg, *args):
|
|||
@functools.wraps(func, assigned=assigned, updated=updated)
|
||||
def wrapper(*values, **kwargs):
|
||||
for dim, value in zip_longest(dimensions, values):
|
||||
if dim is not None and value.dimensionality != dim:
|
||||
val_dim = ureg.get_dimensionality(value)
|
||||
if dim is not None and val_dim != dim:
|
||||
raise DimensionalityError(value, 'a quantity of',
|
||||
value.dimensionality, dim)
|
||||
val_dim, dim)
|
||||
return func(*values, **kwargs)
|
||||
return wrapper
|
||||
return decorator
|
||||
|
|
Loading…
Reference in New Issue