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])
def test_missing_orbital(self): """ Test that 'missing' orbitals will return 0 electrons """ struct = ElectronicStructure.ground_state("He") self.assertEqual(struct["2p"], 0)
def test_pickable(self): """ Test that ElectronicStructure instances are pickable. """ structure = ElectronicStructure.ground_state("W") self.assertEqual(structure, pickle.loads(pickle.dumps(structure)))
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]
def test_electronic_structure_missing_orbital(): """Test that 'missing' orbitals will return 0 electrons""" struct = ElectronicStructure.ground_state("He") assert struct["2p"] == 0
def test_electronic_structure_pickable(): """Test that ElectronicStructure instances are pickable.""" structure = ElectronicStructure.ground_state("W") assert structure == pickle.loads(pickle.dumps(structure))