Skip to content

Commit

Permalink
mypy errors fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
amandarichardsonn committed Sep 23, 2024
1 parent d689785 commit be2c195
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions smartsim/_core/generation/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,18 +202,21 @@ def _build_commands(
:return: A CommandList containing the file operation commands, or None if the entity
does not support file operations.
"""
if isinstance(job.entity, _GenerableProtocol):
entity = job.entity
if isinstance(entity, _GenerableProtocol):
cmd_list = CommandList()
helpers = [
helpers: t.List[
t.Callable[[EntityFiles | None, pathlib.Path], CommandList | None]
] = [
cls._copy_files,
cls._symlink_files,
lambda files, path: cls._write_tagged_files(
files, job.entity.file_parameters, path
files, entity.file_parameters, path
),
]

for method in helpers:
return_cmd_list = method(job.entity.files, job_path)
return_cmd_list = method(entity.files, job_path)
if return_cmd_list:
cmd_list.commands.extend(return_cmd_list.commands)

Expand Down

0 comments on commit be2c195

Please sign in to comment.