Skip to content

Commit

Permalink
Further revised type hinting
Browse files Browse the repository at this point in the history
  • Loading branch information
mranst committed Sep 17, 2024
1 parent c109c28 commit f4903b4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def make_boolean(
quest: str,
default: str,
prompt: questionary.text
) -> bool:
) -> str:

answer = prompt(quest, default=default, auto_enter=False).ask()

Expand Down
5 changes: 2 additions & 3 deletions src/swell/utilities/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@
# -----------------------------------------------------------------------------

from typing import Optional

from swell.utilities.logger import Logger
from logging import Logger as pyLogger


class SWELLError(Exception):

def __init__(
self,
message: str,
logger: Optional[Logger] = None
logger: Optional[pyLogger] = None
) -> None:

self.message = message
Expand Down
2 changes: 1 addition & 1 deletion src/swell/utilities/render_jedi_interface_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def render_oops_file(self, config_name: str) -> dict:
# ----------------------------------------------------------------------------------------------

# Prepare path to interface model file and call rendering
def render_interface_model(self, config_name: Optional[str]) -> dict[Any, Any]:
def render_interface_model(self, config_name: str) -> dict[Any, Any]:

# Assert that there is a jedi interface associated with the task
self.logger.assert_abort(self.jedi_interface is not None, f'In order to render a ' +
Expand Down
6 changes: 3 additions & 3 deletions src/swell/utilities/shell_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

def run_track_log_subprocess(
logger: Logger,
command: list[str],
command: Union[list[str], str],
output_log: Optional[str] = None
) -> None:

Expand Down Expand Up @@ -65,7 +65,7 @@ def run_track_log_subprocess(

def run_subprocess_dev_null(
logger: Logger,
command: list[str]
command: Union[list[str], str]
) -> None:

run_subprocess(logger, command, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
Expand All @@ -76,7 +76,7 @@ def run_subprocess_dev_null(

def run_subprocess(
logger: Logger,
command: list[str],
command: Union[list[str], str],
stdout: Union[int, IO[Any], None] = None,
stderr: Union[int, IO[Any], None] = None
) -> None:
Expand Down

0 comments on commit f4903b4

Please sign in to comment.