def __init__(self, **kwargs):
        """ Initialize XYZ data from file or existing geometry.

        Initializer can be called in one of two forms:

        OpanXYZ(path='path/to/file')
        OpanXYZ(atom_syms={array of atoms}, coords={array of coordinates})

        In both forms, the optional keyword argument 'bohrs' can be specified,
        to indicate the units of the coordinates as Bohrs (True) or
        Angstroms (False). Angstrom and Bohr units are the default for the
        first and second forms, respectively. The units of all coordinates
        stored in the instance are *Bohrs*, regardless of this setting.
        """

        # Two situations. One should have 'path' and, optionally, 'bohrs'
        #  specified (default here is Angstroms). The other needs an N x 1
        #  'atom_syms' vector and a 3N x 1 'coords' vector.
        if 'path' in kwargs:
            # All set for load from file. 'bohrs' defaults False here
            self._load_file(kwargs['path'], \
                    bohrs=(kwargs['bohrs'] if 'bohrs' in kwargs else False))
        else:
            # Look for the from-coordinates objects
            if all((k in kwargs) for k in ('atom_syms', 'coords')):
                # Found. Call the by-data initializer. 'bohrs' defaults to
                #  TRUE here (presume main call is from repo)
                self._load_data(kwargs['atom_syms'], \
                        kwargs['coords'], \
                        bohrs=(kwargs['bohrs'] if 'bohrs' in kwargs else True))
            else:
                # NOT found -- error!
                raise NameError("Insufficient named parameters found")
def __init__ ( self , ** kwargs ) : if 'path' in kwargs : self . _load_file ( kwargs [ 'path' ] , bohrs = ( kwargs [ 'bohrs' ] if 'bohrs' in kwargs else False ) ) else : if all ( ( k in kwargs ) for k in ( 'atom_syms' , 'coords' ) ) : self . _load_data ( kwargs [ 'atom_syms' ] , kwargs [ 'coords' ] , bohrs = ( kwargs [ 'bohrs' ] if 'bohrs' in kwargs else True ) ) else : raise NameError ( "Insufficient named parameters found" )
Initialize XYZ data from file or existing geometry.

        Initializer can be called in one of two forms:

        OpanXYZ(path='path/to/file')
        OpanXYZ(atom_syms={array of atoms}, coords={array of coordinates})

        In both forms, the optional keyword argument 'bohrs' can be specified,
        to indicate the units of the coordinates as Bohrs (True) or
        Angstroms (False). Angstrom and Bohr units are the default for the
        first and second forms, respectively. The units of all coordinates
        stored in the instance are *Bohrs*, regardless of this setting.