Skip to content

Commit

Permalink
Circumvent type issue
Browse files Browse the repository at this point in the history
  • Loading branch information
al-rigazzi committed Sep 22, 2023
1 parent 2e7b2df commit b3c78da
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions smartsim/entity/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,16 @@ def attach_generator_files(
# Check that no file collides with the parameter file written
# by Generator. We check the basename, even though it is more
# restrictive than what we need (but it avoids relative path issues)
if any(
osp.basename(filename) == "smartsim_params.txt"
for filename in list(itertools.chain(to_copy, to_symlink, to_configure))
):
raise ValueError(
"`smartsim_params.txt` is a file automatically "
+ "generated by SmartSim and cannot be ovewritten."
)
for strategy in [to_copy, to_symlink, to_configure]:
if strategy is not None and any(
osp.basename(filename) == "smartsim_params.txt"
for filename in strategy
):
raise ValueError(
"`smartsim_params.txt` is a file automatically "
+ "generated by SmartSim and cannot be ovewritten."
)

self.files = EntityFiles(to_configure, to_copy, to_symlink)

@property
Expand Down

0 comments on commit b3c78da

Please sign in to comment.