Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ repos:
args: [--branch, main, --branch, dev]
- id: check-added-large-files
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
rev: v0.9.1
hooks:
- id: ruff
args: [ --fix, --exit-non-zero-on-fix, "--ignore=C901" ]
Expand All @@ -35,7 +35,7 @@ repos:
pass_filenames: false

- repo: https://github.com/PyCQA/bandit.git
rev: 1.8.0
rev: 1.8.2
hooks:
- id: bandit
args: [-lll, --recursive, clumper]
11 changes: 4 additions & 7 deletions simvue/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,8 +543,7 @@ def delete_folder(
return None
else:
raise RuntimeError(
f"Deletion of folder '{folder_path}' failed, "
"folder does not exist."
f"Deletion of folder '{folder_path}' failed, folder does not exist."
)

params: dict[str, bool] = {"runs": True} if remove_runs else {}
Expand Down Expand Up @@ -906,8 +905,7 @@ def get_artifacts_as_files(
future.result()
except Exception as e:
raise RuntimeError(
f"Download of file {download['url']} "
f"failed with exception: {e}"
f"Download of file {download['url']} failed with exception: {e}"
)

@prettify_pydantic
Expand Down Expand Up @@ -1063,7 +1061,7 @@ def _get_run_metrics_from_server(

json_response = self._get_json_from_response(
expected_status=[http.HTTPStatus.OK],
scenario=f"Retrieval of metrics '{metric_names}' in " f"runs '{run_ids}'",
scenario=f"Retrieval of metrics '{metric_names}' in runs '{run_ids}'",
response=metrics_response,
)

Expand Down Expand Up @@ -1235,8 +1233,7 @@ def plot_metrics(

if data is None:
raise RuntimeError(
f"Cannot plot metrics {metric_names}, "
f"no data found for runs {run_ids}."
f"Cannot plot metrics {metric_names}, no data found for runs {run_ids}."
)

# Undo multi-indexing
Expand Down
4 changes: 2 additions & 2 deletions simvue/config/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
CONFIG_FILE_NAMES: list[str] = ["simvue.toml", ".simvue.toml"]

CONFIG_INI_FILE_NAMES: list[str] = [
f'{pathlib.Path.cwd().joinpath("simvue.ini")}',
f'{pathlib.Path.home().joinpath(".simvue.ini")}',
f"{pathlib.Path.cwd().joinpath('simvue.ini')}",
f"{pathlib.Path.home().joinpath('.simvue.ini')}",
]

DEFAULT_OFFLINE_DIRECTORY: str = f"{pathlib.Path.home().joinpath('.simvue')}"
7 changes: 3 additions & 4 deletions simvue/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ def _wrapper(self: Self, *args: typing.Any, **kwargs: typing.Any) -> typing.Any:

if not self._simvue:
raise RuntimeError(
"Simvue Run must be initialised before calling "
f"'{function.__name__}'"
f"Simvue Run must be initialised before calling '{function.__name__}'"
)
return function(self, *args, **kwargs)

Expand Down Expand Up @@ -852,13 +851,13 @@ def callback_function(status_code: int, std_out: str, std_err: str) -> None:
if isinstance(val, bool) and val:
cmd_list += [f"-{kwarg}"]
else:
cmd_list += [f"-{kwarg}{(' '+ _quoted_val) if val else ''}"]
cmd_list += [f"-{kwarg}{(' ' + _quoted_val) if val else ''}"]
else:
kwarg = kwarg.replace("_", "-")
if isinstance(val, bool) and val:
cmd_list += [f"--{kwarg}"]
else:
cmd_list += [f"--{kwarg}{(' '+_quoted_val) if val else ''}"]
cmd_list += [f"--{kwarg}{(' ' + _quoted_val) if val else ''}"]

cmd_list += pos_args
cmd_str = " ".join(cmd_list)
Expand Down
4 changes: 1 addition & 3 deletions simvue/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ def get_system() -> dict[str, typing.Any]:
system["cwd"] = os.getcwd()
system["hostname"] = socket.gethostname()
system["pythonversion"] = (
f"{sys.version_info.major}."
f"{sys.version_info.minor}."
f"{sys.version_info.micro}"
f"{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}"
)
system["platform"] = {}
system["platform"]["system"] = platform.system()
Expand Down
Loading