(smiles, hac=3)
return ".".join([Chem.MolToSmiles(x) for x in save])
Remove solvents and ions have max 'hac' heavy atoms. This function removes any fragment in molecule that has
    number of heavy atoms <= "hac" and it might not be an actual solvent or salt
    
    Parameters
    ----------
    smiles : str
        SMILES
    hac : int
        Max number of heavy atoms

    Returns
    -------
    str
        smiles
Remove solvents and ions have max 'hac' heavy atoms. This function removes any fragment in molecule that has
    number of heavy atoms <= "hac" and it might not be an actual solvent or salt
    
    Parameters
    ----------
    smiles : str
        SMILES
    hac : int
        Max number of heavy atoms
Remove solvents and ions have max hac heavy atoms . This function removes any fragment in molecule that has number of heavy atoms < = hac and it might not be an actual solvent or salt Parameters ---------- smiles : str SMILES hac : int Max number of heavy atoms
def remove_salts_solvents(smiles, hac=3):
    """Remove solvents and ions have max 'hac' heavy atoms. This function removes any fragment in molecule that has
    number of heavy atoms <= "hac" and it might not be an actual solvent or salt
    
    Parameters
    ----------
    smiles : str
        SMILES
    hac : int
        Max number of heavy atoms

    Returns
    -------
    str
        smiles
    """
    save = []
    for el in smiles.split("."):
        mol = Chem.MolFromSmiles(str(el))
        if mol.GetNumHeavyAtoms() <= hac:
            save.append(mol)
        
    return ".".join([Chem.MolToSmiles(x) for x in save])
def remove_salts_solvents ( smiles , hac = 3 ) : save = [ ] for el in smiles . split ( "." ) : mol = Chem . MolFromSmiles ( str ( el ) ) if mol . GetNumHeavyAtoms ( ) <= hac : save . append ( mol ) return "." . join ( [ Chem . MolToSmiles ( x ) for x in save ] )