Skip to content

Commit

Permalink
fix: link residuetypedat (#488)
Browse files Browse the repository at this point in the history
* fix: link residuetypedat
* create symlink by default without config option
  • Loading branch information
KRiedmiller authored Sep 13, 2024
1 parent d0c9859 commit 2576440
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/kimmdy/runmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,8 @@ def run(self):
logger.info("Start run")
self.start_time = time.time()

if getattr(self.config.restart, "run_directory", None):
if restart_dir := getattr(self.config.restart, "run_directory", None):
logger.info(f"Restarting from: {restart_dir}")
self._restart_from_rundir()

while (
Expand Down Expand Up @@ -447,7 +448,9 @@ def _setup(self, files: TaskFiles) -> TaskFiles:
if hasattr(self.config, f):
if path := self.latest_files.get(f):
logger.debug(f"Copying {path} to {files.outputdir}")
shutil.copy(path, files.outputdir / path.name)
shutil.copy(
path, files.outputdir / path.name, follow_symlinks=False
)
files.output[f] = files.outputdir / path.name

return files
Expand Down
4 changes: 4 additions & 0 deletions src/kimmdy/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ def create_task_directory(runmng, postfix: str) -> TaskFiles:
if runmng.config.ff is not None:
if not (files.outputdir / runmng.config.ff.name).exists():
(files.outputdir / runmng.config.ff.name).symlink_to(runmng.config.ff)
if not (files.outputdir / "residuetypes.dat").exists():
(files.outputdir / "residuetypes.dat").symlink_to(
runmng.config.ff / "residuetypes.dat"
)

return files

Expand Down

0 comments on commit 2576440

Please sign in to comment.