insane/converters.py
def molspec(x):
    """
    Parse a string for a lipid or a solvent as given on the command line
    (MOLECULE[=NUMBER|:NUMBER]); where `=NUMBER` sets an absolute number of the
    molecule, and `:NUMBER` sets a relative number of it.
    If both absolute and relative number are set False, then relative count is 1.
    """
    lip = x.split(":")
    abn = lip[0].split("=")
    names = abn[0]
    if len(abn) > 1:
        nrel = 0
        nabs = int(abn[1])
    else:
        nabs = 0
        if len(lip) > 1:
            nrel = float(lip[1])
        else:
            nrel = 1
    return abn[0], nabs, nrel
def molspec(x):
    """
    Parse a string for a lipid or a solvent as given on the command line
    (MOLECULE[=NUMBER|:NUMBER]); where `=NUMBER` sets an absolute number of the
    molecule, and `:NUMBER` sets a relative number of it.
    If both absolute and relative number are set False, then relative count is 1.
    """
    lip = x.split(":")
    abn = lip[0].split("=")
    names = abn[0]
    if len(abn) > 1:
        nrel = 0
        nabs = int(abn[1])
    else:
        nabs = 0
        if len(lip) > 1:
            nrel = float(lip[1])
        else:
            nrel = 1
    return abn[0], nabs, nrel
def molspec ( x ) : lip = x . split ( ":" ) abn = lip [ 0 ] . split ( "=" ) names = abn [ 0 ] if len ( abn ) > 1 : nrel = 0 nabs = int ( abn [ 1 ] ) else : nabs = 0 if len ( lip ) > 1 : nrel = float ( lip [ 1 ] ) else : nrel = 1 return abn [ 0 ] , nabs , nrel
Parse a string for a lipid or a solvent as given on the command line
    (MOLECULE[=NUMBER|:NUMBER]); where `=NUMBER` sets an absolute number of the
    molecule, and `:NUMBER` sets a relative number of it.
    If both absolute and relative number are set False, then relative count is 1.
Parse a string for a lipid or a solvent as given on the command line ( MOLECULE [ = NUMBER| : NUMBER ] ) ; where = NUMBER sets an absolute number of the molecule and : NUMBER sets a relative number of it . If both absolute and relative number are set False then relative count is 1 .