Skip to content

Commit 7d8da9e

Browse files
committed
Dedup DFT grid keyword the same way as SCF/DLPNO
The DFT branch unconditionally appended defgrid2/defgrid3 via add_to_args, so a user who set their own defgrid keyword for a DFT sp_level got it twice in the ! line. Apply the same setdefault pattern we just used for scf_convergence and dlpno_threshold under the key 'dft_grid', so the default only lands when the user hasn't already supplied one.
1 parent 70c391f commit 7d8da9e

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

arc/job/adapters/orca.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -290,11 +290,9 @@ def write_input_file(self) -> None:
290290
# Orca requires different blocks for wavefunction methods and DFT methods
291291
if self.level.method_type == 'dft':
292292
input_dict['method_class'] = 'KS'
293-
# DFT grid must be the same for both opt and freq
294-
if self.fine:
295-
self.add_to_args(val='defgrid3', key1='keyword')
296-
else:
297-
self.add_to_args(val='defgrid2', key1='keyword')
293+
# DFT grid must be the same for both opt and freq.
294+
# Users can override by setting `dft_grid` in args.keyword (e.g. dft_grid: DEFGRID1).
295+
self.args['keyword'].setdefault('dft_grid', 'defgrid3' if self.fine else 'defgrid2')
298296
elif self.level.method_type == 'wavefunction':
299297
input_dict['method_class'] = 'HF'
300298
if 'dlpno' in self.level.method:

0 commit comments

Comments
 (0)