def __post_init__(self, *args, **kwargs):
    if ((self.name is None) and (self.geometry is None)):
        raise TequilaException('no geometry or name given to molecule\nprovide geometry=filename.xyz or geometry=`h 0.0 0.0 0.0\\n...`\nor name=whatever with file whatever.xyz being present')
    if (self.name is None):
        if ('.xyz' in self.geometry):
            self.name = self.geometry.split('.xyz')[0]
            if (self.description is None):
                (coord, description) = self.read_xyz_from_file()
                self.description = description
        else:
            atoms = self.get_atoms()
            atom_names = sorted(list(set(atoms)), key=(lambda x: self.get_atom_number(x)), reverse=True)
            if (self.name is None):
                drop_ones = (lambda x: ('' if (x == 1) else x))
                self.name = ''.join(['{}{}'.format(x, drop_ones(atoms.count(x))) for x in atom_names])
    self.name = self.name.lower()
    if (self.geometry is None):
        self.geometry = (self.name + '.xyz')
    if (('.xyz' in self.geometry) and (not os.path.isfile(self.geometry))):
        raise TequilaException('could not find file for molecular coordinates {}'.format(self.geometry))
def __post_init__(self, *args, **kwargs):
    if ((self.name is None) and (self.geometry is None)):
        raise TequilaException('no geometry or name given to molecule\nprovide geometry=filename.xyz or geometry=`h 0.0 0.0 0.0\\n...`\nor name=whatever with file whatever.xyz being present')
    if (self.name is None):
        if ('.xyz' in self.geometry):
            self.name = self.geometry.split('.xyz')[0]
            if (self.description is None):
                (coord, description) = self.read_xyz_from_file()
                self.description = description
        else:
            atoms = self.get_atoms()
            atom_names = sorted(list(set(atoms)), key=(lambda x: self.get_atom_number(x)), reverse=True)
            if (self.name is None):
                drop_ones = (lambda x: ( if (x == 1) else x))
                self.name = .join(['{}{}'.format(x, drop_ones(atoms.count(x))) for x in atom_names])
    self.name = self.name.lower()
    if (self.geometry is None):
        self.geometry = (self.name + '.xyz')
    if (('.xyz' in self.geometry) and (not os.path.isfile(self.geometry))):
        raise TequilaException('could not find file for molecular coordinates {}'.format(self.geometry))