def test_filter(self): transmuter = StandardTransmuter.from_structures(self._struct_list) fil = RemoveDuplicatesFilter() transmuter.apply_filter(fil) out = self._sm.group_structures(transmuter.transformed_structures) self.assertEqual(self._sm.find_indexes(transmuter.transformed_structures, out), [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
def test_filter(self): fil = RemoveExistingFilter(self._exisiting_structures) transmuter = StandardTransmuter.from_structures(self._struct_list) transmuter.apply_filter(fil) self.assertEqual(len(transmuter.transformed_structures), 1) self.assertTrue( self._sm.fit(self._struct_list[-1], transmuter.transformed_structures[-1].final_structure))
def test_filter(self): fil = RemoveExistingFilter(self._exisiting_structures) transmuter = StandardTransmuter.from_structures(self._struct_list) transmuter.apply_filter(fil) self.assertEqual(len(transmuter.transformed_structures), 1) self.assertTrue( self._sm.fit(self._struct_list[-1], transmuter.transformed_structures[-1].final_structure))
def test_filter(self): transmuter = StandardTransmuter.from_structures(self._struct_list) fil = RemoveDuplicatesFilter() transmuter.apply_filter(fil) out = self._sm.group_structures(transmuter.transformed_structures) self.assertEqual( self._sm.find_indexes(transmuter.transformed_structures, out), [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
def convert_fmt(args): iformat = args.input_format[0] oformat = args.output_format[0] filename = args.input_filename[0] out_filename = args.output_filename[0] try: if iformat == "smart": structure = read_structure(filename) if iformat == "POSCAR": p = Poscar.from_file(filename) structure = p.structure elif iformat == "CIF": r = CifParser(filename) structure = r.get_structures()[0] elif iformat == "CSSR": structure = Cssr.from_file(filename).structure if oformat == "smart": write_structure(structure, out_filename) elif oformat == "POSCAR": p = Poscar(structure) p.write_file(out_filename) elif oformat == "CIF": w = CifWriter(structure) w.write_file(out_filename) elif oformat == "CSSR": c = Cssr(structure) c.write_file(out_filename) elif oformat == "VASP": input_set = MaterialsProjectVaspInputSet() transmuter = StandardTransmuter.from_structures([structure], []) transmuter.write_vasp_input(input_set, output_dir=out_filename) except Exception as ex: print "Error converting file. Are they in the right format?" print str(ex)
def test_filter(self): transmuter = StandardTransmuter.from_structures(self._struct_list) fil = RemoveDuplicatesFilter() transmuter.apply_filter(fil) self.assertEqual(len(transmuter.transformed_structures), 11)
def test_filter(self): transmuter = StandardTransmuter.from_structures(self._struct_list) fil = RemoveDuplicatesFilter() transmuter.apply_filter(fil) self.assertEqual(len(transmuter.transformed_structures), 11)