def JOBKIND(x): return Constraint(1, 'jobkind', s(x), '=')
def LAUNCHDIR(x): return Constraint(1, 'launchdir', s(x), '=')
def LAUNCHDIRS(x): return Constraint(1, 'launchdir', [s(y) for y in x], 'in')
def ADSORBATES(x): return Constraint( 1, 'stradsorbates', s(x), '=' ) # https://stackoverflow.com/questions/603572/how-to-properly-escape-a-single-quote-for-a-sqlite-database
def EXISTS(filename): return Constraint(1, filename.replace('.', '_'), s(True), '=')
def INITPOS(x): return Constraint(1, 'strinitpos', s(x), '=')
def SYMMETRIC(x): return Constraint(1, 'symmetric', s(str(x)), '=')
def STATUS(x): return Constraint(1, 'status', s(x), '=')
def KIND(x): return Constraint(1, 'kind', s(x), '=')
def XC(x): return Constraint(1, 'xc', s(x), '=')
def PSP(x): return Constraint(1, 'psp', s(x), '=')
def DFTCODE(x): return Constraint(1, 'dftcode', s(x), '=')
def MAGMOMINIT(x): return Constraint(1, 'strmagmominit', s(x), '=')
def INITCELL(x): return Constraint(1, 'strinitcell', s(x), '=')
def SYMBOLS(x): return Constraint(1, 'strsymbols', s(x), '=')
def STRUCTURE(x): return Constraint(1, 'structure', s(x), '=')
def NUMBERS(x): return Constraint(1, 'strnumbers', s(x), '=')
def STATUS(x): return Constraint(1, 'status', s(x), '=') READY = STATUS('ready') QUEUED = STATUS('queued') FIZZLED = STATUS('fizzled') TIMEOUT = STATUS('timeout') CANCELLED = STATUS('cancelled') FAILED = STATUS('failed') COMPLETED = STATUS('completed') RUNNING = STATUS('running') NOTCOMPLETED = Constraint(1, 'status', s('completed'), '!=') # 'unlocked' means that we presently INTEND to eventually update the row # a job that has not finished should be unlocked # if a job is finished, then it should be unlocked ########## # ELEMENTS ########## AG = Constraint(1, 'name', s('%Ag-fcc%'), 'like') AL = Constraint(1, 'name', s('%Al-fcc%'), 'like') AU = Constraint(1, 'name', s('%Au-fcc%'), 'like') BA = Constraint(1, 'name', s('%Ba-bcc%'), 'like') BE = Constraint(1, 'name', s('%Be-hcp%'), 'like') C = Constraint(1, 'name', s('%C-diamond%'), 'like') CA = Constraint(1, 'name', s('%Ca-fcc%'), 'like')