Skip to content

Commit

Permalink
Tweak behaviour of calculator.fromfile to avoid setting calc.director…
Browse files Browse the repository at this point in the history
…y prematurely
  • Loading branch information
elinscott committed Oct 8, 2024
1 parent 7891797 commit ef6c80d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/koopmans/calculators/_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,10 +356,10 @@ def fromfile(cls, filenames: Union[str, Path, List[str], List[Path]]):

# Read qe output file
for filename in [f for f in sanitized_filenames if f.suffix == cls.ext_out]:
calc.directory = filename.parent
calc.prefix = filename.stem
try:
calc.read_results()
with utils.chdir(filename.parent):
calc.read_results()
except Exception:
# Calculation could not be read; must have been incomplete
pass
Expand Down

0 comments on commit ef6c80d

Please sign in to comment.