Skip to content

Commit 2324240

Browse files
committed
format again
1 parent a094183 commit 2324240

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

pytorch_lightning/callbacks/model_checkpoint.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ def __init__(self, filepath, monitor: str = 'val_loss', verbose: bool = False,
6161
mode: str = 'auto', period: int = 1, prefix: str = ''):
6262
super().__init__()
6363
if (
64-
save_top_k and
65-
os.path.isdir(filepath) and
66-
len(os.listdir(filepath)) > 0
64+
save_top_k
65+
and os.path.isdir(filepath)
66+
and len(os.listdir(filepath)) > 0
6767
):
6868
warnings.warn(
6969
f"Checkpoint directory {filepath} exists and is not empty with save_top_k != 0."
@@ -166,7 +166,8 @@ def on_validation_end(self):
166166
if len(self.best_k_models.keys()) == self.save_top_k:
167167
# monitor dict has reached k elements
168168
_op = max if self.mode == 'min' else min
169-
self.kth_best_model = _op(self.best_k_models, key=self.best_k_models.get)
169+
self.kth_best_model = _op(self.best_k_models,
170+
key=self.best_k_models.get)
170171
self.kth_value = self.best_k_models[self.kth_best_model]
171172

172173
_op = min if self.mode == 'min' else max

setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ markers =
1515

1616
[pycodestyle]
1717
ignore = E731,W504
18-
max-line-length = 120
18+
max-line-length = 100
1919

2020
[coverage:report]
2121
# TODO: this looks suspicion, it should be reviewed
@@ -51,7 +51,7 @@ omit =
5151

5252
[flake8]
5353
# TODO: this should be 88 or 100 according PEP8
54-
max-line-length = 120
54+
max-line-length = 100
5555
exclude = .tox,*.egg,build,temp
5656
select = E,W,F
5757
doctests = True

0 commit comments

Comments
 (0)