def __new__(cls, cs_matrix, vscale=None):
        """
        Create a Chemical Shielding tensor.
        Note that the constructor uses __new__
        rather than __init__ according to the standard method of
        subclassing numpy ndarrays.

        Args:
            cs_matrix (1x3 or 3x3 array-like): the 3x3 array-like
                representing the chemical shielding tensor
                or a 1x3 array of the primary sigma values corresponding
                to the principal axis system
            vscale (6x1 array-like): 6x1 array-like scaling the
                voigt-notation vector with the tensor entries
        """
        t_array = np.array(cs_matrix)

        if t_array.shape == (3, ):
            return super().__new__(cls, np.diag(cs_matrix), vscale)
        elif t_array.shape == (3, 3):
            return super().__new__(cls, cs_matrix, vscale)
def __new__ ( cls , cs_matrix , vscale = None ) : t_array = np . array ( cs_matrix ) if t_array . shape == ( 3 , ) : return super ( ) . __new__ ( cls , np . diag ( cs_matrix ) , vscale ) elif t_array . shape == ( 3 , 3 ) : return super ( ) . __new__ ( cls , cs_matrix , vscale )
Create a Chemical Shielding tensor.
        Note that the constructor uses __new__
        rather than __init__ according to the standard method of
        subclassing numpy ndarrays.

        Args:
            cs_matrix (1x3 or 3x3 array-like): the 3x3 array-like
                representing the chemical shielding tensor
                or a 1x3 array of the primary sigma values corresponding
                to the principal axis system
            vscale (6x1 array-like): 6x1 array-like scaling the
                voigt-notation vector with the tensor entries