Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 13d5653

Browse files
committed
Update black formatting
1 parent 84535fa commit 13d5653

File tree

7 files changed

+17
-8
lines changed

7 files changed

+17
-8
lines changed

‎.pre-commit-config.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/psf/black
3-
rev: 21.12b0
3+
rev: 22.3.0
44
hooks:
55
- id: black
66
args: [ --config=pyproject.toml ]

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ $ pip install git+https://github.com/qubvel/segmentation_models.pytorch
429429
430430
##### Install linting and formatting pre-commit hooks
431431
```bash
432-
pip install pre-commit black flake8
432+
pip install pre-commit black==22.3.0 flake8==4.0.1
433433
pre-commit install
434434
```
435435

‎segmentation_models_pytorch/encoders/_base.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def out_channels(self):
2121

2222
@property
2323
def output_stride(self):
24-
return min(self._output_stride, 2**self._depth)
24+
return min(self._output_stride, 2**self._depth)
2525

2626
def set_in_channels(self, in_channels, pretrained=True):
2727
"""Change first convolution channels"""

‎segmentation_models_pytorch/encoders/timm_universal.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ def out_channels(self):
3939

4040
@property
4141
def output_stride(self):
42-
return min(self._output_stride, 2**self._depth)
42+
return min(self._output_stride, 2**self._depth)

‎segmentation_models_pytorch/metrics/functional.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,8 @@ def _compute_metric(
300300

301301

302302
def _fbeta_score(tp, fp, fn, tn, beta=1):
303-
beta_tp = (1 + beta**2) * tp
304-
beta_fn = (beta**2) * fn
303+
beta_tp = (1 + beta**2) * tp
304+
beta_fn = (beta**2) * fn
305305
score = beta_tp / (beta_tp + beta_fn + fp)
306306
return score
307307

‎segmentation_models_pytorch/utils/functional.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def f_score(pr, gt, beta=1, eps=1e-7, threshold=None, ignore_channels=None):
5858
fp = torch.sum(pr) - tp
5959
fn = torch.sum(gt) - tp
6060

61-
score = ((1 + beta**2) * tp + eps) / ((1 + beta**2) * tp + beta**2 * fn + fp + eps)
61+
score = ((1 + beta**2) * tp + eps) / ((1 + beta**2) * tp + beta**2 * fn + fp + eps)
6262

6363
return score
6464

‎setup.py‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,16 @@
3535
REQUIRED = []
3636

3737
# What packages are optional?
38-
EXTRAS = {"test": ["pytest", "mock", "pre-commit", "flake8==4.0.1", "flake8-docstrings==1.6.0"]}
38+
EXTRAS = {
39+
"test": [
40+
"pytest",
41+
"mock",
42+
"pre-commit",
43+
"black==22.3.0",
44+
"flake8==4.0.1",
45+
"flake8-docstrings==1.6.0",
46+
],
47+
}
3948

4049
# Import the README and use it as the long-description.
4150
# Note: this will only work if 'README.md' is present in your MANIFEST.in file!

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /