Skip to content

Commit d799a45

Browse files
[pre-commit.ci] Add auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 71675ac commit d799a45

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

cyclops/monitor/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ def load_model(model_path: str) -> Any:
289289
loaded pre-trained model
290290
291291
"""
292-
file_type = model_path.split(".")[-1]
292+
file_type = model_path.rsplit(".", maxsplit=1)[-1]
293293
if file_type in ("pkl", "pickle"):
294294
with open(model_path, "rb") as file:
295295
model = pickle.load(file)
@@ -310,7 +310,7 @@ def save_model(model: Any, output_path: str) -> None:
310310
path to save the model to
311311
312312
"""
313-
file_type = output_path.split(".")[-1]
313+
file_type = output_path.rsplit(".", maxsplit=1)[-1]
314314
if file_type in ("pkl", "pickle"):
315315
with open(output_path, "wb") as file:
316316
pickle.dump(model, file)

cyclops/report/report.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -966,8 +966,9 @@ def log_performance_metrics(
966966
results: Dict[str, Any],
967967
metric_descriptions: Dict[str, str],
968968
pass_fail_thresholds: Union[float, Dict[str, float]] = 0.7,
969-
pass_fail_threshold_fn: Callable[[float, float], bool] = lambda x,
970-
threshold: bool(x >= threshold),
969+
pass_fail_threshold_fn: Callable[[float, float], bool] = lambda x, threshold: (
970+
bool(x >= threshold)
971+
),
971972
) -> None:
972973
"""
973974
Log all performance metrics to the model card report.

docs/source/tutorials/nihcxr/monitor_api.ipynb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"source": [
2626
"\"\"\"NIHCXR Clinical Drift Experiments Tutorial.\"\"\"\n",
2727
"\n",
28-
"\n",
2928
"import random\n",
3029
"\n",
3130
"import numpy as np\n",

0 commit comments

Comments
 (0)