Skip to content

Commit

Permalink
fix pylints
Browse files Browse the repository at this point in the history
  • Loading branch information
mgeplf committed May 28, 2024
1 parent c3ff5c3 commit a1e2c3f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions neurom/features/bifurcation.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,17 @@ def sibling_ratio(bif_point, method='first'):
if method not in {'first', 'mean'}:
raise ValueError('Please provide a valid method for sibling ratio, found %s' % method)

n = m = 0

if method == 'first':
# the first point is the same as the parent last point
n = bif_point.children[0].points[1, COLS.R]
m = bif_point.children[1].points[1, COLS.R]

if method == 'mean':
n = neurom.features.section.section_mean_radius(bif_point.children[0])
m = neurom.features.section.section_mean_radius(bif_point.children[1])

return min(n, m) / max(n, m)


Expand All @@ -181,15 +185,19 @@ def diameter_power_relation(bif_point, method='first'):
if method not in {'first', 'mean'}:
raise ValueError('Please provide a valid method for sibling ratio, found %s' % method)

d_child = d_child1 = d_child2 = 0

if method == 'first':
# the first point is the same as the parent last point
d_child = bif_point.points[-1, COLS.R]
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 = neurom.features.section.section_mean_radius(bif_point)
d_child1 = neurom.features.section.section_mean_radius(bif_point.children[0])
d_child2 = neurom.features.section.section_mean_radius(bif_point.children[1])

return (d_child / d_child1) ** (1.5) + (d_child / d_child2) ** (1.5)


Expand Down
2 changes: 1 addition & 1 deletion neurom/features/population.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def sholl_frequency(morphs, neurite_type=NeuriteType.all, step_size=10, bins=Non
morphs(list|Population): list of morphologies or morphology population
neurite_type(NeuriteType): which neurites to operate on
step_size(float): step size between Sholl radii
bins(Iterable[float]: custom binning to use for the Sholl radii.
bins(Iterable[float]): custom binning to use for the Sholl radii.
If None, it uses intervals of step_size between min and max radii of ``morphs``.
use_subtrees (bool): Enable mixed subtree processing.
Expand Down

0 comments on commit a1e2c3f

Please sign in to comment.