8000 Specify black line length is 88 characters by StellarStorm · Pull Request #120 · loli/medpy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Specify black line length is 88 characters #120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ repos:
rev: 23.12.0
hooks:
- id: black
args: ["--line-length=88"]

- repo: https://github.com/hadialqattan/pycln
rev: "v2.4.0"
Expand Down
5 changes: 1 addition & 4 deletions doc/numpydoc/numpydoc/linkcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@ def doctree_read(app, doctree):
raise LinkcodeError("Function `linkcode_resolve` is not given in conf.py")

domain_keys = dict(
py=["module", "fullname"],
c=["names"],
cpp=["names"],
js=["object", "fullname"],
py=["module", "fullname"], c=["names"], cpp=["names"], js=["object", "fullname"]
)

for objnode in doctree.traverse(addnodes.desc):
Expand Down
4 changes: 2 additions & 2 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
("index", "MedPy.tex", "MedPy Documentation", "Oskar Maier", "manual"),
("index", "MedPy.tex", "MedPy Documentation", "Oskar Maier", "manual")
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -271,7 +271,7 @@
"MedPy",
"One line description of project.",
"Miscellaneous",
),
)
]

# Documents to append as an appendix to all manuals.
Expand Down
5 changes: 1 addition & 4 deletions tests/filter_/anisotropic_diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,5 @@ def test_anisotropic_diffusion_voxel_spacing_array():
# Purpose of this test is to ensure the filter code does not crash
# Depending on Python versions
arr = np.random.uniform(size=(60, 31, 3))
filtered = anisotropic_diffusion(
arr,
voxelspacing=np.array([1, 1, 1.0]),
)
filtered = anisotropic_diffusion(arr, voxelspacing=np.array([1, 1, 1.0]))
assert filtered.shape == arr.shape
96 changes: 12 additions & 84 deletions tests/filter_/houghtransform.py
10000
Original file line number Diff line number Diff line change
Expand Up @@ -195,94 +195,22 @@ def test_template_ellipsoid(self):
# prepare
expected = [
[
[
False,
False,
False,
False,
False,
],
[
False,
True,
True,
True,
False,
],
[
False,
True,
True,
True,
False,
],
[
False,
False,
False,
False,
False,
],
[False, False, False, False, False],
[False, True, True, True, False],
[False, True, True, True, False],
[False, False, False, False, False],
],
[
[
False,
True,
True,
True,
False,
],
[
True,
True,
True,
True,
True,
],
[
True,
True,
True,
True,
True,
],
[
False,
True,
True,
True,
False,
],
[False, True, True, True, False],
[True, True, True, True, True],
[True, True, True, True, True],
[False, True, True, True, False],
],
[
[
False,
False,
False,
False,
False,
],
[
False,
True,
True,
True,
False,
],
[
False,
True,
True,
True,
False,
],
[
False,
False,
False,
False,
False,
],
[False, False, False, False, False],
[False, True, True, True, False],
[False, True, True, True, False],
[False, False, False, False, False],
],
]

Expand Down
24 changes: 2 additions & 22 deletions tests/graphcut_/energy_label.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,7 @@ class TestEnergyLabel(unittest.TestCase):

# dedicated function tests
def test_boundary_stawiaski(self):
label = [
[[1, 1], [1, 1]],
[[1, 2], [2, 2]],
[
[2, 2],
[
2,
2,
],
],
]
label = [[[1, 1], [1, 1]], [[1, 2], [2, 2]], [[2, 2], [2, 2]]]
expected_result = {(0, 1): (6, 6)}
self.__run_boundary_stawiaski_test(
label, numpy.zeros_like(label), expected_result, "3D images"
Expand Down Expand Up @@ -146,17 +136,7 @@ def test_exception_not_starting_with_index_one(self):
assert_raises(AttributeError, bt, None, label, (None, None))

def test_boundary_difference_of_means_borders(self):
label = [
[[1, 1], [1, 1]],
[[1, 2], [2, 2]],
[
[2, 2],
[
2,
2,
],
],
]
label = [[[1, 1], [1, 1]], [[1, 2], [2, 2]], [[2, 2], [2, 2]]]
expected_result = {(0, 1): (sys.float_info.min, sys.float_info.min)}
self.__run_boundary_difference_of_means_test(
label, numpy.zeros_like(label), expected_result, "3D images"
Expand Down
0