def test_contains_peroxide(self): for f in ['LiFePO4', 'NaFePO4', 'Li3V2(PO4)3', 'Li2O']: self.assertFalse(contains_peroxide(self.get_structure(f))) for f in ['Li2O2', "K2O2"]: self.assertTrue(contains_peroxide(self.get_structure(f)))
def test_contains_peroxide(self): for f in ["LiFePO4", "NaFePO4", "Li3V2(PO4)3", "Li2O"]: self.assertFalse(contains_peroxide(self.get_structure(f))) for f in ["Li2O2", "K2O2"]: self.assertTrue(contains_peroxide(self.get_structure(f)))
def test_contains_peroxide(self): for filename in ['LiFePO4', 'NaFePO4', 'Li3V2(PO4)3', 'Li2O']: filepath = os.path.join(test_dir, "{}.cif".format(filename)) parser = CifParser(filepath) s = parser.get_structures()[0] self.assertFalse(contains_peroxide(s)) for filename in ['Li2O2', "K2O2"]: filepath = os.path.join(test_dir, "{}.cif".format(filename)) parser = CifParser(filepath) s = parser.get_structures()[0] self.assertTrue(contains_peroxide(s))
def list_contains_peroxide(list_struc): return [ contains_peroxide(structure, relative_cutoff=1.1) for structure in list_struc ]