elephant.utils.check_same_units

elephant.utils.check_same_units(quantities, object_type=<class 'quantities.quantity.Quantity'>)[source]

Check that all input quantities are of the same type and share common units. Raise an error if the check is unsuccessful.

Parameters:
quantitieslist of pq.Quantity or pq.Quantity

A list of quantities, neo objects or a single neo object.

object_typetype, optional

The common type. Default: pq.Quantity

Raises:
TypeError

If input objects are not instances of the specified object_type.

ValueError

If input objects do not share common units.