Skip to content

Commit ac42e6e

Browse files
authored
Merge pull request #10 from DeepPSP/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2 parents d89c4ea + bd3631f commit ac42e6e

14 files changed

Lines changed: 35 additions & 59 deletions

.github/workflows/check-formatting.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
build:
1414
if: contains(fromJson('["wenh06", "DeepPSP"]'), github.repository_owner)
1515

16-
runs-on: ubuntu-20.04
16+
runs-on: ubuntu-22.04
1717
strategy:
1818
matrix:
19-
python-version: [3.8, 3.9]
19+
python-version: ["3.10", "3.12"]
2020

2121
steps:
2222
- uses: actions/checkout@v4
@@ -28,7 +28,5 @@ jobs:
2828
run: |
2929
python -m pip install --upgrade pip setuptools wheel
3030
python -m pip install -r requirements.txt
31-
python -m pip install importlib-metadata==4.8.3 # Testing packages
32-
python -m pip install torch==1.10.0+cu113 -f https://download.pytorch.org/whl/torch_stable.html
3331
- name: Check code format with pre-commit
3432
uses: pre-commit/action@v3.0.1

.pre-commit-config.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@ fail_fast: false
44

55
repos:
66
- repo: https://github.com/pre-commit/pre-commit-hooks
7-
rev: v5.0.0
7+
rev: v6.0.0
88
hooks:
99
- id: end-of-file-fixer
1010
- id: trailing-whitespace
11-
- repo: https://github.com/psf/black
12-
rev: 24.8.0
11+
- repo: https://github.com/psf/black-pre-commit-mirror
12+
rev: 26.3.1
1313
hooks:
1414
- id: black
1515
args: [--line-length=128, --verbose]
1616
- repo: https://github.com/PyCQA/flake8
17-
rev: 7.1.1
17+
rev: 7.3.0
1818
hooks:
1919
- id: flake8
20-
args: [--max-line-length=128, '--exclude=./.*,build,dist,official*,torch_ecg,references,*.ipynb', '--ignore=E501,W503,E203,F841,E402,E231,E731', --count, --statistics, --show-source]
20+
args: [--max-line-length=128, '--exclude=./.*,build,dist,official*,torch_ecg,references,*.ipynb', '--ignore=E501,W503,E203,F841,E402,E231,E731,E226,E225', --count, --statistics, --show-source]
2121
- repo: https://github.com/pycqa/isort
22-
rev: 5.13.2
22+
rev: 8.0.1
2323
hooks:
2424
- id: isort
2525
args: [--profile=black, --line-length=128]

cfg.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""
2-
"""
1+
""" """
32

43
import os
54
from copy import deepcopy

data_reader.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
"""
3-
"""
2+
""" """
43

54
import json
65
import logging

dataset.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,14 +1252,10 @@ def _train_test_split(self, train_ratio: float = 0.8, force_recompute: bool = Fa
12521252
with open(test_file_1, "w") as f1, open(test_file_2, "w") as f2:
12531253
json.dump(test_set, f1, ensure_ascii=False)
12541254
json.dump(test_set, f2, ensure_ascii=False)
1255-
print(
1256-
nildent(
1257-
f"""
1255+
print(nildent(f"""
12581256
train set saved to \n\042{train_file_1}\042and\n\042{train_file_2}\042
12591257
test set saved to \n\042{test_file_1}\042and\n\042{test_file_2}\042
1260-
"""
1261-
)
1262-
)
1258+
"""))
12631259
else:
12641260
with open(train_file, "r") as f:
12651261
train_set = json.load(f)

gather_results.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""
2-
"""
1+
""" """
32

43
import glob
54
import json

requirements.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
numpy==1.22.0
2-
scipy==1.6.1
3-
joblib==1.2.0
1+
numpy
2+
scipy
3+
joblib
44
# Cython==0.29.10
5-
pandas==1.2.2
6-
scikit-learn==0.24.1
7-
wfdb==3.2.0
5+
pandas<3.0.0
6+
scikit-learn
7+
wfdb
88
# biosppy==0.6.1
99
biosppy
1010
opencv-python
1111
# tensorflow==1.15.2
1212
# keras==2.3.1
1313
packaging
1414
easydict
15-
torch==1.8.0 # see Dockerfile
15+
torch
1616
torchsummary
1717
tensorboardX
1818
tqdm

sample_data/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""
2-
"""
1+
""" """
32

43
import glob
54
import os

test_entry.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""
2-
"""
1+
""" """
32

43
import glob
54
import os

trainer.py

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""
2-
"""
1+
""" """
32

43
import argparse
54
import logging
@@ -149,8 +148,7 @@ def train(
149148
comment=f"OPT_{config.task}_{_model.__name__}{cnn_name}{rnn_name}{attn_name}_{config.train_optimizer}_LR_{lr}_BS_{batch_size}",
150149
)
151150

152-
msg = textwrap.dedent(
153-
f"""
151+
msg = textwrap.dedent(f"""
154152
Starting training:
155153
------------------
156154
Task: {config.task}
@@ -163,8 +161,7 @@ def train(
163161
Optimizer: {config.train_optimizer}
164162
Dataset classes: {train_dataset.all_classes}
165163
---------------------------------------------------
166-
"""
167-
)
164+
""")
168165

169166
if logger:
170167
logger.info(msg)
@@ -347,15 +344,13 @@ def train(
347344
else:
348345
eval_train_msg = ""
349346
for k, v in eval_res.items():
350-
msg = textwrap.dedent(
351-
f"""
347+
msg = textwrap.dedent(f"""
352348
Train epoch_{epoch + 1}:
353349
--------------------
354350
train/epoch_loss: {epoch_loss}{eval_train_msg}
355351
test/task_metric_{k}: {v}
356352
---------------------------------
357-
"""
358-
)
353+
""")
359354
if logger:
360355
logger.info(msg)
361356
else:
@@ -378,12 +373,10 @@ def train(
378373
print(msg)
379374
break
380375

381-
msg = textwrap.dedent(
382-
f"""
376+
msg = textwrap.dedent(f"""
383377
best metric = {best_metric},
384378
obtained at epoch {best_epoch}
385-
"""
386-
)
379+
""")
387380
if logger:
388381
logger.info(msg)
389382
else:

0 commit comments

Comments
 (0)