Esempio n. 1
0
 def test_orbital_keys(self):
     """ Test that orbital occupancies can be accessed either with strings or Orbital """
     struct = ElectronicStructure.ground_state("He")
     self.assertEqual(struct["1s"], struct[Orbital.one_s])
Esempio n. 2
0
 def test_missing_orbital(self):
     """ Test that 'missing' orbitals will return 0 electrons """
     struct = ElectronicStructure.ground_state("He")
     self.assertEqual(struct["2p"], 0)
Esempio n. 3
0
 def test_pickable(self):
     """ Test that ElectronicStructure instances are pickable. """
     structure = ElectronicStructure.ground_state("W")
     self.assertEqual(structure, pickle.loads(pickle.dumps(structure)))
Esempio n. 4
0
def test_electronic_structure_orbital_keys():
    """Test that orbital occupancies can be accessed either with strings or Orbital"""
    struct = ElectronicStructure.ground_state("He")
    assert struct["1s"] == struct[Orbital.one_s]
Esempio n. 5
0
def test_electronic_structure_missing_orbital():
    """Test that 'missing' orbitals will return 0 electrons"""
    struct = ElectronicStructure.ground_state("He")
    assert struct["2p"] == 0
Esempio n. 6
0
def test_electronic_structure_pickable():
    """Test that ElectronicStructure instances are pickable."""
    structure = ElectronicStructure.ground_state("W")
    assert structure == pickle.loads(pickle.dumps(structure))