Skip to content

Commit cffae15

Browse files
committed
🐛 Fix pre-commit errors
1 parent 7d47b2b commit cffae15

File tree

3 files changed

+536
-243
lines changed

3 files changed

+536
-243
lines changed

examples/05-patch-prediction.ipynb

Lines changed: 533 additions & 241 deletions
Large diffs are not rendered by default.

pre-commit/notebook_markdown_format.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ def main(files: list[Path]) -> None:
5050
5151
"""
5252
for path in files:
53-
notebook = json.loads(path.read_text())
53+
with Path.open(path, encoding="utf-8", errors="ignore") as f:
54+
notebook = json.load(f)
5455
formatted_notebook = format_notebook(copy.deepcopy(notebook))
5556
changed = any(
5657
cell != formatted_cell

tiatoolbox/models/engine/engine_abc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636

3737
import copy
3838
from abc import ABC
39-
from collections.abc import Callable
4039
from pathlib import Path
4140
from typing import TYPE_CHECKING, TypedDict
4241

@@ -65,6 +64,7 @@
6564

6665
if TYPE_CHECKING: # pragma: no cover
6766
import os
67+
from collections.abc import Callable
6868

6969
from torch.utils.data import DataLoader
7070

0 commit comments

Comments
 (0)