Skip to content

Commit

Permalink
Moving to neuromV2 (#133)
Browse files Browse the repository at this point in the history
* Moving to neuromV2
  • Loading branch information
tomdele committed Apr 21, 2021
1 parent cb6294f commit 9480da5
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 15 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Changelog
=========

Version v0.11.1
---------------

Improvements
~~~~~~~~~~~~~~
- Pinned major versions of neurom to >=2.0.0.


Version v0.11.0
---------------

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(self, *args, **kwargs):
'cached_property>=1.0',
'h5py>=3.0.1,<4.0.0',
'libsonata>=0.1.6,<1.0.0',
'neurom>=1.6,<2.0.0',
'neurom>=2.0.0,<3.0.0',
'numpy>=1.8,<2.0.0',
'pandas>=1.0.0,<2.0.0',
'click>=7.0,<8.0.0',
Expand Down
27 changes: 13 additions & 14 deletions tests/test_morph.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ def test_get_filepath(self):

def test_get_morphology(self):
actual = self.test_obj.get(0).points
assert len(actual) == 32
assert len(actual) == 13
expected = [
[-0.32, 1.0, 0., 0.725],
[-0.32, 0.9, 0., 0.820],
[0., 5., 0., 1.],
[2., 9., 0., 1.],
]
npt.assert_almost_equal(expected, actual[:2])

Expand All @@ -104,19 +104,18 @@ def test_get_morphology_simple_rotation(self):
)

actual = self.test_obj.get(node_id, transform=True).points
assert len(actual) == 32
assert len(actual) == 13
# swc file
# index type X Y Z radius parent
# 1 1 -0.320000 1.000000 0.000000 0.725000 -1
# 2 1 -0.320000 0.900000 0.000000 0.820000 1

# 22 2 0.000000 5.000000 0.000000 1.000000 1
# 23 2 2.000000 9.000000 0.000000 1.000000 22
# rotation around the x axis 90 degrees counter clockwise (swap Y and Z)
# x = X + 101, y = Z + 102, z = Y + 103, radius does not change
expected = [
[100.68, 102, 104.0, 0.725],
[100.68, 102, 103.9, 0.820]
[101., 102., 108., 1.],
[103., 102., 112., 1.]
]
npt.assert_almost_equal(expected, actual[:2])
npt.assert_almost_equal(actual[:2], expected)

def test_get_morphology_standard_rotation(self):
nodes = create_node_population(
Expand All @@ -141,12 +140,12 @@ def test_get_morphology_standard_rotation(self):
decimal=6
)

assert len(actual) == 32
assert len(actual) == 13
expected = [
[100.7637696, 103, 103.2158592, 0.725],
[100.7637696, 102.9, 103.2158592, 0.820]
[101., 107., 103., 1.],
[102.47644, 111., 101.65088, 1.]
]
npt.assert_almost_equal(expected, actual[:2])
npt.assert_almost_equal(actual[:2], expected, decimal=6)


@patch(test_module.__name__ + '.MORPH_CACHE_SIZE', 1)
Expand Down

0 comments on commit 9480da5

Please sign in to comment.