Skip to content

Commit

Permalink
Add missing link for KIPZ
Browse files Browse the repository at this point in the history
  • Loading branch information
elinscott committed Oct 8, 2024
1 parent 090fe3b commit dbc4fb8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/koopmans/calculators/_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,8 @@ def fromdict(cls: Type[TCalc], dct: Any) -> TCalc:
setattr(calc, k.lstrip('_'), v)
return calc

def link_file(self, src_calc: utils.HasDirectory | None, src_filename: Path, dest_filename: Path, symlink: bool = False,
recursive_symlink: bool = False, overwrite: bool = False):
def link_file(self, src_calc: utils.HasDirectory | None, src_filename: Path, dest_filename: Path,
symlink: bool = False, recursive_symlink: bool = False, overwrite: bool = False):
if src_filename.is_absolute() and src_calc is not None:
raise ValueError(f'`src_filename` in `{self.__class__.__name__}.link_file()` must be a relative path if a '
f'`src_calc` is provided')
Expand Down
7 changes: 3 additions & 4 deletions src/koopmans/workflows/_koopmans_dscf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1248,9 +1248,8 @@ def _run(self) -> None:

elif self.parameters.functional == 'kipz':
# DFT from scratch
calc = internal_new_kcp_calculator(self, 'dft_init')
calc.directory = Path('init')
self.run_calculator(calc, enforce_spin_symmetry=self.parameters.fix_spin_contamination)
calc_dft = internal_new_kcp_calculator(self, 'dft_init')
self.run_calculator(calc_dft, enforce_spin_symmetry=self.parameters.fix_spin_contamination)

if self.parameters.init_orbitals == 'kohn-sham':
# Initialize the density with DFT and use the KS eigenfunctions as guesses for the variational orbitals
Expand All @@ -1260,7 +1259,7 @@ def _run(self) -> None:
elif self.parameters.init_orbitals == 'pz':
# PZ from DFT (generating PZ density and PZ orbitals)
calc = internal_new_kcp_calculator(self, 'pz_init')
calc.directory = Path('init')
self.link(calc_dft, calc_dft.write_directory, calc, calc.read_directory, recursive_symlink=True)
self.run_calculator(calc)
else:
raise ValueError('Should not arrive here')
Expand Down

0 comments on commit dbc4fb8

Please sign in to comment.