Skip to content

Commit

Permalink
Fix None assignment in declaritive style Section instantiation
Browse files Browse the repository at this point in the history
  • Loading branch information
ndaelman committed Aug 30, 2024
1 parent fed8f14 commit c9d2706
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions electronicparsers/cp2k/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2009,7 +2009,7 @@ def _parse_basis_set(self) -> list[BasisSet]:
bs_gauss = BasisSet(
scope=['kinetic energy', 'electron-core interaction'],
type='gaussians',
)
) # TODO: review partition in new parser
atoms = (
self.out_parser.get(self._calculation_type, {})
.get('atomic_kind_information', {})
Expand All @@ -2022,22 +2022,21 @@ def _parse_basis_set(self) -> list[BasisSet]:
ac.atom_number = self.get_atomic_number(atom.kind_label)
ac.name = basis_set
bs_gauss.atom_centered.append(ac)

basis_sets: list[BasisSet] = []
if bs_gauss.atom_centered:
bs_pw = BasisSet(
scope=['Hartree energy', 'electron-electron interaction'],
type='plane waves',
cutoff=self.settings.get('qs', {}).get('planewave_cutoff', None)
* ureg.hartree,
)
basis_sets = [bs_pw, bs_gauss]
basis_sets.append(bs_gauss)
pw_scope = ['Hartree energy', 'electron-electron interaction']
else:
bs_pw = BasisSet(
scope=['valence'],
type='plane waves',
cutoff=self.settings.get('qs', {}).get('planewave_cutoff', None)
* ureg.hartree,
)
basis_sets = [bs_pw]
pw_scope = ['valence']

bs_pw = BasisSet(
scope=pw_scope,
type='plane waves',
)
if (cutoff := self.settings.get('qs', {}).get('planewave_cutoff')) is not None:
bs_pw.cutoff = cutoff * ureg.hartree
basis_sets.append(bs_pw)
return basis_sets

def parse_method_quickstep(self):
Expand Down

0 comments on commit c9d2706

Please sign in to comment.