Exemplo 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])
Exemplo 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)
Exemplo 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)))
Exemplo 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]
Exemplo 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
Exemplo 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))