Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application.files refactor #732

Merged
merged 22 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions smartsim/_core/commands/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
"""Basic container for command information"""

def __init__(self, command: t.List[str]) -> None:
if not command:
raise ValueError("Command list cannot be empty")

Check warning on line 39 in smartsim/_core/commands/command.py

View check run for this annotation

Codecov / codecov/patch

smartsim/_core/commands/command.py#L39

Added line #L39 was not covered by tests
if not all(isinstance(item, str) for item in command):
raise ValueError("All items in the command list must be strings")
amandarichardsonn marked this conversation as resolved.
Show resolved Hide resolved
"""Command constructor"""
self._command = command

Expand Down
5 changes: 2 additions & 3 deletions smartsim/_core/entrypoints/file_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ def copy(parsed_args: argparse.Namespace) -> None:
/absolute/file/dest/path: Path to destination directory or path to
destination file
--dirs_exist_ok: if the flag is included, the copying operation will
continue if the destination directory and files alrady exist,
continue if the destination directory and files already exist,
and will be overwritten by corresponding files. If the flag is
not includedm and the destination file already exists, a
not included and the destination file already exists, a
FileExistsError will be raised
"""
if os.path.isdir(parsed_args.source):
Expand Down Expand Up @@ -226,7 +226,6 @@ def configure(parsed_args: argparse.Namespace) -> None:
for file_name in filenames:
src_file = os.path.join(dirpath, file_name)
dst_file = os.path.join(new_dir_dest, file_name)
print(type(substitutions))
_process_file(substitutions, src_file, dst_file)
else:
dst_file = parsed_args.dest / os.path.basename(parsed_args.source)
Expand Down
Loading
Loading