From ba0c67128bf0916905ba2e9e0572dcfe1f69560e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 16:44:57 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.8.6 → v0.9.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.8.6...v0.9.1) - [github.com/PyCQA/bandit.git: 1.8.0 → 1.8.2](https://github.com/PyCQA/bandit.git/compare/1.8.0...1.8.2) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5fbf159a..304bb3e8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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" ] @@ -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] From 1f53052887d6c6798ed16188c48aa82a302a2bae Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 16:45:11 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- simvue/client.py | 11 ++++------- simvue/config/files.py | 4 ++-- simvue/run.py | 7 +++---- simvue/system.py | 4 +--- 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/simvue/client.py b/simvue/client.py index d396264b..5936f9cb 100644 --- a/simvue/client.py +++ b/simvue/client.py @@ -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 {} @@ -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 @@ -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, ) @@ -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 diff --git a/simvue/config/files.py b/simvue/config/files.py index baa80c2f..f00bc6dc 100644 --- a/simvue/config/files.py +++ b/simvue/config/files.py @@ -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')}" diff --git a/simvue/run.py b/simvue/run.py index 7fec18aa..03aaf706 100644 --- a/simvue/run.py +++ b/simvue/run.py @@ -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) @@ -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) diff --git a/simvue/system.py b/simvue/system.py index 09357d49..7ea86eb9 100644 --- a/simvue/system.py +++ b/simvue/system.py @@ -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()