def _check_valid_data(self, data):
        """Checks that the incoming data is a Nx1 ndarray.

        Parameters
        ----------
        data : :obj:`numpy.ndarray`
            The data to verify.

        Raises
        ------
        ValueError
            If the data is not of the correct shape or if the vector is not
            normed.
        """
        if len(data.shape) == 2 and data.shape[1] != 1:
            raise ValueError('Can only initialize Direction from a single Nx1 array') 
        if np.abs(np.linalg.norm(data) - 1.0) > 1e-4:
            raise ValueError('Direction data must have norm=1.0')
def _check_valid_data ( self , data ) : if len ( data . shape ) == 2 and data . shape [ 1 ] != 1 : raise ValueError ( 'Can only initialize Direction from a single Nx1 array' ) if np . abs ( np . linalg . norm ( data ) - 1.0 ) > 1e-4 : raise ValueError ( 'Direction data must have norm=1.0' )
Checks that the incoming data is a Nx1 ndarray.

        Parameters
        ----------
        data : :obj:`numpy.ndarray`
            The data to verify.

        Raises
        ------
        ValueError
            If the data is not of the correct shape or if the vector is not
            normed.