Skip to content

Commit f25a777

Browse files
enhanced readability in dft_params treatment
1 parent 4a0e9d2 commit f25a777

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

dpgen/generator/lib/cp2k.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,9 @@ def make_cp2k_input(sys_data, fp_params):
298298
atom_types = sys_data["atom_types"]
299299
# Get system charge if provided, default to 0
300300
charge = sys_data.get("charge", 0)
301-
if "MULTIPLICITY" in fp_params.get("FORCE_EVAL", {}).get("DFT", {}):
302-
multiplicity = fp_params["FORCE_EVAL"]["DFT"]["MULTIPLICITY"]
301+
dft_params = fp_params.get("FORCE_EVAL", {}).get("DFT", {})
302+
if "MULTIPLICITY" in dft_params:
303+
multiplicity = dft_params["MULTIPLICITY"]
303304
else:
304305
multiplicity = calculate_multiplicity(atom_names, atom_types, charge)
305306

0 commit comments

Comments
 (0)