def test_siteOccupancy_valid(self):
     """Check DerivedStructureAdapter.siteOccupancy.
     """
     adpt1 = self.adpt1
     self.assertEqual(0.5, adpt1.siteOccupancy(0))
     self.assertEqual(1.0, StructureAdapter.siteOccupancy(adpt1, 0))
     return
 def test_siteAtomType_valid(self):
     """Check DerivedStructureAdapter.siteAtomType.
     """
     adpt1 = self.adpt1
     self.assertEqual("Cu", adpt1.siteAtomType(0))
     self.assertEqual("", StructureAdapter.siteAtomType(adpt1, 0))
     return
 def test_siteMultiplicity_valid(self):
     """Check DerivedStructureAdapter.siteMultiplicity.
     """
     adpt1 = self.adpt1
     self.assertEqual(2, adpt1.siteMultiplicity(0))
     self.assertEqual(1, StructureAdapter.siteMultiplicity(adpt1, 0))
     return
Beispiel #4
0
 def test_siteMultiplicity_valid(self):
     """Check DerivedStructureAdapter.siteMultiplicity.
     """
     adpt1 = self.adpt1
     self.assertEqual(2, adpt1.siteMultiplicity(0))
     self.assertEqual(1, StructureAdapter.siteMultiplicity(adpt1, 0))
     return
Beispiel #5
0
 def test_siteOccupancy_valid(self):
     """Check DerivedStructureAdapter.siteOccupancy.
     """
     adpt1 = self.adpt1
     self.assertEqual(0.5, adpt1.siteOccupancy(0))
     self.assertEqual(1.0, StructureAdapter.siteOccupancy(adpt1, 0))
     return
Beispiel #6
0
 def test_siteAtomType_valid(self):
     """Check DerivedStructureAdapter.siteAtomType.
     """
     adpt1 = self.adpt1
     self.assertEqual("Cu", adpt1.siteAtomType(0))
     self.assertEqual("", StructureAdapter.siteAtomType(adpt1, 0))
     return
 def setUp(self):
     self.adpt = StructureAdapter()
     return
class TestStructureAdapter(unittest.TestCase):

    def setUp(self):
        self.adpt = StructureAdapter()
        return

#   def test__customPQConfig(self):
#       """check StructureAdapter._customPQConfig()
#       """
#       return
#
#   def test_countSites(self):
#       """check StructureAdapter.countSites()
#       """
#       return
#
#   def test_createBondGenerator(self):
#       """check StructureAdapter.createBondGenerator()
#       """
#       return
#
#   def test_numberDensity(self):
#       """check StructureAdapter.numberDensity()
#       """
#       return

    def test_siteAtomType(self):
        """check StructureAdapter.siteAtomType()
        """
        self.assertEqual("", self.adpt.siteAtomType(0))
        return

    def test_siteCartesianPosition(self):
        """check StructureAdapter.siteCartesianPosition()
        """
        self.assertRaises(RuntimeError, self.adpt.siteAnisotropy, 0)
        return

    def test_siteMultiplicity(self):
        """check StructureAdapter.siteMultiplicity()
        """
        self.assertEqual(1, self.adpt.siteMultiplicity(0))
        return

    def test_siteOccupancy(self):
        """check StructureAdapter.siteOccupancy()
        """
        # check if we use the C++ method that alwasy return 1.
        self.assertEqual(1.0, self.adpt.siteOccupancy(0))
        self.assertEqual(1.0, self.adpt.siteOccupancy(99))
        return

    def test_siteAnisotropy(self):
        """check StructureAdapter.siteAnisotropy()
        """
        self.assertRaises(RuntimeError, self.adpt.siteAnisotropy, 0)
        return

    def test_siteCartesianUij(self):
        """check StructureAdapter.siteCartesianUij()
        """
        self.assertRaises(RuntimeError, self.adpt.siteCartesianUij, 0)
        return
Beispiel #9
0
 def setUp(self):
     self.adpt = StructureAdapter()
     return
Beispiel #10
0
class TestStructureAdapter(unittest.TestCase):
    def setUp(self):
        self.adpt = StructureAdapter()
        return

#   def test__customPQConfig(self):
#       """check StructureAdapter._customPQConfig()
#       """
#       return
#
#   def test_countSites(self):
#       """check StructureAdapter.countSites()
#       """
#       return
#
#   def test_createBondGenerator(self):
#       """check StructureAdapter.createBondGenerator()
#       """
#       return
#
#   def test_numberDensity(self):
#       """check StructureAdapter.numberDensity()
#       """
#       return

    def test_siteAtomType(self):
        """check StructureAdapter.siteAtomType()
        """
        self.assertEqual("", self.adpt.siteAtomType(0))
        return

    def test_siteCartesianPosition(self):
        """check StructureAdapter.siteCartesianPosition()
        """
        self.assertRaises(RuntimeError, self.adpt.siteAnisotropy, 0)
        return

    def test_siteMultiplicity(self):
        """check StructureAdapter.siteMultiplicity()
        """
        self.assertEqual(1, self.adpt.siteMultiplicity(0))
        return

    def test_siteOccupancy(self):
        """check StructureAdapter.siteOccupancy()
        """
        # check if we use the C++ method that alwasy return 1.
        self.assertEqual(1.0, self.adpt.siteOccupancy(0))
        self.assertEqual(1.0, self.adpt.siteOccupancy(99))
        return

    def test_siteAnisotropy(self):
        """check StructureAdapter.siteAnisotropy()
        """
        self.assertRaises(RuntimeError, self.adpt.siteAnisotropy, 0)
        return

    def test_siteCartesianUij(self):
        """check StructureAdapter.siteCartesianUij()
        """
        self.assertRaises(RuntimeError, self.adpt.siteCartesianUij, 0)
        return
Beispiel #11
0
 def __init__(self):
     StructureAdapter.__init__(self)
     self.positions = []
Beispiel #12
0
 def siteOccupancy(self, idx):
     self._checkindex(idx)
     return 0.5 * StructureAdapter.siteOccupancy(self, idx)
Beispiel #13
0
 def siteMultiplicity(self, idx):
     self._checkindex(idx)
     return 2 * StructureAdapter.siteMultiplicity(self, idx)
Beispiel #14
0
 def siteOccupancy(self, idx):
     self._checkindex(idx)
     return 0.5 * StructureAdapter.siteOccupancy(self, idx)
Beispiel #15
0
 def siteMultiplicity(self, idx):
     self._checkindex(idx)
     return 2 * StructureAdapter.siteMultiplicity(self, idx)
Beispiel #16
0
 def __init__(self):
     StructureAdapter.__init__(self)
     self.positions = []