Skip to content

Commit fc26020

Browse files
authoredJan 30, 2023
auto fixes from pre-commit.com hooks (#1198)
### Checks <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Avoid including large-size files in the PR. - [x] Clean up long text outputs from code cells in the notebook. - [x] For security purposes, please check the contents and remove any sensitive info such as user names and private key. - [x] Ensure (1) hyperlinks and markdown anchors are working (2) use relative paths for tutorial repo files (3) put figure and graphs in the `./figure` folder - [ ] Notebook runs automatically `./runner.sh -t <path to .ipynb file>` --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 9e4ac86 commit fc26020

File tree

171 files changed

+3512
-4299
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

171 files changed

+3512
-4299
lines changed
 

‎.github/contributing_templates/notebook/example_class.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717
from PIL import Image
1818

1919

20-
class ExampleImageGenerator():
20+
class ExampleImageGenerator:
2121
def __init__(self, num_image=40, image_size=(128, 128)):
2222
self.num_image = num_image
2323
self.image_size = image_size
2424

2525
def generate(self, tempdir):
2626
for i in range(self.num_image):
2727
im, seg = create_test_image_2d(
28-
self.image_size[0], self.image_size[1], num_seg_classes=1,random_state=np.random.RandomState(42)
28+
self.image_size[0], self.image_size[1], num_seg_classes=1, random_state=np.random.RandomState(42)
2929
)
3030
Image.fromarray((im * 255).astype("uint8")).save(os.path.join(tempdir, f"img{i:d}.png"))
3131
Image.fromarray((seg * 255).astype("uint8")).save(os.path.join(tempdir, f"seg{i:d}.png"))

‎.pre-commit-config.yaml

+5-24
Original file line numberDiff line numberDiff line change
@@ -22,30 +22,11 @@ repos:
2222
args: ['--maxkb=1024']
2323
- id: detect-private-key
2424

25-
#- repo: https://github.com/asottile/pyupgrade
26-
# rev: v2.23.2
27-
# hooks:
28-
# - id: pyupgrade
29-
# args: [--py36-plus]
30-
# name: Upgrade code
31-
32-
#- repo: https://github.com/asottile/yesqa
33-
# rev: v1.2.3
34-
# hooks:
35-
# - id: yesqa
36-
# name: Unused noqa
37-
38-
#- repo: https://github.com/PyCQA/isort
39-
# rev: 5.9.3
40-
# hooks:
41-
# - id: isort
42-
# name: Format imports
43-
44-
# - repo: https://github.com/psf/black
45-
# rev: 21.7b0
46-
# hooks:
47-
# - id: black
48-
# name: Format code
25+
- repo: https://github.com/psf/black
26+
rev: "22.12.0"
27+
hooks:
28+
- id: black
29+
- id: black-jupyter
4930

5031
#- repo: https://github.com/executablebooks/mdformat
5132
# rev: 0.7.8

0 commit comments

Comments
 (0)