Skip to content

Commit

Permalink
less pylint disables (#903)
Browse files Browse the repository at this point in the history
  • Loading branch information
asanin-epfl authored Apr 29, 2021
1 parent dd03480 commit 14d7e99
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 25 deletions.
12 changes: 6 additions & 6 deletions neurom/features/bifurcationfunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from neurom import morphmath
from neurom.exceptions import NeuroMError
from neurom.core.dataformat import COLS
from neurom.features import sectionfunc
from neurom.features.sectionfunc import section_mean_radius


def _raise_if_not_bifurcation(section):
Expand Down Expand Up @@ -148,8 +148,8 @@ def sibling_ratio(bif_point, method='first'):
n = bif_point.children[0].points[1, COLS.R]
m = bif_point.children[1].points[1, COLS.R]
if method == 'mean':
n = sectionfunc.section_mean_radius(bif_point.children[0])
m = sectionfunc.section_mean_radius(bif_point.children[1])
n = section_mean_radius(bif_point.children[0])
m = section_mean_radius(bif_point.children[1])
return min(n, m) / max(n, m)


Expand All @@ -174,7 +174,7 @@ def diameter_power_relation(bif_point, method='first'):
d_child1 = bif_point.children[0].points[1, COLS.R]
d_child2 = bif_point.children[1].points[1, COLS.R]
if method == 'mean':
d_child = sectionfunc.section_mean_radius(bif_point)
d_child1 = sectionfunc.section_mean_radius(bif_point.children[0])
d_child2 = sectionfunc.section_mean_radius(bif_point.children[1])
d_child = section_mean_radius(bif_point)
d_child1 = section_mean_radius(bif_point.children[0])
d_child2 = section_mean_radius(bif_point.children[1])
return (d_child / d_child1)**(1.5) + (d_child / d_child2)**(1.5)
8 changes: 3 additions & 5 deletions neurom/features/neuritefunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@
from neurom.core.dataformat import COLS
from neurom.core.types import tree_type_checker as is_type
from neurom.features import _register_feature, bifurcationfunc, feature, neuronfunc, sectionfunc
from neurom.features.bifurcationfunc import partition_asymmetry
from neurom.features.sectionfunc import downstream_pathlength
from neurom.geom import convex_hull
from neurom.morphmath import interval_lengths

Expand Down Expand Up @@ -407,7 +405,7 @@ def partition_asymmetries(neurites, neurite_type=NeuriteType.all, variant='branc
found %s' % variant)

if variant == 'branch-order':
return map(partition_asymmetry,
return map(bifurcationfunc.partition_asymmetry,
iter_sections(neurites,
iterator_type=Section.ibifurcation_point,
neurite_filter=is_type(neurite_type)))
Expand All @@ -418,8 +416,8 @@ def partition_asymmetries(neurites, neurite_type=NeuriteType.all, variant='branc
for section in iter_sections(neurite,
iterator_type=Section.ibifurcation_point,
neurite_filter=is_type(neurite_type)):
pathlength_diff = abs(downstream_pathlength(section.children[0]) -
downstream_pathlength(section.children[1]))
pathlength_diff = abs(sectionfunc.downstream_pathlength(section.children[0]) -
sectionfunc.downstream_pathlength(section.children[1]))
asymmetries.append(pathlength_diff / neurite_length)
return asymmetries

Expand Down
2 changes: 1 addition & 1 deletion neurom/features/neuronfunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def _sort_angle(p1, p2):
"""Angle between p1-p2 to sort vectors."""
ang1 = np.arctan2(*p1[::-1])
ang2 = np.arctan2(*p2[::-1])
return (ang1 - ang2)
return ang1 - ang2

# Sorting angles according to x-y plane
order = np.argsort(np.array([_sort_angle(i / np.linalg.norm(i), [0, 1])
Expand Down
2 changes: 1 addition & 1 deletion neurom/morphmath.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def path_fraction_id_offset(points, fraction, relative_offset=False):
Returns:
(segment ID, segment offset) pair.
"""
if not (0. <= fraction <= 1.0):
if not 0. <= fraction <= 1.0:
raise ValueError("Invalid fraction: %.3f" % fraction)
lengths = interval_lengths(points)
cum_lengths = np.cumsum(lengths)
Expand Down
13 changes: 1 addition & 12 deletions pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,10 @@

[MESSAGES CONTROL]
#C0103 - Invalid name "%s" (should match %s) - matches too many things, like variables w/ single char names
#R0904 - Too Many public methods
#R0903 - Too Few public methods
#W0511 - TODO in code
#W0232 - Class has no __init__ method
#R0922 - Abstract class is only referenced 1 times
#R0801 - Similar lines in %d files
#R0921 - Abstract class not referenced
#W0141 - Used builtin function 'map'
#R0401 - cyclic-import
#I0013 - Ignore the 'Ignoring entire file' warning
#W0142 - Used * or ** magic
#W0622 - redefined-builti
#C0325 - superfluous-parens
#R0205 - useless-object-inheritance
disable=C0103,R0904,R0903,W0511,W0232,R0922,R0801,R0921,W0141,R0401,I0013,W0142,W0622,C0325,R0205
disable=C0103,R0903,W0511,R0401

[FORMAT]
# Maximum number of characters on a single line.
Expand Down

0 comments on commit 14d7e99

Please sign in to comment.