Skip to content

Commit

Permalink
Remove Makefile and fix grower
Browse files Browse the repository at this point in the history
Change-Id: Ia3171df8d2e6ad48d9dd8a35e62ff859db11bac0
  • Loading branch information
Benoît Coste committed Feb 6, 2019
1 parent 9655179 commit f7d6f3c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 50 deletions.
47 changes: 0 additions & 47 deletions Makefile

This file was deleted.

4 changes: 2 additions & 2 deletions tests/test_neuron_grower.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ def test_grow_soma():

with patch.object(g, '_grow_trunks'):
# 2 neurite case
g.soma.points3D = np.array([[0,0,0], [1,1,1]])
g.soma.points3D = [[0,0,0], [1,1,1]]
g._grow_soma()
assert_array_equal(g.neuron.soma.points, [[0.5, 0.5, 0.5]])
assert_array_almost_equal(g.neuron.soma.diameters, [1.732051])

# normal case
g.soma.points3D = np.array([[0,0,0], [1,0,0], [0,1,1], [1,0,0]])
g.soma.points3D = [[0,0,0], [1,0,0], [0,1,1], [1,0,0]]
g._grow_soma()
assert_array_equal(g.neuron.soma.points,
[[0., 0., 0.],
Expand Down
3 changes: 2 additions & 1 deletion tns/generate/grower.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ def _grow_soma(self, interpolation=None):
points = self.soma.points3D
if len(points) == 2:
self.neuron.soma.points = [np.mean(points, axis=0)]
self.neuron.soma.diameters = [np.linalg.norm(points[0] - points[1])]
self.neuron.soma.diameters = [
np.linalg.norm(np.array(points[0]) - np.asarray(points[1]))]
else:
self.neuron.soma.points = self.soma.generate_neuron_soma_points3D(
interpolation=interpolation).tolist()
Expand Down

0 comments on commit f7d6f3c

Please sign in to comment.