Type Checkers¶
This module defines functions for type, value, and/or attribute checking.
-
checkCoords
(coords, csets=False, natoms=None, dtype=(<type 'float'>, <type 'numpy.float32'>), name='coords')[source]¶ Returns True if shape, dimensionality, and data type of coords array are as expected.
Parameters: - coords – coordinate array
- csets – whether multiple coordinate sets (i.e.
.ndim in (2, 3)
) are allowed, default is False - natoms – number of atoms, if None number of atoms is not checked
- dtype – allowed data type(s), default is
(float, numpy.float32)
, if None data type is not checked - name – name of the coordinate argument
Raises: TypeError
when coords is not an instance ofnumpy.ndarray
Raises: ValueError
when wrong shape, dimensionality, or data type is encountered