Skip to content

Commit

Permalink
Env: dict -> Mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
MattToast committed Jun 26, 2024
1 parent 2f5cad7 commit da2b2c4
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion smartsim/settings/builders/launch/alps.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def set(self, key: str, value: str | None) -> None:
self._launch_args[key] = value

def finalize(
self, exe: ExecutableLike, env: dict[str, str | None]
self, exe: ExecutableLike, env: t.Mapping[str, str | None]
) -> t.Sequence[str]:
return (
"aprun",
Expand Down
2 changes: 1 addition & 1 deletion smartsim/settings/builders/launch/dragon.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def set(self, key: str, value: str | None) -> None:
self._launch_args[key] = value

def finalize(
self, exe: ExecutableLike, env: dict[str, str | None]
self, exe: ExecutableLike, env: t.Mapping[str, str | None]
) -> DragonRunRequest:
exe_, *args = exe.as_program_arguments()
return DragonRunRequest(

Check warning on line 75 in smartsim/settings/builders/launch/dragon.py

View check run for this annotation

Codecov / codecov/patch

smartsim/settings/builders/launch/dragon.py#L74-L75

Added lines #L74 - L75 were not covered by tests
Expand Down
2 changes: 1 addition & 1 deletion smartsim/settings/builders/launch/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,6 @@ def set(self, key: str, value: str | None) -> None:
self._launch_args[key] = value

def finalize(
self, exe: ExecutableLike, env: dict[str, str | None]
self, exe: ExecutableLike, env: t.Mapping[str, str | None]
) -> t.Sequence[str]:
return exe.as_program_arguments()

Check warning on line 84 in smartsim/settings/builders/launch/local.py

View check run for this annotation

Codecov / codecov/patch

smartsim/settings/builders/launch/local.py#L84

Added line #L84 was not covered by tests
2 changes: 1 addition & 1 deletion smartsim/settings/builders/launch/lsf.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def set(self, key: str, value: str | None) -> None:
self._launch_args[key] = value

def finalize(
self, exe: ExecutableLike, env: dict[str, str | None]
self, exe: ExecutableLike, env: t.Mapping[str, str | None]
) -> t.Sequence[str]:
return (
"jsrun",
Expand Down
6 changes: 3 additions & 3 deletions smartsim/settings/builders/launch/mpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def launcher_str(self) -> str:
return LauncherType.Mpirun.value

def finalize(
self, exe: ExecutableLike, env: dict[str, str | None]
self, exe: ExecutableLike, env: t.Mapping[str, str | None]
) -> t.Sequence[str]:
return ("mpirun", *self.format_launch_args(), "--", *exe.as_program_arguments())

Check warning on line 230 in smartsim/settings/builders/launch/mpi.py

View check run for this annotation

Codecov / codecov/patch

smartsim/settings/builders/launch/mpi.py#L230

Added line #L230 was not covered by tests

Expand All @@ -237,7 +237,7 @@ def launcher_str(self) -> str:
return LauncherType.Mpiexec.value

def finalize(
self, exe: ExecutableLike, env: dict[str, str | None]
self, exe: ExecutableLike, env: t.Mapping[str, str | None]
) -> t.Sequence[str]:
return (

Check warning on line 242 in smartsim/settings/builders/launch/mpi.py

View check run for this annotation

Codecov / codecov/patch

smartsim/settings/builders/launch/mpi.py#L242

Added line #L242 was not covered by tests
"mpiexec",
Expand All @@ -254,7 +254,7 @@ def launcher_str(self) -> str:
return LauncherType.Orterun.value

def finalize(
self, exe: ExecutableLike, env: dict[str, str | None]
self, exe: ExecutableLike, env: t.Mapping[str, str | None]
) -> t.Sequence[str]:
return (

Check warning on line 259 in smartsim/settings/builders/launch/mpi.py

View check run for this annotation

Codecov / codecov/patch

smartsim/settings/builders/launch/mpi.py#L259

Added line #L259 was not covered by tests
"orterun",
Expand Down
2 changes: 1 addition & 1 deletion smartsim/settings/builders/launch/pals.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def set(self, key: str, value: str | None) -> None:
self._launch_args[key] = value

def finalize(
self, exe: ExecutableLike, env: dict[str, str | None]
self, exe: ExecutableLike, env: t.Mapping[str, str | None]
) -> t.Sequence[str]:
return (
"mpiexec",
Expand Down
2 changes: 1 addition & 1 deletion smartsim/settings/builders/launch/slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def set(self, key: str, value: str | None) -> None:
self._launch_args[key] = value

def finalize(
self, exe: ExecutableLike, env: dict[str, str | None]
self, exe: ExecutableLike, env: t.Mapping[str, str | None]
) -> t.Sequence[str]:
return (
"srun",
Expand Down
2 changes: 1 addition & 1 deletion smartsim/settings/builders/launchArgBuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def set(self, arg: str, val: str | None) -> None:
"""Set the launch arguments"""

@abstractmethod
def finalize(self, exe: ExecutableLike, env: dict[str, str | None]) -> _T:
def finalize(self, exe: ExecutableLike, env: t.Mapping[str, str | None]) -> _T:
"""Prepare an entity for launch using the built options"""

def format_launch_args(self) -> t.Union[t.List[str], None]:
Expand Down

0 comments on commit da2b2c4

Please sign in to comment.