From 7ef31d926a61ae94eac96f839f440065eece0fd3 Mon Sep 17 00:00:00 2001 From: MikeG Date: Tue, 14 Jun 2022 08:54:00 +0200 Subject: [PATCH] remove single point contour somas in h5 and asc tests (#1045) * this is in prep for MorphIO to be more consistent and picky with contour somas --- tests/check/test_morphology_checks.py | 8 ++--- tests/check/test_morphtree.py | 3 +- tests/core/test_iter.py | 3 +- tests/data/h5/v1/ordering/sample.h5 | Bin 4140 -> 8172 bytes .../v1/ordering/sample_mixed_tree_sections.h5 | Bin 4108 -> 6060 bytes tests/features/test_get_features.py | 2 +- tests/features/test_section.py | 31 +++++++++--------- 7 files changed, 20 insertions(+), 27 deletions(-) diff --git a/tests/check/test_morphology_checks.py b/tests/check/test_morphology_checks.py index 3a3d0186c..0322f0fd2 100644 --- a/tests/check/test_morphology_checks.py +++ b/tests/check/test_morphology_checks.py @@ -387,7 +387,7 @@ def test__bool__(): def test_has_multifurcation(): m = load_morphology(StringIO(u""" - ((CellBody) (0 0 0 2)) + ((CellBody) (-1 0 0 2) (1 0 0 2)) ( (Color Blue) (Axon) (0 5 0 2) @@ -418,11 +418,7 @@ def test_has_multifurcation(): def test_has_unifurcation(): m = load_morphology(StringIO(u""" -("CellBody" - (Color Red) - (CellBody) - (0 0 0 2) - ) +((CellBody) (-1 0 0 2) (1 0 0 2)) ((Dendrite) (0 0 0 2) diff --git a/tests/check/test_morphtree.py b/tests/check/test_morphtree.py index ea4076d17..7137f49b7 100644 --- a/tests/check/test_morphtree.py +++ b/tests/check/test_morphtree.py @@ -41,8 +41,7 @@ def _generate_back_track_tree(n, dev): points = np.array(dev) + np.array([1, 3 if n == 0 else -3, 0]) m = load_morphology(StringIO(u""" - ((CellBody) - (0 0 0 0.4)) + ((CellBody) (-1 0 0 2) (1 0 0 2)) ((Dendrite) (0 0 0 0.4) diff --git a/tests/core/test_iter.py b/tests/core/test_iter.py index 01f3bc405..d7c86d08c 100644 --- a/tests/core/test_iter.py +++ b/tests/core/test_iter.py @@ -200,8 +200,7 @@ def test_iter_segments_pop(): def test_iter_segments_section(): sec = load_morphology(StringIO(u""" - ((CellBody) - (0 0 0 2)) + ((CellBody) (-1 0 0 2) (1 0 0 2)) ((Dendrite) (1 2 3 8) diff --git a/tests/data/h5/v1/ordering/sample.h5 b/tests/data/h5/v1/ordering/sample.h5 index 58dc61ce515797cc09ae482f394c612e43edb4ff..8f770a9be0eb8ec31cb108ee1380de9c9da7defd 100644 GIT binary patch delta 418 zcmZ3Z@Wy_E2Gbk)jaq$7j2e@7GU*EzOeL~3hK({f01%w#vz+46fkV8PgZn7h@vp$H$%%~#)q8S(tutR7FDa615W`GR%vur^U z14G7ULAG3`%?fOB5Mts1lloaRL13pnvQ7{iCXP_6(AcV1_Js(3}UkZu_+Q805aPRAOHXW diff --git a/tests/data/h5/v1/ordering/sample_mixed_tree_sections.h5 b/tests/data/h5/v1/ordering/sample_mixed_tree_sections.h5 index de692d4d9d2b1d9f03b7be0c5ada63779f8ffef8..5b9faf0e909f2867e7bea67221ae812a282a5839 100644 GIT binary patch delta 376 zcmeBCSff8dgK3TUMy)<3Mvcikne+t<@-y>FiWwLf86d!5;zsq!3d}cd`Ks2cyDfOO|5p zdXQPnU^NU3{7^PXwFnYh3dm*xVh~UTVh|goPaBDC2xYSYX>%m@teGIN(;g^<0-)lF h_Amu78m0=yhtm6D;xHOr9$g(we&R;y&9gaJ*#T($NKXI& delta 205 zcmZ3Z-=i==gNa9AqgEdiqr&8!O!}OR3=m*3aijiZ1!keiU95bJR+9sno%KOd%!~;f z5CsnGP?caxhyfxDQseL~Ih=u^V&cZy$p$POj2xRSS&F$6z`CJYcz`rB5QD@7k=Wuu bHWLtofD#ac*epP-fyCB>ve|&N2@)FsBS{lX diff --git a/tests/features/test_get_features.py b/tests/features/test_get_features.py index b0ac1be0f..0bb416e02 100644 --- a/tests/features/test_get_features.py +++ b/tests/features/test_get_features.py @@ -402,7 +402,7 @@ def test_segment_meander_angles(): def test_segment_meander_angles_single_section(): - m = nm.load_morphology(StringIO(u"""((CellBody) (0 0 0 0)) + m = nm.load_morphology(StringIO(u"""((CellBody) (-1 0 0 2) (1 0 0 2)) ((Dendrite) (0 0 0 2) (1 0 0 2) diff --git a/tests/features/test_section.py b/tests/features/test_section.py index d549410a9..6afb6defe 100644 --- a/tests/features/test_section.py +++ b/tests/features/test_section.py @@ -76,7 +76,7 @@ def test_segment_taper_rates(): def test_section_area(): - sec = load_morphology(StringIO(u"""((CellBody) (0 0 0 2)) + sec = load_morphology(StringIO(u"""((CellBody) (-1 0 0 2) (1 0 0 2)) ((Dendrite) (0 0 0 2) (1 0 0 2))"""), reader='asc').sections[SECTION_ID] @@ -85,7 +85,7 @@ def test_section_area(): def test_segment_areas(): - sec = load_morphology(StringIO(u"""((CellBody) (0 0 0 2)) + sec = load_morphology(StringIO(u"""((CellBody) (-1 0 0 2) (1 0 0 2)) ((Dendrite) (0 0 0 4) (1 0 0 4) @@ -95,7 +95,7 @@ def test_segment_areas(): def test_segment_volumes(): - sec = load_morphology(StringIO(u"""((CellBody) (0 0 0 2)) + sec = load_morphology(StringIO(u"""((CellBody) (-1 0 0 2) (1 0 0 2)) ((Dendrite) (0 0 0 4) (1 0 0 4) @@ -105,7 +105,7 @@ def test_segment_volumes(): def test_segment_mean_radii(): - sec = load_morphology(StringIO(u"""((CellBody) (0 0 0 2)) + sec = load_morphology(StringIO(u"""((CellBody) (-1 0 0 2) (1 0 0 2)) ((Dendrite) (0 0 0 2) (1 0 0 4) @@ -115,7 +115,7 @@ def test_segment_mean_radii(): def test_segment_midpoints(): - sec = load_morphology(StringIO(u"""((CellBody) (0 0 0 2)) + sec = load_morphology(StringIO(u"""((CellBody) (-1 0 0 2) (1 0 0 2)) ((Dendrite) (0 0 0 2) (1 0 0 4) @@ -126,7 +126,7 @@ def test_segment_midpoints(): def test_section_tortuosity(): sec_a = load_morphology(StringIO(u""" - ((CellBody) (0 0 0 2)) + ((CellBody) (-1 0 0 2) (1 0 0 2)) ((Dendrite) (0 0 0 2) (1 0 0 2) @@ -134,7 +134,7 @@ def test_section_tortuosity(): (3 0 0 2))"""), reader='asc').sections[SECTION_ID] sec_b = load_morphology(StringIO(u""" - ((CellBody) (0 0 0 2)) + ((CellBody) (-1 0 0 2) (1 0 0 2)) ((Dendrite) (0 0 0 2) (1 0 0 2) @@ -149,7 +149,7 @@ def test_section_tortuosity(): morphmath.section_length(s.points) / morphmath.point_dist(s.points[0], s.points[-1])) def test_setion_tortuosity_single_point(): - sec = load_morphology(StringIO(u"""((CellBody) (0 0 0 2)) + sec = load_morphology(StringIO(u"""((CellBody) (-1 0 0 2) (1 0 0 2)) ((Dendrite) (1 2 3 2))"""), reader='asc').sections[SECTION_ID] assert section.section_tortuosity(sec) == 1.0 @@ -157,7 +157,7 @@ def test_setion_tortuosity_single_point(): def test_section_tortuosity_looping_section(): sec = load_morphology(StringIO(u""" - ((CellBody) (0 0 0 2)) + ((CellBody) (-1 0 0 2) (1 0 0 2)) ((Dendrite) (0 0 0 2) (1 0 0 2) @@ -169,7 +169,7 @@ def test_section_tortuosity_looping_section(): def test_section_meander_angles(): - s0 = load_morphology(StringIO(u"""((CellBody) (0 0 0 0)) + s0 = load_morphology(StringIO(u"""((CellBody) (-1 0 0 2) (1 0 0 2)) ((Dendrite) (0 0 0 2) (1 0 0 2) @@ -178,7 +178,7 @@ def test_section_meander_angles(): (4 0 0 2))"""), reader='asc').sections[SECTION_ID] assert section.section_meander_angles(s0) == [math.pi, math.pi, math.pi] - s1 = load_morphology(StringIO(u"""((CellBody) (0 0 0 0)) + s1 = load_morphology(StringIO(u"""((CellBody) (-1 0 0 2) (1 0 0 2)) ((Dendrite) (0 0 0 2) (1 0 0 2) @@ -187,7 +187,7 @@ def test_section_meander_angles(): (2 2 0 2))"""), reader='asc').sections[SECTION_ID] assert section.section_meander_angles(s1) == [math.pi / 2, math.pi / 2, math.pi / 2] - s2 = load_morphology(StringIO(u"""((CellBody) (0 0 0 0)) + s2 = load_morphology(StringIO(u"""((CellBody) (-1 0 0 2) (1 0 0 2)) ((Dendrite) (0 0 0 2) (0 0 1 2) @@ -197,7 +197,7 @@ def test_section_meander_angles(): def test_section_meander_angles_single_segment(): - s = load_morphology(StringIO(u"""((CellBody) (0 0 0 0)) + s = load_morphology(StringIO(u"""((CellBody) (-1 0 0 2) (1 0 0 2)) ((Dendrite) (0 0 0 2) (1 1 1 2))"""), reader='asc').sections[SECTION_ID] @@ -212,7 +212,7 @@ def test_strahler_order(): def test_locate_segment_position(): - s = load_morphology(StringIO(u"""((CellBody) (0 0 0 0)) + s = load_morphology(StringIO(u"""((CellBody) (-1 0 0 2) (1 0 0 2)) ((Dendrite) (0 0 0 0) (3 0 4 200) @@ -231,8 +231,7 @@ def test_locate_segment_position(): def test_mean_radius(): n = load_morphology(StringIO(u""" - ((CellBody) - (0 0 0 1)) + ((CellBody) (-1 0 0 2) (1 0 0 2)) ((Dendrite) (0 0 0 0)