Esempio n. 1
0
 def test_filter(self):
     s = self.get_structure("Li10GeP2S12")
     sf = SpecieProximityFilter({"Li": 1})
     self.assertTrue(sf.test(s))
     sf = SpecieProximityFilter({"Li": 2})
     self.assertFalse(sf.test(s))
     sf = SpecieProximityFilter({"P": 1})
     self.assertTrue(sf.test(s))
     sf = SpecieProximityFilter({"P": 5})
     self.assertFalse(sf.test(s))
Esempio n. 2
0
 def test_filter(self):
     filename = os.path.join(test_dir, "Li10GeP2S12.cif")
     p = CifParser(filename)
     s = p.get_structures()[0]
     sf = SpecieProximityFilter({"Li": 1})
     self.assertTrue(sf.test(s))
     sf = SpecieProximityFilter({"Li": 2})
     self.assertFalse(sf.test(s))
     sf = SpecieProximityFilter({"P": 1})
     self.assertTrue(sf.test(s))
     sf = SpecieProximityFilter({"P": 5})
     self.assertFalse(sf.test(s))
Esempio n. 3
0
 def test_filter(self):
     s = self.get_structure("Li10GeP2S12")
     sf = SpecieProximityFilter({"Li": 1})
     self.assertTrue(sf.test(s))
     sf = SpecieProximityFilter({"Li": 2})
     self.assertFalse(sf.test(s))
     sf = SpecieProximityFilter({"P": 1})
     self.assertTrue(sf.test(s))
     sf = SpecieProximityFilter({"P": 5})
     self.assertFalse(sf.test(s))
Esempio n. 4
0
 def test_to_from_dict(self):
     sf = SpecieProximityFilter({"Li": 1})
     d = sf.as_dict()
     self.assertIsInstance(SpecieProximityFilter.from_dict(d),
                           SpecieProximityFilter)
Esempio n. 5
0
 def test_to_from_dict(self):
     sf = SpecieProximityFilter({"Li": 1})
     d = sf.as_dict()
     self.assertIsInstance(SpecieProximityFilter.from_dict(d),
                           SpecieProximityFilter)
Esempio n. 6
0
 def test_filter(self):
     filename = os.path.join(test_dir, "Li10GeP2S12.cif")
     p = CifParser(filename)
     s = p.get_structures()[0]
     sf = SpecieProximityFilter({"Li": 1})
     self.assertTrue(sf.test(s))
     sf = SpecieProximityFilter({"Li": 2})
     self.assertFalse(sf.test(s))
     sf = SpecieProximityFilter({"P": 1})
     self.assertTrue(sf.test(s))
     sf = SpecieProximityFilter({"P": 5})
     self.assertFalse(sf.test(s))