def test_run_staged_ingredients(self): topmetad = MASTFile("files/top_metadata_single") topmetad.data.append("origin_dir = %s/files\n" % testdir) #give origin directory topmetad.to_file("recipedir/metadata.txt") #metad = MASTFile("files/metadata_single") #metad.to_file("%s/metadata.txt" % ingdir) rp = RecipePlan("recipedir") rp.ingredients['ing1']="C" rp.ingredients['ing2a'] = "W" rp.ingredients['ing2b'] = "S" rp.ingredients['ing3'] = "W" kdict=dict() kdict['mast_program']='vasp' kdict['mast_xc']='pw91' kdict['mast_kpoints']=[1,2,3,"G"] rp.ingred_input_options['ing2b']=dict() rp.ingred_input_options['ing2b']['name']="recipedir/ing2b" rp.ingred_input_options['ing2b']['program_keys']=kdict rp.ingred_input_options['ing2b']['structure']=pymatgen.io.vaspio.Poscar.from_file("files/perfect_structure").structure rp.write_methods['ing2b']=[['write_singlerun']] rp.write_ingredient('ing2b') rp.ready_methods['ing2b']=[['ready_singlerun']] rp.run_methods['ing2b']=[['run_singlerun']] rp.complete_methods['ing2b']=[['complete_singlerun']] rp.run_staged_ingredients() mysubmit = MASTFile("test_control/submitlist") self.assertEquals(mysubmit.data[0],"recipedir/ing2b\n") self.assertEquals(rp.ingredients,{'ing1':'C','ing2a':'W','ing2b':'P','ing3':'W'})
def test_run_staged_ingredients(self): topmetad = MASTFile("files/top_metadata_single") topmetad.data.append("origin_dir = %s/files\n" % testdir) #give origin directory topmetad.to_file("recipedir/metadata.txt") #metad = MASTFile("files/metadata_single") #metad.to_file("%s/metadata.txt" % ingdir) rp = RecipePlan("recipedir") rp.ingredients['ing1'] = "C" rp.ingredients['ing2a'] = "W" rp.ingredients['ing2b'] = "S" rp.ingredients['ing3'] = "W" kdict = dict() kdict['mast_program'] = 'vasp' kdict['mast_xc'] = 'pw91' kdict['mast_kpoints'] = [1, 2, 3, "G"] rp.ingred_input_options['ing2b'] = dict() rp.ingred_input_options['ing2b']['name'] = "recipedir/ing2b" rp.ingred_input_options['ing2b']['program_keys'] = kdict rp.ingred_input_options['ing2b'][ 'structure'] = pymatgen.io.vaspio.Poscar.from_file( "files/perfect_structure").structure rp.write_methods['ing2b'] = [['write_singlerun']] rp.write_ingredient('ing2b') rp.ready_methods['ing2b'] = [['ready_singlerun']] rp.run_methods['ing2b'] = [['run_singlerun']] rp.complete_methods['ing2b'] = [['complete_singlerun']] rp.run_staged_ingredients() mysubmit = MASTFile("test_control/submitlist") self.assertEquals(mysubmit.data[0], "recipedir/ing2b\n") self.assertEquals(rp.ingredients, { 'ing1': 'C', 'ing2a': 'W', 'ing2b': 'P', 'ing3': 'W' })