Fix: Better first_point fix #604
221 tests run, 188 passed, 0 skipped, 33 failed.
Annotations
Check failure on line 79 in tests/test_algo.py
github-actions / JUnit Test Report
test_algo.test_TMDApicalAlgo
AssertionError:
Arrays are not almost equal to 6 decimals
Mismatched elements: 3 / 3 (100%)
Max absolute difference: 0.57735
Max relative difference: 1.
x: array([0, 1, 0])
y: array([0.57735, 0.57735, 0.57735])
Raw output
def test_TMDApicalAlgo():
algo, grower = _setup_test(TMDApicalAlgo, SectionGrowerPath)
stop, num_sec = algo.initialize()
expected_stop = {"TMD": TMDStop(bif_id=1, bif=9.7747, term_id=0, term=159.798, ref=0.0)}
assert stop == expected_stop
assert_equal(num_sec, 10)
grower.id = 1
s1, s2 = algo.bifurcate(grower)
assert_equal(algo.apical_section, 1)
> _assert_dict_or_array(
s1,
{
"direction": [0.57735, 0.57735, 0.57735],
"process": "major",
"first_point": [1.1, 0.0, 0.0],
"stop": {"TMD": TMDStop(bif_id=2, bif=18.5246, term_id=0, term=159.798, ref=0.0)},
},
)
tests/test_algo.py:240:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_algo.py:79: in _assert_dict_or_array
assert_array_almost_equal(dict1[key], dict2[key])
/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/contextlib.py:81: in inner
return func(*args, **kwds)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<function assert_array_almost_equal.<locals>.compare at 0x7f635b9c14e0>, array([0, 1, 0]), [0.57735, 0.57735, 0.57735])
kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 6 decimals', 'precision': 6, 'verbose': True}
@wraps(func)
def inner(*args, **kwds):
with self._recreate_cm():
> return func(*args, **kwds)
E AssertionError:
E Arrays are not almost equal to 6 decimals
E
E Mismatched elements: 3 / 3 (100%)
E Max absolute difference: 0.57735
E Max relative difference: 1.
E x: array([0, 1, 0])
E y: array([0.57735, 0.57735, 0.57735])
/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/contextlib.py:81: AssertionError
Check failure on line 79 in tests/test_algo.py
github-actions / JUnit Test Report
test_algo.test_TMDGradientAlgo
AssertionError:
Arrays are not almost equal to 6 decimals
Mismatched elements: 3 / 3 (100%)
Max absolute difference: 0.57735
Max relative difference: 1.
x: array([0, 1, 0])
y: array([0.57735, 0.57735, 0.57735])
Raw output
def test_TMDGradientAlgo():
algo, grower = _setup_test(TMDGradientAlgo, SectionGrowerPath)
stop, num_sec = algo.initialize()
expected_stop = {"TMD": TMDStop(bif_id=1, bif=9.7747, term_id=0, term=159.798, ref=0.0)}
assert stop == expected_stop
assert_equal(num_sec, 10)
s1, s2 = algo.bifurcate(grower)
> _assert_dict_or_array(
s1,
{
"direction": [0.57735, 0.57735, 0.57735],
"process": "major",
"first_point": [1.1, 0.0, 0.0],
"stop": {"TMD": TMDStop(bif_id=2, bif=18.5246, term_id=0, term=159.798, ref=0.0)},
},
)
tests/test_algo.py:294:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_algo.py:79: in _assert_dict_or_array
assert_array_almost_equal(dict1[key], dict2[key])
/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/contextlib.py:81: in inner
return func(*args, **kwds)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<function assert_array_almost_equal.<locals>.compare at 0x7f635b890b80>, array([0, 1, 0]), [0.57735, 0.57735, 0.57735])
kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 6 decimals', 'precision': 6, 'verbose': True}
@wraps(func)
def inner(*args, **kwds):
with self._recreate_cm():
> return func(*args, **kwds)
E AssertionError:
E Arrays are not almost equal to 6 decimals
E
E Mismatched elements: 3 / 3 (100%)
E Max absolute difference: 0.57735
E Max relative difference: 1.
E x: array([0, 1, 0])
E y: array([0.57735, 0.57735, 0.57735])
/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/contextlib.py:81: AssertionError
Check failure on line 297 in tests/test_neuron_functional.py
github-actions / JUnit Test Report
test_neuron_functional.test_breaker_of_tmd_algo
AssertionError:
Arrays are not almost equal to 5 decimals
Mismatched elements: 3 / 3 (100%)
Max absolute difference: 165.69951562
Max relative difference: 3.15924248
x: array([ -4.75533, 174.88641, -9.35779], dtype=float32)
y: array([-170.45485, 42.04766, -26.37539])
Raw output
def test_breaker_of_tmd_algo():
"""Test example that could break tmd_algo. Test should fail if problem occurs.
Otherwise, this grower should run smoothly.
"""
distributions, params = _load_inputs(
join(_path, "bio_distr_breaker.json"), join(_path, "bio_params_breaker.json")
)
np.random.seed(3367155)
N = NeuronGrower(input_distributions=distributions, input_parameters=params)
n = N.grow()
assert_array_equal(N.apical_sections, [10])
> assert_array_almost_equal(
n.sections[118].points[-1],
np.array([-170.45485, 42.04766, -26.375393]),
decimal=5,
)
tests/test_neuron_functional.py:297:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/contextlib.py:81: in inner
return func(*args, **kwds)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<function assert_array_almost_equal.<locals>.compare at 0x7f635b893ba0>, array([ -4.7553344, 174.88641 , -9.357793 ], dtype=float32), array([-170.45485 , 42.04766 , -26.375393]))
kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 5 decimals', 'precision': 5, 'verbose': True}
@wraps(func)
def inner(*args, **kwds):
with self._recreate_cm():
> return func(*args, **kwds)
E AssertionError:
E Arrays are not almost equal to 5 decimals
E
E Mismatched elements: 3 / 3 (100%)
E Max absolute difference: 165.69951562
E Max relative difference: 3.15924248
E x: array([ -4.75533, 174.88641, -9.35779], dtype=float32)
E y: array([-170.45485, 42.04766, -26.37539])
/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/contextlib.py:81: AssertionError
Check failure on line 26 in tests/test_morphmath_bifurcation.py
github-actions / JUnit Test Report
test_morphmath_bifurcation.test_get_bif_directional
AssertionError:
Arrays are not almost equal to 6 decimals
Mismatched elements: 2 / 6 (33.3%)
Max absolute difference: 1.
Max relative difference: 1.
x: array([[0., 1., 0.],
[0., 1., 0.]])
y: array([[0., 1., 0.],
[0., 0., 1.]])
Raw output
def test_get_bif_directional():
> assert_array_almost_equal(
_bf.directional([0.0, 1.0, 0.0], [0.0, 0.0, 0.0, np.pi / 2]),
(np.array([0.0, 1.0, 0.0]), np.array([0.0, 0.0, 1.0])),
)
tests/test_morphmath_bifurcation.py:26:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/contextlib.py:81: in inner
return func(*args, **kwds)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<function assert_array_almost_equal.<locals>.compare at 0x7fe39737c680>, (array([0., 1., 0.]), array([0., 1., 0.])), (array([0., 1., 0.]), array([0., 0., 1.])))
kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 6 decimals', 'precision': 6, 'verbose': True}
@wraps(func)
def inner(*args, **kwds):
with self._recreate_cm():
> return func(*args, **kwds)
E AssertionError:
E Arrays are not almost equal to 6 decimals
E
E Mismatched elements: 2 / 6 (33.3%)
E Max absolute difference: 1.
E Max relative difference: 1.
E x: array([[0., 1., 0.],
E [0., 1., 0.]])
E y: array([[0., 1., 0.],
E [0., 0., 1.]])
/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/contextlib.py:81: AssertionError
Check failure on line 1 in TestBioRatL5Tpc1
github-actions / JUnit Test Report
TestBioRatL5Tpc1.test_skip_rng_and_preprocessing
AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7fe3973ba2d0>
+ where <morph_tool.morphio_diff.DiffResult object at 0x7fe3973ba2d0> = diff('/tmp/tmpw441ojcatest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params1.h5')
+ where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params1.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params1.h5')
Raw output
self = <tests.test_neuron_functional.TestBioRatL5Tpc1 object at 0x7fe3975d3a90>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw1/test_skip_rng_and_preprocessin0')
def test_skip_rng_and_preprocessing(self, tmpdir):
> _test_full(
"path_distances",
"bio_rat_L5_TPC_B_distribution.json",
"params1_orientation_manager.json",
"expected_bio_rat_L5_TPC_B_with_params1.h5",
"expected_bio_rat_L5_TPC_B_with_params1_persistence_diagram.json",
skip_preprocessing=True,
rng_or_seed=build_random_generator(0),
output_dir=tmpdir,
)
tests/test_neuron_functional.py:607:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
feature = 'path_distances'
distributions = {'apical_dendrite': {'filtration_metric': 'path_distances', 'min_bar_length': 1.0, 'num_trees': {'data': {'bins': [1],....4106653615432989, 0.5277795547616266, -0.18579814237229897], ...], ...], ...}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'params1_orientation_manager.json'
ref_cell = 'expected_bio_rat_L5_TPC_B_with_params1.h5'
ref_persistence_diagram = 'expected_bio_rat_L5_TPC_B_with_params1_persistence_diagram.json'
rng_or_seed = RandomState(MT19937) at 0x7FE397319740, skip_preprocessing = True
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw1/test_skip_rng_and_preprocessin0')
def _test_full(
feature,
distributions,
parameters,
ref_cell,
ref_persistence_diagram,
rng_or_seed=None,
skip_preprocessing=False,
output_dir=None,
):
distributions, params = _load_inputs(join(_path, distributions), join(_path, parameters))
if rng_or_seed is None:
np.random.seed(0)
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
skip_preprocessing=skip_preprocessing,
).grow()
else:
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
rng_or_seed=rng_or_seed,
skip_preprocessing=skip_preprocessing,
).grow()
with TemporaryDirectory("test_grower") as folder:
out_neuron = join(folder, "test_output_neuron_.h5")
n.write(out_neuron)
# For checking purposes, we can output the cells as swc
if output_dir is not None:
if not os.path.exists(output_dir):
os.mkdir(output_dir)
n.write(join(output_dir, basename(ref_cell)))
if ref_persistence_diagram is not None:
# Load with TMD and extract radial persistence
n0 = tmd.io.load_neuron(out_neuron)
actual_persistence_diagram = tmd.methods.get_persistence_diagram(
n0.apical_dendrite[0], feature=feature
)
if output_dir is not None:
with open(
join(output_dir, basename(ref_persistence_diagram)), "w", encoding="utf-8"
) as f:
json.dump(actual_persistence_diagram, f, sort_keys=True, indent=2)
with open(join(_path, ref_persistence_diagram), encoding="utf-8") as f:
expected_persistence_diagram = json.load(f)
assert_close_persistent_diagram(
actual_persistence_diagram, expected_persistence_diagram
)
> assert not diff(out_neuron, join(_path, ref_cell))
E AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7fe3973ba2d0>
E + where <morph_tool.morphio_diff.DiffResult object at 0x7fe3973ba2d0> = diff('/tmp/tmpw441ojcatest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params1.h5')
E + where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params1.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params1.h5')
tests/test_neuron_functional.py:132: AssertionError
Check failure on line 132 in tests/test_neuron_functional.py
github-actions / JUnit Test Report
test_neuron_functional.test_axon_grower
AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f635ba07e50>
+ where <morph_tool.morphio_diff.DiffResult object at 0x7f635ba07e50> = diff('/tmp/tmpvfzpgvbatest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/test_axon_grower_absolute.h5')
+ where '/home/runner/work/NeuroTS/NeuroTS/tests/data/test_axon_grower_absolute.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'test_axon_grower_absolute.h5')
Raw output
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw0/test_axon_grower0')
def test_axon_grower(tmpdir):
"""Test axon grower, which should only grow trunks with 1 section to allow later axon grafting.
The num_seg value in the parameters is set to 999 but only 1 segment should be synthesized.
"""
_test_full(
"radial_distances",
"axon_trunk_distribution.json",
"axon_trunk_parameters.json",
"test_axon_grower.h5",
None,
output_dir=tmpdir / "default",
)
_test_full(
"radial_distances",
"axon_trunk_distribution.json",
"axon_trunk_parameters.json",
"test_axon_grower.h5",
None,
rng_or_seed=build_random_generator(0),
output_dir=tmpdir / "rng",
)
_test_full(
"radial_distances",
"axon_trunk_distribution.json",
"axon_trunk_parameters_orientation_manager.json",
"test_axon_grower.h5",
None,
skip_preprocessing=True,
output_dir=tmpdir / "skip_preprocessing",
)
_test_full(
"radial_distances",
"axon_trunk_distribution.json",
"axon_trunk_parameters_orientation_manager.json",
"test_axon_grower.h5",
None,
rng_or_seed=build_random_generator(0),
skip_preprocessing=True,
output_dir=tmpdir / "rng_and_skip_preprocessing",
)
> _test_full(
"radial_distances",
"axon_trunk_distribution.json",
"axon_trunk_parameters_absolute.json",
"test_axon_grower_absolute.h5",
None,
output_dir=tmpdir / "default_absolute",
)
tests/test_neuron_functional.py:366:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
feature = 'radial_distances'
distributions = {'apical_dendrite': {}, 'axon': {'num_trees': {'data': {'bins': [1], 'weights': [1]}}, 'trunk': {'absolute_elevation_d...292436, 1.566630375543904, 2.9393430149240416], 'weights': [4, 3, 1, 1, 2]}}}}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'axon_trunk_parameters_absolute.json'
ref_cell = 'test_axon_grower_absolute.h5', ref_persistence_diagram = None
rng_or_seed = None, skip_preprocessing = False
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw0/test_axon_grower0/default_absolute')
def _test_full(
feature,
distributions,
parameters,
ref_cell,
ref_persistence_diagram,
rng_or_seed=None,
skip_preprocessing=False,
output_dir=None,
):
distributions, params = _load_inputs(join(_path, distributions), join(_path, parameters))
if rng_or_seed is None:
np.random.seed(0)
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
skip_preprocessing=skip_preprocessing,
).grow()
else:
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
rng_or_seed=rng_or_seed,
skip_preprocessing=skip_preprocessing,
).grow()
with TemporaryDirectory("test_grower") as folder:
out_neuron = join(folder, "test_output_neuron_.h5")
n.write(out_neuron)
# For checking purposes, we can output the cells as swc
if output_dir is not None:
if not os.path.exists(output_dir):
os.mkdir(output_dir)
n.write(join(output_dir, basename(ref_cell)))
if ref_persistence_diagram is not None:
# Load with TMD and extract radial persistence
n0 = tmd.io.load_neuron(out_neuron)
actual_persistence_diagram = tmd.methods.get_persistence_diagram(
n0.apical_dendrite[0], feature=feature
)
if output_dir is not None:
with open(
join(output_dir, basename(ref_persistence_diagram)), "w", encoding="utf-8"
) as f:
json.dump(actual_persistence_diagram, f, sort_keys=True, indent=2)
with open(join(_path, ref_persistence_diagram), encoding="utf-8") as f:
expected_persistence_diagram = json.load(f)
assert_close_persistent_diagram(
actual_persistence_diagram, expected_persistence_diagram
)
> assert not diff(out_neuron, join(_path, ref_cell))
E AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f635ba07e50>
E + where <morph_tool.morphio_diff.DiffResult object at 0x7f635ba07e50> = diff('/tmp/tmpvfzpgvbatest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/test_axon_grower_absolute.h5')
E + where '/home/runner/work/NeuroTS/NeuroTS/tests/data/test_axon_grower_absolute.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'test_axon_grower_absolute.h5')
tests/test_neuron_functional.py:132: AssertionError
Check failure on line 1 in TestPathGrower
github-actions / JUnit Test Report
TestPathGrower.test_skip_preprocessing
AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f1e1ed5ab50>
+ where <morph_tool.morphio_diff.DiffResult object at 0x7f1e1ed5ab50> = diff('/tmp/tmpi4yrdg_vtest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/path_grower.h5')
+ where '/home/runner/work/NeuroTS/NeuroTS/tests/data/path_grower.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'path_grower.h5')
Raw output
self = <tests.test_neuron_functional.TestPathGrower object at 0x7f1e1efab450>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw3/test_skip_preprocessing0')
def test_skip_preprocessing(self, tmpdir):
> _test_full(
"path_distances",
"bio_distribution.json",
"bio_path_params_orientation_manager.json",
"path_grower.h5",
"bio_path_persistence_diagram.json",
skip_preprocessing=True,
output_dir=tmpdir,
)
tests/test_neuron_functional.py:480:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
feature = 'path_distances'
distributions = {'apical_dendrite': {'filtration_metric': 'path_distances', 'min_bar_length': 1.0, 'num_trees': {'data': {'bins': [1],...665, 0.02188742478139427], [265.46654445080054, 0, nan, nan, nan, nan]]], ...}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'bio_path_params_orientation_manager.json'
ref_cell = 'path_grower.h5'
ref_persistence_diagram = 'bio_path_persistence_diagram.json'
rng_or_seed = None, skip_preprocessing = True
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw3/test_skip_preprocessing0')
def _test_full(
feature,
distributions,
parameters,
ref_cell,
ref_persistence_diagram,
rng_or_seed=None,
skip_preprocessing=False,
output_dir=None,
):
distributions, params = _load_inputs(join(_path, distributions), join(_path, parameters))
if rng_or_seed is None:
np.random.seed(0)
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
skip_preprocessing=skip_preprocessing,
).grow()
else:
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
rng_or_seed=rng_or_seed,
skip_preprocessing=skip_preprocessing,
).grow()
with TemporaryDirectory("test_grower") as folder:
out_neuron = join(folder, "test_output_neuron_.h5")
n.write(out_neuron)
# For checking purposes, we can output the cells as swc
if output_dir is not None:
if not os.path.exists(output_dir):
os.mkdir(output_dir)
n.write(join(output_dir, basename(ref_cell)))
if ref_persistence_diagram is not None:
# Load with TMD and extract radial persistence
n0 = tmd.io.load_neuron(out_neuron)
actual_persistence_diagram = tmd.methods.get_persistence_diagram(
n0.apical_dendrite[0], feature=feature
)
if output_dir is not None:
with open(
join(output_dir, basename(ref_persistence_diagram)), "w", encoding="utf-8"
) as f:
json.dump(actual_persistence_diagram, f, sort_keys=True, indent=2)
with open(join(_path, ref_persistence_diagram), encoding="utf-8") as f:
expected_persistence_diagram = json.load(f)
assert_close_persistent_diagram(
actual_persistence_diagram, expected_persistence_diagram
)
> assert not diff(out_neuron, join(_path, ref_cell))
E AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f1e1ed5ab50>
E + where <morph_tool.morphio_diff.DiffResult object at 0x7f1e1ed5ab50> = diff('/tmp/tmpi4yrdg_vtest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/path_grower.h5')
E + where '/home/runner/work/NeuroTS/NeuroTS/tests/data/path_grower.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'path_grower.h5')
tests/test_neuron_functional.py:132: AssertionError
Check failure on line 132 in tests/test_neuron_functional.py
github-actions / JUnit Test Report
test_neuron_functional.test_basic_grower
AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f635b979ad0>
+ where <morph_tool.morphio_diff.DiffResult object at 0x7f635b979ad0> = diff('/tmp/tmpc2lqb78mtest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/test_trunk_grower.h5')
+ where '/home/runner/work/NeuroTS/NeuroTS/tests/data/test_trunk_grower.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'test_trunk_grower.h5')
Raw output
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw0/test_basic_grower0')
def test_basic_grower(tmpdir):
> _test_full(
"radial_distances",
"bio_trunk_distribution.json",
"trunk_parameters.json",
"test_trunk_grower.h5",
None,
output_dir=tmpdir / "default",
)
tests/test_neuron_functional.py:405:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
feature = 'radial_distances'
distributions = {'apical_dendrite': {'filtration_metric': 'trunk_length', 'min_bar_length': 1.0, 'num_trees': {'data': {'bins': [1], '...292436, 1.566630375543904, 2.9393430149240416], 'weights': [4, 3, 1, 1, 2]}}}}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'trunk_parameters.json', ref_cell = 'test_trunk_grower.h5'
ref_persistence_diagram = None, rng_or_seed = None, skip_preprocessing = False
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw0/test_basic_grower0/default')
def _test_full(
feature,
distributions,
parameters,
ref_cell,
ref_persistence_diagram,
rng_or_seed=None,
skip_preprocessing=False,
output_dir=None,
):
distributions, params = _load_inputs(join(_path, distributions), join(_path, parameters))
if rng_or_seed is None:
np.random.seed(0)
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
skip_preprocessing=skip_preprocessing,
).grow()
else:
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
rng_or_seed=rng_or_seed,
skip_preprocessing=skip_preprocessing,
).grow()
with TemporaryDirectory("test_grower") as folder:
out_neuron = join(folder, "test_output_neuron_.h5")
n.write(out_neuron)
# For checking purposes, we can output the cells as swc
if output_dir is not None:
if not os.path.exists(output_dir):
os.mkdir(output_dir)
n.write(join(output_dir, basename(ref_cell)))
if ref_persistence_diagram is not None:
# Load with TMD and extract radial persistence
n0 = tmd.io.load_neuron(out_neuron)
actual_persistence_diagram = tmd.methods.get_persistence_diagram(
n0.apical_dendrite[0], feature=feature
)
if output_dir is not None:
with open(
join(output_dir, basename(ref_persistence_diagram)), "w", encoding="utf-8"
) as f:
json.dump(actual_persistence_diagram, f, sort_keys=True, indent=2)
with open(join(_path, ref_persistence_diagram), encoding="utf-8") as f:
expected_persistence_diagram = json.load(f)
assert_close_persistent_diagram(
actual_persistence_diagram, expected_persistence_diagram
)
> assert not diff(out_neuron, join(_path, ref_cell))
E AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f635b979ad0>
E + where <morph_tool.morphio_diff.DiffResult object at 0x7f635b979ad0> = diff('/tmp/tmpc2lqb78mtest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/test_trunk_grower.h5')
E + where '/home/runner/work/NeuroTS/NeuroTS/tests/data/test_trunk_grower.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'test_trunk_grower.h5')
tests/test_neuron_functional.py:132: AssertionError
Check failure on line 446 in tests/test_neuron_functional.py
github-actions / JUnit Test Report
test_neuron_functional.test_basic_grower_with_generator
AssertionError:
Arrays are not almost equal to 6 decimals
Mismatched elements: 12 / 12 (100%)
Max absolute difference: 4.68638051
Max relative difference: 78.82940394
x: array([[-0.511599, 9.385795, 7.817605],
[-9.209658, 3.399985, 2.019685],
[ 8.413467, 3.845892, 4.346673],
[-1.759138, 12.613012, 0.826259]])
y: array([[ -0.731235, 7.604229, 11.173798],
[-13.377433, -1.286395, 2.933682],
[ 11.861422, -0.049414, 6.127999],
[ -2.380422, 12.54182 , 1.118073]])
Raw output
def test_basic_grower_with_generator():
distributions, params = _load_inputs(
join(_path, "bio_trunk_distribution.json"),
join(_path, "trunk_parameters.json"),
)
expected_pts = [
[-0.7312348484992981, 7.604228973388672, 11.173797607421875],
[-13.377432823181152, -1.2863954305648804, 2.9336819648742676],
[11.861421585083008, -0.049414388835430145, 6.1279988288879395],
[-2.3804218769073486, 12.54181957244873, 1.118072748184204],
]
rng = np.random.default_rng(0)
rng_or_seeds = [0, rng]
for rng_or_seed in rng_or_seeds:
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
rng_or_seed=rng_or_seed,
).grow()
assert len(n.root_sections) == 4
> assert_array_almost_equal(
[i.points[-1].tolist() for i in n.root_sections],
expected_pts,
)
tests/test_neuron_functional.py:446:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/contextlib.py:81: in inner
return func(*args, **kwds)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<function assert_array_almost_equal.<locals>.compare at 0x7f635b925760>, [[-0.5115991234779358, 9.385794639587402, 7....421585083008, -0.049414388835430145, 6.1279988288879395], [-2.3804218769073486, 12.54181957244873, 1.118072748184204]])
kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 6 decimals', 'precision': 6, 'verbose': True}
@wraps(func)
def inner(*args, **kwds):
with self._recreate_cm():
> return func(*args, **kwds)
E AssertionError:
E Arrays are not almost equal to 6 decimals
E
E Mismatched elements: 12 / 12 (100%)
E Max absolute difference: 4.68638051
E Max relative difference: 78.82940394
E x: array([[-0.511599, 9.385795, 7.817605],
E [-9.209658, 3.399985, 2.019685],
E [ 8.413467, 3.845892, 4.346673],
E [-1.759138, 12.613012, 0.826259]])
E y: array([[ -0.731235, 7.604229, 11.173798],
E [-13.377433, -1.286395, 2.933682],
E [ 11.861422, -0.049414, 6.127999],
E [ -2.380422, 12.54182 , 1.118073]])
/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/contextlib.py:81: AssertionError
Check failure on line 1 in TestPathGrower
github-actions / JUnit Test Report
TestPathGrower.test_default
AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f635ba3c210>
+ where <morph_tool.morphio_diff.DiffResult object at 0x7f635ba3c210> = diff('/tmp/tmpg9tke98ztest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/path_grower.h5')
+ where '/home/runner/work/NeuroTS/NeuroTS/tests/data/path_grower.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'path_grower.h5')
Raw output
self = <tests.test_neuron_functional.TestPathGrower object at 0x7f635bb33450>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw0/test_default0')
def test_default(self, tmpdir):
> _test_full(
"path_distances",
"bio_distribution.json",
"bio_path_params.json",
"path_grower.h5",
"bio_path_persistence_diagram.json",
output_dir=tmpdir,
)
tests/test_neuron_functional.py:459:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
feature = 'path_distances'
distributions = {'apical_dendrite': {'filtration_metric': 'path_distances', 'min_bar_length': 1.0, 'num_trees': {'data': {'bins': [1],...665, 0.02188742478139427], [265.46654445080054, 0, nan, nan, nan, nan]]], ...}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'bio_path_params.json', ref_cell = 'path_grower.h5'
ref_persistence_diagram = 'bio_path_persistence_diagram.json'
rng_or_seed = None, skip_preprocessing = False
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw0/test_default0')
def _test_full(
feature,
distributions,
parameters,
ref_cell,
ref_persistence_diagram,
rng_or_seed=None,
skip_preprocessing=False,
output_dir=None,
):
distributions, params = _load_inputs(join(_path, distributions), join(_path, parameters))
if rng_or_seed is None:
np.random.seed(0)
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
skip_preprocessing=skip_preprocessing,
).grow()
else:
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
rng_or_seed=rng_or_seed,
skip_preprocessing=skip_preprocessing,
).grow()
with TemporaryDirectory("test_grower") as folder:
out_neuron = join(folder, "test_output_neuron_.h5")
n.write(out_neuron)
# For checking purposes, we can output the cells as swc
if output_dir is not None:
if not os.path.exists(output_dir):
os.mkdir(output_dir)
n.write(join(output_dir, basename(ref_cell)))
if ref_persistence_diagram is not None:
# Load with TMD and extract radial persistence
n0 = tmd.io.load_neuron(out_neuron)
actual_persistence_diagram = tmd.methods.get_persistence_diagram(
n0.apical_dendrite[0], feature=feature
)
if output_dir is not None:
with open(
join(output_dir, basename(ref_persistence_diagram)), "w", encoding="utf-8"
) as f:
json.dump(actual_persistence_diagram, f, sort_keys=True, indent=2)
with open(join(_path, ref_persistence_diagram), encoding="utf-8") as f:
expected_persistence_diagram = json.load(f)
assert_close_persistent_diagram(
actual_persistence_diagram, expected_persistence_diagram
)
> assert not diff(out_neuron, join(_path, ref_cell))
E AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f635ba3c210>
E + where <morph_tool.morphio_diff.DiffResult object at 0x7f635ba3c210> = diff('/tmp/tmpg9tke98ztest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/path_grower.h5')
E + where '/home/runner/work/NeuroTS/NeuroTS/tests/data/path_grower.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'path_grower.h5')
tests/test_neuron_functional.py:132: AssertionError
Check failure on line 1 in TestPathGrower
github-actions / JUnit Test Report
TestPathGrower.test_with_rng
AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f635b8f4490>
+ where <morph_tool.morphio_diff.DiffResult object at 0x7f635b8f4490> = diff('/tmp/tmpbgq42d2stest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/path_grower.h5')
+ where '/home/runner/work/NeuroTS/NeuroTS/tests/data/path_grower.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'path_grower.h5')
Raw output
self = <tests.test_neuron_functional.TestPathGrower object at 0x7f635bb33ed0>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw0/test_with_rng0')
def test_with_rng(self, tmpdir):
> _test_full(
"path_distances",
"bio_distribution.json",
"bio_path_params.json",
"path_grower.h5",
"bio_path_persistence_diagram.json",
rng_or_seed=build_random_generator(0),
output_dir=tmpdir,
)
tests/test_neuron_functional.py:469:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
feature = 'path_distances'
distributions = {'apical_dendrite': {'filtration_metric': 'path_distances', 'min_bar_length': 1.0, 'num_trees': {'data': {'bins': [1],...665, 0.02188742478139427], [265.46654445080054, 0, nan, nan, nan, nan]]], ...}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'bio_path_params.json', ref_cell = 'path_grower.h5'
ref_persistence_diagram = 'bio_path_persistence_diagram.json'
rng_or_seed = RandomState(MT19937) at 0x7F63577F0640, skip_preprocessing = False
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw0/test_with_rng0')
def _test_full(
feature,
distributions,
parameters,
ref_cell,
ref_persistence_diagram,
rng_or_seed=None,
skip_preprocessing=False,
output_dir=None,
):
distributions, params = _load_inputs(join(_path, distributions), join(_path, parameters))
if rng_or_seed is None:
np.random.seed(0)
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
skip_preprocessing=skip_preprocessing,
).grow()
else:
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
rng_or_seed=rng_or_seed,
skip_preprocessing=skip_preprocessing,
).grow()
with TemporaryDirectory("test_grower") as folder:
out_neuron = join(folder, "test_output_neuron_.h5")
n.write(out_neuron)
# For checking purposes, we can output the cells as swc
if output_dir is not None:
if not os.path.exists(output_dir):
os.mkdir(output_dir)
n.write(join(output_dir, basename(ref_cell)))
if ref_persistence_diagram is not None:
# Load with TMD and extract radial persistence
n0 = tmd.io.load_neuron(out_neuron)
actual_persistence_diagram = tmd.methods.get_persistence_diagram(
n0.apical_dendrite[0], feature=feature
)
if output_dir is not None:
with open(
join(output_dir, basename(ref_persistence_diagram)), "w", encoding="utf-8"
) as f:
json.dump(actual_persistence_diagram, f, sort_keys=True, indent=2)
with open(join(_path, ref_persistence_diagram), encoding="utf-8") as f:
expected_persistence_diagram = json.load(f)
assert_close_persistent_diagram(
actual_persistence_diagram, expected_persistence_diagram
)
> assert not diff(out_neuron, join(_path, ref_cell))
E AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f635b8f4490>
E + where <morph_tool.morphio_diff.DiffResult object at 0x7f635b8f4490> = diff('/tmp/tmpbgq42d2stest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/path_grower.h5')
E + where '/home/runner/work/NeuroTS/NeuroTS/tests/data/path_grower.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'path_grower.h5')
tests/test_neuron_functional.py:132: AssertionError
Check failure on line 1 in TestPathGrower
github-actions / JUnit Test Report
TestPathGrower.test_skip_rng_and_preprocessing
AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f1e1ed60350>
+ where <morph_tool.morphio_diff.DiffResult object at 0x7f1e1ed60350> = diff('/tmp/tmpr951244ftest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/path_grower.h5')
+ where '/home/runner/work/NeuroTS/NeuroTS/tests/data/path_grower.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'path_grower.h5')
Raw output
self = <tests.test_neuron_functional.TestPathGrower object at 0x7f1e1efabb50>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw3/test_skip_rng_and_preprocessin0')
def test_skip_rng_and_preprocessing(self, tmpdir):
> _test_full(
"path_distances",
"bio_distribution.json",
"bio_path_params_orientation_manager.json",
"path_grower.h5",
"bio_path_persistence_diagram.json",
skip_preprocessing=True,
rng_or_seed=build_random_generator(0),
output_dir=tmpdir,
)
tests/test_neuron_functional.py:491:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
feature = 'path_distances'
distributions = {'apical_dendrite': {'filtration_metric': 'path_distances', 'min_bar_length': 1.0, 'num_trees': {'data': {'bins': [1],...665, 0.02188742478139427], [265.46654445080054, 0, nan, nan, nan, nan]]], ...}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'bio_path_params_orientation_manager.json'
ref_cell = 'path_grower.h5'
ref_persistence_diagram = 'bio_path_persistence_diagram.json'
rng_or_seed = RandomState(MT19937) at 0x7F1E1ED82C40, skip_preprocessing = True
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw3/test_skip_rng_and_preprocessin0')
def _test_full(
feature,
distributions,
parameters,
ref_cell,
ref_persistence_diagram,
rng_or_seed=None,
skip_preprocessing=False,
output_dir=None,
):
distributions, params = _load_inputs(join(_path, distributions), join(_path, parameters))
if rng_or_seed is None:
np.random.seed(0)
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
skip_preprocessing=skip_preprocessing,
).grow()
else:
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
rng_or_seed=rng_or_seed,
skip_preprocessing=skip_preprocessing,
).grow()
with TemporaryDirectory("test_grower") as folder:
out_neuron = join(folder, "test_output_neuron_.h5")
n.write(out_neuron)
# For checking purposes, we can output the cells as swc
if output_dir is not None:
if not os.path.exists(output_dir):
os.mkdir(output_dir)
n.write(join(output_dir, basename(ref_cell)))
if ref_persistence_diagram is not None:
# Load with TMD and extract radial persistence
n0 = tmd.io.load_neuron(out_neuron)
actual_persistence_diagram = tmd.methods.get_persistence_diagram(
n0.apical_dendrite[0], feature=feature
)
if output_dir is not None:
with open(
join(output_dir, basename(ref_persistence_diagram)), "w", encoding="utf-8"
) as f:
json.dump(actual_persistence_diagram, f, sort_keys=True, indent=2)
with open(join(_path, ref_persistence_diagram), encoding="utf-8") as f:
expected_persistence_diagram = json.load(f)
assert_close_persistent_diagram(
actual_persistence_diagram, expected_persistence_diagram
)
> assert not diff(out_neuron, join(_path, ref_cell))
E AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f1e1ed60350>
E + where <morph_tool.morphio_diff.DiffResult object at 0x7f1e1ed60350> = diff('/tmp/tmpr951244ftest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/path_grower.h5')
E + where '/home/runner/work/NeuroTS/NeuroTS/tests/data/path_grower.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'path_grower.h5')
tests/test_neuron_functional.py:132: AssertionError
Check failure on line 1 in TestBioRatL5Tpc2
github-actions / JUnit Test Report
TestBioRatL5Tpc2.test_default
AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7fe397532d50>
+ where <morph_tool.morphio_diff.DiffResult object at 0x7fe397532d50> = diff('/tmp/tmpbz7_gilatest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params2.h5')
+ where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params2.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params2.h5')
Raw output
self = <tests.test_neuron_functional.TestBioRatL5Tpc2 object at 0x7fe3975d16d0>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw1/test_default0')
def test_default(self, tmpdir):
> _test_full(
"path_distances",
"bio_rat_L5_TPC_B_distribution.json",
"params2.json",
"expected_bio_rat_L5_TPC_B_with_params2.h5",
"expected_bio_rat_L5_TPC_B_with_params2_persistence_diagram.json",
output_dir=tmpdir,
)
tests/test_neuron_functional.py:621:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
feature = 'path_distances'
distributions = {'apical_dendrite': {'filtration_metric': 'path_distances', 'min_bar_length': 1.0, 'num_trees': {'data': {'bins': [1],....4106653615432989, 0.5277795547616266, -0.18579814237229897], ...], ...], ...}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'params2.json'
ref_cell = 'expected_bio_rat_L5_TPC_B_with_params2.h5'
ref_persistence_diagram = 'expected_bio_rat_L5_TPC_B_with_params2_persistence_diagram.json'
rng_or_seed = None, skip_preprocessing = False
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw1/test_default0')
def _test_full(
feature,
distributions,
parameters,
ref_cell,
ref_persistence_diagram,
rng_or_seed=None,
skip_preprocessing=False,
output_dir=None,
):
distributions, params = _load_inputs(join(_path, distributions), join(_path, parameters))
if rng_or_seed is None:
np.random.seed(0)
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
skip_preprocessing=skip_preprocessing,
).grow()
else:
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
rng_or_seed=rng_or_seed,
skip_preprocessing=skip_preprocessing,
).grow()
with TemporaryDirectory("test_grower") as folder:
out_neuron = join(folder, "test_output_neuron_.h5")
n.write(out_neuron)
# For checking purposes, we can output the cells as swc
if output_dir is not None:
if not os.path.exists(output_dir):
os.mkdir(output_dir)
n.write(join(output_dir, basename(ref_cell)))
if ref_persistence_diagram is not None:
# Load with TMD and extract radial persistence
n0 = tmd.io.load_neuron(out_neuron)
actual_persistence_diagram = tmd.methods.get_persistence_diagram(
n0.apical_dendrite[0], feature=feature
)
if output_dir is not None:
with open(
join(output_dir, basename(ref_persistence_diagram)), "w", encoding="utf-8"
) as f:
json.dump(actual_persistence_diagram, f, sort_keys=True, indent=2)
with open(join(_path, ref_persistence_diagram), encoding="utf-8") as f:
expected_persistence_diagram = json.load(f)
assert_close_persistent_diagram(
actual_persistence_diagram, expected_persistence_diagram
)
> assert not diff(out_neuron, join(_path, ref_cell))
E AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7fe397532d50>
E + where <morph_tool.morphio_diff.DiffResult object at 0x7fe397532d50> = diff('/tmp/tmpbz7_gilatest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params2.h5')
E + where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params2.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params2.h5')
tests/test_neuron_functional.py:132: AssertionError
Check failure on line 1 in TestBioRatL5Tpc4
github-actions / JUnit Test Report
TestBioRatL5Tpc4.test_default
AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f635b861190>
+ where <morph_tool.morphio_diff.DiffResult object at 0x7f635b861190> = diff('/tmp/tmpdlsdqgr4test_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params4.h5')
+ where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params4.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params4.h5')
Raw output
self = <tests.test_neuron_functional.TestBioRatL5Tpc4 object at 0x7f635bb1d590>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw0/test_default1')
def test_default(self, tmpdir):
> _test_full(
"path_distances",
"bio_rat_L5_TPC_B_distribution.json",
"params4.json",
"expected_bio_rat_L5_TPC_B_with_params4.h5",
"expected_bio_rat_L5_TPC_B_with_params4_persistence_diagram.json",
output_dir=tmpdir,
)
tests/test_neuron_functional.py:713:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
feature = 'path_distances'
distributions = {'apical_dendrite': {'filtration_metric': 'path_distances', 'min_bar_length': 1.0, 'num_trees': {'data': {'bins': [1],....4106653615432989, 0.5277795547616266, -0.18579814237229897], ...], ...], ...}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'params4.json'
ref_cell = 'expected_bio_rat_L5_TPC_B_with_params4.h5'
ref_persistence_diagram = 'expected_bio_rat_L5_TPC_B_with_params4_persistence_diagram.json'
rng_or_seed = None, skip_preprocessing = False
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw0/test_default1')
def _test_full(
feature,
distributions,
parameters,
ref_cell,
ref_persistence_diagram,
rng_or_seed=None,
skip_preprocessing=False,
output_dir=None,
):
distributions, params = _load_inputs(join(_path, distributions), join(_path, parameters))
if rng_or_seed is None:
np.random.seed(0)
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
skip_preprocessing=skip_preprocessing,
).grow()
else:
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
rng_or_seed=rng_or_seed,
skip_preprocessing=skip_preprocessing,
).grow()
with TemporaryDirectory("test_grower") as folder:
out_neuron = join(folder, "test_output_neuron_.h5")
n.write(out_neuron)
# For checking purposes, we can output the cells as swc
if output_dir is not None:
if not os.path.exists(output_dir):
os.mkdir(output_dir)
n.write(join(output_dir, basename(ref_cell)))
if ref_persistence_diagram is not None:
# Load with TMD and extract radial persistence
n0 = tmd.io.load_neuron(out_neuron)
actual_persistence_diagram = tmd.methods.get_persistence_diagram(
n0.apical_dendrite[0], feature=feature
)
if output_dir is not None:
with open(
join(output_dir, basename(ref_persistence_diagram)), "w", encoding="utf-8"
) as f:
json.dump(actual_persistence_diagram, f, sort_keys=True, indent=2)
with open(join(_path, ref_persistence_diagram), encoding="utf-8") as f:
expected_persistence_diagram = json.load(f)
assert_close_persistent_diagram(
actual_persistence_diagram, expected_persistence_diagram
)
> assert not diff(out_neuron, join(_path, ref_cell))
E AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f635b861190>
E + where <morph_tool.morphio_diff.DiffResult object at 0x7f635b861190> = diff('/tmp/tmpdlsdqgr4test_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params4.h5')
E + where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params4.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params4.h5')
tests/test_neuron_functional.py:132: AssertionError
Check failure on line 1 in TestGradientPathGrower
github-actions / JUnit Test Report
TestGradientPathGrower.test_default
AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f1e1ed1d6d0>
+ where <morph_tool.morphio_diff.DiffResult object at 0x7f1e1ed1d6d0> = diff('/tmp/tmpfk36s7sotest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/gradient_path_grower.h5')
+ where '/home/runner/work/NeuroTS/NeuroTS/tests/data/gradient_path_grower.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'gradient_path_grower.h5')
Raw output
self = <tests.test_neuron_functional.TestGradientPathGrower object at 0x7f1e1efb0a50>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw3/test_default0')
def test_default(self, tmpdir):
> _test_full(
"path_distances",
"bio_distribution.json",
"bio_gradient_path_params.json",
"gradient_path_grower.h5",
"gradient_path_persistence_diagram.json",
output_dir=tmpdir,
)
tests/test_neuron_functional.py:529:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
feature = 'path_distances'
distributions = {'apical_dendrite': {'filtration_metric': 'path_distances', 'min_bar_length': 1.0, 'num_trees': {'data': {'bins': [1],...665, 0.02188742478139427], [265.46654445080054, 0, nan, nan, nan, nan]]], ...}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'bio_gradient_path_params.json'
ref_cell = 'gradient_path_grower.h5'
ref_persistence_diagram = 'gradient_path_persistence_diagram.json'
rng_or_seed = None, skip_preprocessing = False
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw3/test_default0')
def _test_full(
feature,
distributions,
parameters,
ref_cell,
ref_persistence_diagram,
rng_or_seed=None,
skip_preprocessing=False,
output_dir=None,
):
distributions, params = _load_inputs(join(_path, distributions), join(_path, parameters))
if rng_or_seed is None:
np.random.seed(0)
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
skip_preprocessing=skip_preprocessing,
).grow()
else:
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
rng_or_seed=rng_or_seed,
skip_preprocessing=skip_preprocessing,
).grow()
with TemporaryDirectory("test_grower") as folder:
out_neuron = join(folder, "test_output_neuron_.h5")
n.write(out_neuron)
# For checking purposes, we can output the cells as swc
if output_dir is not None:
if not os.path.exists(output_dir):
os.mkdir(output_dir)
n.write(join(output_dir, basename(ref_cell)))
if ref_persistence_diagram is not None:
# Load with TMD and extract radial persistence
n0 = tmd.io.load_neuron(out_neuron)
actual_persistence_diagram = tmd.methods.get_persistence_diagram(
n0.apical_dendrite[0], feature=feature
)
if output_dir is not None:
with open(
join(output_dir, basename(ref_persistence_diagram)), "w", encoding="utf-8"
) as f:
json.dump(actual_persistence_diagram, f, sort_keys=True, indent=2)
with open(join(_path, ref_persistence_diagram), encoding="utf-8") as f:
expected_persistence_diagram = json.load(f)
assert_close_persistent_diagram(
actual_persistence_diagram, expected_persistence_diagram
)
> assert not diff(out_neuron, join(_path, ref_cell))
E AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f1e1ed1d6d0>
E + where <morph_tool.morphio_diff.DiffResult object at 0x7f1e1ed1d6d0> = diff('/tmp/tmpfk36s7sotest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/gradient_path_grower.h5')
E + where '/home/runner/work/NeuroTS/NeuroTS/tests/data/gradient_path_grower.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'gradient_path_grower.h5')
tests/test_neuron_functional.py:132: AssertionError
Check failure on line 1 in TestGradientPathGrower
github-actions / JUnit Test Report
TestGradientPathGrower.test_with_rng
AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f1e1ed5ba90>
+ where <morph_tool.morphio_diff.DiffResult object at 0x7f1e1ed5ba90> = diff('/tmp/tmp1vosqg7rtest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/gradient_path_grower.h5')
+ where '/home/runner/work/NeuroTS/NeuroTS/tests/data/gradient_path_grower.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'gradient_path_grower.h5')
Raw output
self = <tests.test_neuron_functional.TestGradientPathGrower object at 0x7f1e1efb1110>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw3/test_with_rng0')
def test_with_rng(self, tmpdir):
> _test_full(
"path_distances",
"bio_distribution.json",
"bio_gradient_path_params.json",
"gradient_path_grower.h5",
"gradient_path_persistence_diagram.json",
rng_or_seed=build_random_generator(0),
output_dir=tmpdir,
)
tests/test_neuron_functional.py:539:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
feature = 'path_distances'
distributions = {'apical_dendrite': {'filtration_metric': 'path_distances', 'min_bar_length': 1.0, 'num_trees': {'data': {'bins': [1],...665, 0.02188742478139427], [265.46654445080054, 0, nan, nan, nan, nan]]], ...}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'bio_gradient_path_params.json'
ref_cell = 'gradient_path_grower.h5'
ref_persistence_diagram = 'gradient_path_persistence_diagram.json'
rng_or_seed = RandomState(MT19937) at 0x7F1E1ED82B40, skip_preprocessing = False
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw3/test_with_rng0')
def _test_full(
feature,
distributions,
parameters,
ref_cell,
ref_persistence_diagram,
rng_or_seed=None,
skip_preprocessing=False,
output_dir=None,
):
distributions, params = _load_inputs(join(_path, distributions), join(_path, parameters))
if rng_or_seed is None:
np.random.seed(0)
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
skip_preprocessing=skip_preprocessing,
).grow()
else:
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
rng_or_seed=rng_or_seed,
skip_preprocessing=skip_preprocessing,
).grow()
with TemporaryDirectory("test_grower") as folder:
out_neuron = join(folder, "test_output_neuron_.h5")
n.write(out_neuron)
# For checking purposes, we can output the cells as swc
if output_dir is not None:
if not os.path.exists(output_dir):
os.mkdir(output_dir)
n.write(join(output_dir, basename(ref_cell)))
if ref_persistence_diagram is not None:
# Load with TMD and extract radial persistence
n0 = tmd.io.load_neuron(out_neuron)
actual_persistence_diagram = tmd.methods.get_persistence_diagram(
n0.apical_dendrite[0], feature=feature
)
if output_dir is not None:
with open(
join(output_dir, basename(ref_persistence_diagram)), "w", encoding="utf-8"
) as f:
json.dump(actual_persistence_diagram, f, sort_keys=True, indent=2)
with open(join(_path, ref_persistence_diagram), encoding="utf-8") as f:
expected_persistence_diagram = json.load(f)
assert_close_persistent_diagram(
actual_persistence_diagram, expected_persistence_diagram
)
> assert not diff(out_neuron, join(_path, ref_cell))
E AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f1e1ed5ba90>
E + where <morph_tool.morphio_diff.DiffResult object at 0x7f1e1ed5ba90> = diff('/tmp/tmp1vosqg7rtest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/gradient_path_grower.h5')
E + where '/home/runner/work/NeuroTS/NeuroTS/tests/data/gradient_path_grower.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'gradient_path_grower.h5')
tests/test_neuron_functional.py:132: AssertionError
Check failure on line 1 in TestBioRatL5Tpc2
github-actions / JUnit Test Report
TestBioRatL5Tpc2.test_with_rng
AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7fe3972fdf10>
+ where <morph_tool.morphio_diff.DiffResult object at 0x7fe3972fdf10> = diff('/tmp/tmpsikis4aotest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params2.h5')
+ where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params2.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params2.h5')
Raw output
self = <tests.test_neuron_functional.TestBioRatL5Tpc2 object at 0x7fe3975d12d0>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw1/test_with_rng0')
def test_with_rng(self, tmpdir):
> _test_full(
"path_distances",
"bio_rat_L5_TPC_B_distribution.json",
"params2.json",
"expected_bio_rat_L5_TPC_B_with_params2.h5",
"expected_bio_rat_L5_TPC_B_with_params2_persistence_diagram.json",
rng_or_seed=build_random_generator(0),
output_dir=tmpdir,
)
tests/test_neuron_functional.py:631:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
feature = 'path_distances'
distributions = {'apical_dendrite': {'filtration_metric': 'path_distances', 'min_bar_length': 1.0, 'num_trees': {'data': {'bins': [1],....4106653615432989, 0.5277795547616266, -0.18579814237229897], ...], ...], ...}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'params2.json'
ref_cell = 'expected_bio_rat_L5_TPC_B_with_params2.h5'
ref_persistence_diagram = 'expected_bio_rat_L5_TPC_B_with_params2_persistence_diagram.json'
rng_or_seed = RandomState(MT19937) at 0x7FE397319040, skip_preprocessing = False
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw1/test_with_rng0')
def _test_full(
feature,
distributions,
parameters,
ref_cell,
ref_persistence_diagram,
rng_or_seed=None,
skip_preprocessing=False,
output_dir=None,
):
distributions, params = _load_inputs(join(_path, distributions), join(_path, parameters))
if rng_or_seed is None:
np.random.seed(0)
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
skip_preprocessing=skip_preprocessing,
).grow()
else:
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
rng_or_seed=rng_or_seed,
skip_preprocessing=skip_preprocessing,
).grow()
with TemporaryDirectory("test_grower") as folder:
out_neuron = join(folder, "test_output_neuron_.h5")
n.write(out_neuron)
# For checking purposes, we can output the cells as swc
if output_dir is not None:
if not os.path.exists(output_dir):
os.mkdir(output_dir)
n.write(join(output_dir, basename(ref_cell)))
if ref_persistence_diagram is not None:
# Load with TMD and extract radial persistence
n0 = tmd.io.load_neuron(out_neuron)
actual_persistence_diagram = tmd.methods.get_persistence_diagram(
n0.apical_dendrite[0], feature=feature
)
if output_dir is not None:
with open(
join(output_dir, basename(ref_persistence_diagram)), "w", encoding="utf-8"
) as f:
json.dump(actual_persistence_diagram, f, sort_keys=True, indent=2)
with open(join(_path, ref_persistence_diagram), encoding="utf-8") as f:
expected_persistence_diagram = json.load(f)
assert_close_persistent_diagram(
actual_persistence_diagram, expected_persistence_diagram
)
> assert not diff(out_neuron, join(_path, ref_cell))
E AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7fe3972fdf10>
E + where <morph_tool.morphio_diff.DiffResult object at 0x7fe3972fdf10> = diff('/tmp/tmpsikis4aotest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params2.h5')
E + where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params2.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params2.h5')
tests/test_neuron_functional.py:132: AssertionError
Check failure on line 1 in TestBioRatL5Tpc4
github-actions / JUnit Test Report
TestBioRatL5Tpc4.test_with_rng
AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f635b8c8d10>
+ where <morph_tool.morphio_diff.DiffResult object at 0x7f635b8c8d10> = diff('/tmp/tmpe0mufgtntest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params4.h5')
+ where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params4.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params4.h5')
Raw output
self = <tests.test_neuron_functional.TestBioRatL5Tpc4 object at 0x7f635bb1e810>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw0/test_with_rng1')
def test_with_rng(self, tmpdir):
> _test_full(
"path_distances",
"bio_rat_L5_TPC_B_distribution.json",
"params4.json",
"expected_bio_rat_L5_TPC_B_with_params4.h5",
"expected_bio_rat_L5_TPC_B_with_params4_persistence_diagram.json",
rng_or_seed=build_random_generator(0),
output_dir=tmpdir,
)
tests/test_neuron_functional.py:723:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
feature = 'path_distances'
distributions = {'apical_dendrite': {'filtration_metric': 'path_distances', 'min_bar_length': 1.0, 'num_trees': {'data': {'bins': [1],....4106653615432989, 0.5277795547616266, -0.18579814237229897], ...], ...], ...}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'params4.json'
ref_cell = 'expected_bio_rat_L5_TPC_B_with_params4.h5'
ref_persistence_diagram = 'expected_bio_rat_L5_TPC_B_with_params4_persistence_diagram.json'
rng_or_seed = RandomState(MT19937) at 0x7F635B947540, skip_preprocessing = False
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw0/test_with_rng1')
def _test_full(
feature,
distributions,
parameters,
ref_cell,
ref_persistence_diagram,
rng_or_seed=None,
skip_preprocessing=False,
output_dir=None,
):
distributions, params = _load_inputs(join(_path, distributions), join(_path, parameters))
if rng_or_seed is None:
np.random.seed(0)
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
skip_preprocessing=skip_preprocessing,
).grow()
else:
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
rng_or_seed=rng_or_seed,
skip_preprocessing=skip_preprocessing,
).grow()
with TemporaryDirectory("test_grower") as folder:
out_neuron = join(folder, "test_output_neuron_.h5")
n.write(out_neuron)
# For checking purposes, we can output the cells as swc
if output_dir is not None:
if not os.path.exists(output_dir):
os.mkdir(output_dir)
n.write(join(output_dir, basename(ref_cell)))
if ref_persistence_diagram is not None:
# Load with TMD and extract radial persistence
n0 = tmd.io.load_neuron(out_neuron)
actual_persistence_diagram = tmd.methods.get_persistence_diagram(
n0.apical_dendrite[0], feature=feature
)
if output_dir is not None:
with open(
join(output_dir, basename(ref_persistence_diagram)), "w", encoding="utf-8"
) as f:
json.dump(actual_persistence_diagram, f, sort_keys=True, indent=2)
with open(join(_path, ref_persistence_diagram), encoding="utf-8") as f:
expected_persistence_diagram = json.load(f)
assert_close_persistent_diagram(
actual_persistence_diagram, expected_persistence_diagram
)
> assert not diff(out_neuron, join(_path, ref_cell))
E AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f635b8c8d10>
E + where <morph_tool.morphio_diff.DiffResult object at 0x7f635b8c8d10> = diff('/tmp/tmpe0mufgtntest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params4.h5')
E + where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params4.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params4.h5')
tests/test_neuron_functional.py:132: AssertionError
Check failure on line 1 in TestGradientPathGrower
github-actions / JUnit Test Report
TestGradientPathGrower.test_skip_preprocessing
AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f1e1efdec10>
+ where <morph_tool.morphio_diff.DiffResult object at 0x7f1e1efdec10> = diff('/tmp/tmphb9yqym3test_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/gradient_path_grower.h5')
+ where '/home/runner/work/NeuroTS/NeuroTS/tests/data/gradient_path_grower.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'gradient_path_grower.h5')
Raw output
self = <tests.test_neuron_functional.TestGradientPathGrower object at 0x7f1e1efb1890>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw3/test_skip_preprocessing1')
def test_skip_preprocessing(self, tmpdir):
> _test_full(
"path_distances",
"bio_distribution.json",
"bio_gradient_path_params_orientation_manager.json",
"gradient_path_grower.h5",
"gradient_path_persistence_diagram.json",
skip_preprocessing=True,
output_dir=tmpdir,
)
tests/test_neuron_functional.py:550:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
feature = 'path_distances'
distributions = {'apical_dendrite': {'filtration_metric': 'path_distances', 'min_bar_length': 1.0, 'num_trees': {'data': {'bins': [1],...665, 0.02188742478139427], [265.46654445080054, 0, nan, nan, nan, nan]]], ...}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'bio_gradient_path_params_orientation_manager.json'
ref_cell = 'gradient_path_grower.h5'
ref_persistence_diagram = 'gradient_path_persistence_diagram.json'
rng_or_seed = None, skip_preprocessing = True
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw3/test_skip_preprocessing1')
def _test_full(
feature,
distributions,
parameters,
ref_cell,
ref_persistence_diagram,
rng_or_seed=None,
skip_preprocessing=False,
output_dir=None,
):
distributions, params = _load_inputs(join(_path, distributions), join(_path, parameters))
if rng_or_seed is None:
np.random.seed(0)
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
skip_preprocessing=skip_preprocessing,
).grow()
else:
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
rng_or_seed=rng_or_seed,
skip_preprocessing=skip_preprocessing,
).grow()
with TemporaryDirectory("test_grower") as folder:
out_neuron = join(folder, "test_output_neuron_.h5")
n.write(out_neuron)
# For checking purposes, we can output the cells as swc
if output_dir is not None:
if not os.path.exists(output_dir):
os.mkdir(output_dir)
n.write(join(output_dir, basename(ref_cell)))
if ref_persistence_diagram is not None:
# Load with TMD and extract radial persistence
n0 = tmd.io.load_neuron(out_neuron)
actual_persistence_diagram = tmd.methods.get_persistence_diagram(
n0.apical_dendrite[0], feature=feature
)
if output_dir is not None:
with open(
join(output_dir, basename(ref_persistence_diagram)), "w", encoding="utf-8"
) as f:
json.dump(actual_persistence_diagram, f, sort_keys=True, indent=2)
with open(join(_path, ref_persistence_diagram), encoding="utf-8") as f:
expected_persistence_diagram = json.load(f)
assert_close_persistent_diagram(
actual_persistence_diagram, expected_persistence_diagram
)
> assert not diff(out_neuron, join(_path, ref_cell))
E AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f1e1efdec10>
E + where <morph_tool.morphio_diff.DiffResult object at 0x7f1e1efdec10> = diff('/tmp/tmphb9yqym3test_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/gradient_path_grower.h5')
E + where '/home/runner/work/NeuroTS/NeuroTS/tests/data/gradient_path_grower.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'gradient_path_grower.h5')
tests/test_neuron_functional.py:132: AssertionError
Check failure on line 1 in TestGradientPathGrower
github-actions / JUnit Test Report
TestGradientPathGrower.test_skip_rng_and_preprocessing
AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f1e1ecef150>
+ where <morph_tool.morphio_diff.DiffResult object at 0x7f1e1ecef150> = diff('/tmp/tmphsin0llltest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/gradient_path_grower.h5')
+ where '/home/runner/work/NeuroTS/NeuroTS/tests/data/gradient_path_grower.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'gradient_path_grower.h5')
Raw output
self = <tests.test_neuron_functional.TestGradientPathGrower object at 0x7f1e1efaa310>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw3/test_skip_rng_and_preprocessin1')
def test_skip_rng_and_preprocessing(self, tmpdir):
> _test_full(
"path_distances",
"bio_distribution.json",
"bio_gradient_path_params_orientation_manager.json",
"gradient_path_grower.h5",
"gradient_path_persistence_diagram.json",
skip_preprocessing=True,
rng_or_seed=build_random_generator(0),
output_dir=tmpdir,
)
tests/test_neuron_functional.py:561:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
feature = 'path_distances'
distributions = {'apical_dendrite': {'filtration_metric': 'path_distances', 'min_bar_length': 1.0, 'num_trees': {'data': {'bins': [1],...665, 0.02188742478139427], [265.46654445080054, 0, nan, nan, nan, nan]]], ...}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'bio_gradient_path_params_orientation_manager.json'
ref_cell = 'gradient_path_grower.h5'
ref_persistence_diagram = 'gradient_path_persistence_diagram.json'
rng_or_seed = RandomState(MT19937) at 0x7F1E1ED32240, skip_preprocessing = True
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw3/test_skip_rng_and_preprocessin1')
def _test_full(
feature,
distributions,
parameters,
ref_cell,
ref_persistence_diagram,
rng_or_seed=None,
skip_preprocessing=False,
output_dir=None,
):
distributions, params = _load_inputs(join(_path, distributions), join(_path, parameters))
if rng_or_seed is None:
np.random.seed(0)
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
skip_preprocessing=skip_preprocessing,
).grow()
else:
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
rng_or_seed=rng_or_seed,
skip_preprocessing=skip_preprocessing,
).grow()
with TemporaryDirectory("test_grower") as folder:
out_neuron = join(folder, "test_output_neuron_.h5")
n.write(out_neuron)
# For checking purposes, we can output the cells as swc
if output_dir is not None:
if not os.path.exists(output_dir):
os.mkdir(output_dir)
n.write(join(output_dir, basename(ref_cell)))
if ref_persistence_diagram is not None:
# Load with TMD and extract radial persistence
n0 = tmd.io.load_neuron(out_neuron)
actual_persistence_diagram = tmd.methods.get_persistence_diagram(
n0.apical_dendrite[0], feature=feature
)
if output_dir is not None:
with open(
join(output_dir, basename(ref_persistence_diagram)), "w", encoding="utf-8"
) as f:
json.dump(actual_persistence_diagram, f, sort_keys=True, indent=2)
with open(join(_path, ref_persistence_diagram), encoding="utf-8") as f:
expected_persistence_diagram = json.load(f)
assert_close_persistent_diagram(
actual_persistence_diagram, expected_persistence_diagram
)
> assert not diff(out_neuron, join(_path, ref_cell))
E AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f1e1ecef150>
E + where <morph_tool.morphio_diff.DiffResult object at 0x7f1e1ecef150> = diff('/tmp/tmphsin0llltest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/gradient_path_grower.h5')
E + where '/home/runner/work/NeuroTS/NeuroTS/tests/data/gradient_path_grower.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'gradient_path_grower.h5')
tests/test_neuron_functional.py:132: AssertionError
Check failure on line 1 in TestBioRatL5Tpc2
github-actions / JUnit Test Report
TestBioRatL5Tpc2.test_skip_preprocessing
AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7fe3950e4650>
+ where <morph_tool.morphio_diff.DiffResult object at 0x7fe3950e4650> = diff('/tmp/tmpypzhw2smtest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params2.h5')
+ where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params2.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params2.h5')
Raw output
self = <tests.test_neuron_functional.TestBioRatL5Tpc2 object at 0x7fe3975d0090>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw1/test_skip_preprocessing0')
def test_skip_preprocessing(self, tmpdir):
> _test_full(
"path_distances",
"bio_rat_L5_TPC_B_distribution.json",
"params2_orientation_manager.json",
"expected_bio_rat_L5_TPC_B_with_params2.h5",
"expected_bio_rat_L5_TPC_B_with_params2_persistence_diagram.json",
skip_preprocessing=True,
output_dir=tmpdir,
)
tests/test_neuron_functional.py:642:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
feature = 'path_distances'
distributions = {'apical_dendrite': {'filtration_metric': 'path_distances', 'min_bar_length': 1.0, 'num_trees': {'data': {'bins': [1],....4106653615432989, 0.5277795547616266, -0.18579814237229897], ...], ...], ...}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'params2_orientation_manager.json'
ref_cell = 'expected_bio_rat_L5_TPC_B_with_params2.h5'
ref_persistence_diagram = 'expected_bio_rat_L5_TPC_B_with_params2_persistence_diagram.json'
rng_or_seed = None, skip_preprocessing = True
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw1/test_skip_preprocessing0')
def _test_full(
feature,
distributions,
parameters,
ref_cell,
ref_persistence_diagram,
rng_or_seed=None,
skip_preprocessing=False,
output_dir=None,
):
distributions, params = _load_inputs(join(_path, distributions), join(_path, parameters))
if rng_or_seed is None:
np.random.seed(0)
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
skip_preprocessing=skip_preprocessing,
).grow()
else:
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
rng_or_seed=rng_or_seed,
skip_preprocessing=skip_preprocessing,
).grow()
with TemporaryDirectory("test_grower") as folder:
out_neuron = join(folder, "test_output_neuron_.h5")
n.write(out_neuron)
# For checking purposes, we can output the cells as swc
if output_dir is not None:
if not os.path.exists(output_dir):
os.mkdir(output_dir)
n.write(join(output_dir, basename(ref_cell)))
if ref_persistence_diagram is not None:
# Load with TMD and extract radial persistence
n0 = tmd.io.load_neuron(out_neuron)
actual_persistence_diagram = tmd.methods.get_persistence_diagram(
n0.apical_dendrite[0], feature=feature
)
if output_dir is not None:
with open(
join(output_dir, basename(ref_persistence_diagram)), "w", encoding="utf-8"
) as f:
json.dump(actual_persistence_diagram, f, sort_keys=True, indent=2)
with open(join(_path, ref_persistence_diagram), encoding="utf-8") as f:
expected_persistence_diagram = json.load(f)
assert_close_persistent_diagram(
actual_persistence_diagram, expected_persistence_diagram
)
> assert not diff(out_neuron, join(_path, ref_cell))
E AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7fe3950e4650>
E + where <morph_tool.morphio_diff.DiffResult object at 0x7fe3950e4650> = diff('/tmp/tmpypzhw2smtest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params2.h5')
E + where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params2.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params2.h5')
tests/test_neuron_functional.py:132: AssertionError
Check failure on line 1 in TestBioRatL5Tpc4
github-actions / JUnit Test Report
TestBioRatL5Tpc4.test_skip_preprocessing
AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f635782c550>
+ where <morph_tool.morphio_diff.DiffResult object at 0x7f635782c550> = diff('/tmp/tmpca6bwgnwtest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params4.h5')
+ where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params4.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params4.h5')
Raw output
self = <tests.test_neuron_functional.TestBioRatL5Tpc4 object at 0x7f635bb1fed0>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw0/test_skip_preprocessing0')
def test_skip_preprocessing(self, tmpdir):
> _test_full(
"path_distances",
"bio_rat_L5_TPC_B_distribution.json",
"params4_orientation_manager.json",
"expected_bio_rat_L5_TPC_B_with_params4.h5",
"expected_bio_rat_L5_TPC_B_with_params4_persistence_diagram.json",
skip_preprocessing=True,
output_dir=tmpdir,
)
tests/test_neuron_functional.py:734:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
feature = 'path_distances'
distributions = {'apical_dendrite': {'filtration_metric': 'path_distances', 'min_bar_length': 1.0, 'num_trees': {'data': {'bins': [1],....4106653615432989, 0.5277795547616266, -0.18579814237229897], ...], ...], ...}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'params4_orientation_manager.json'
ref_cell = 'expected_bio_rat_L5_TPC_B_with_params4.h5'
ref_persistence_diagram = 'expected_bio_rat_L5_TPC_B_with_params4_persistence_diagram.json'
rng_or_seed = None, skip_preprocessing = True
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw0/test_skip_preprocessing0')
def _test_full(
feature,
distributions,
parameters,
ref_cell,
ref_persistence_diagram,
rng_or_seed=None,
skip_preprocessing=False,
output_dir=None,
):
distributions, params = _load_inputs(join(_path, distributions), join(_path, parameters))
if rng_or_seed is None:
np.random.seed(0)
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
skip_preprocessing=skip_preprocessing,
).grow()
else:
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
rng_or_seed=rng_or_seed,
skip_preprocessing=skip_preprocessing,
).grow()
with TemporaryDirectory("test_grower") as folder:
out_neuron = join(folder, "test_output_neuron_.h5")
n.write(out_neuron)
# For checking purposes, we can output the cells as swc
if output_dir is not None:
if not os.path.exists(output_dir):
os.mkdir(output_dir)
n.write(join(output_dir, basename(ref_cell)))
if ref_persistence_diagram is not None:
# Load with TMD and extract radial persistence
n0 = tmd.io.load_neuron(out_neuron)
actual_persistence_diagram = tmd.methods.get_persistence_diagram(
n0.apical_dendrite[0], feature=feature
)
if output_dir is not None:
with open(
join(output_dir, basename(ref_persistence_diagram)), "w", encoding="utf-8"
) as f:
json.dump(actual_persistence_diagram, f, sort_keys=True, indent=2)
with open(join(_path, ref_persistence_diagram), encoding="utf-8") as f:
expected_persistence_diagram = json.load(f)
assert_close_persistent_diagram(
actual_persistence_diagram, expected_persistence_diagram
)
> assert not diff(out_neuron, join(_path, ref_cell))
E AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f635782c550>
E + where <morph_tool.morphio_diff.DiffResult object at 0x7f635782c550> = diff('/tmp/tmpca6bwgnwtest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params4.h5')
E + where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params4.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params4.h5')
tests/test_neuron_functional.py:132: AssertionError
Check failure on line 1 in TestBioRatL5Tpc1
github-actions / JUnit Test Report
TestBioRatL5Tpc1.test_default
AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f1e1cadfd50>
+ where <morph_tool.morphio_diff.DiffResult object at 0x7f1e1cadfd50> = diff('/tmp/tmpjcoht39dtest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params1.h5')
+ where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params1.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params1.h5')
Raw output
self = <tests.test_neuron_functional.TestBioRatL5Tpc1 object at 0x7f1e1efb1850>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw3/test_default1')
def test_default(self, tmpdir):
> _test_full(
"path_distances",
"bio_rat_L5_TPC_B_distribution.json",
"params1.json",
"expected_bio_rat_L5_TPC_B_with_params1.h5",
"expected_bio_rat_L5_TPC_B_with_params1_persistence_diagram.json",
output_dir=tmpdir,
)
tests/test_neuron_functional.py:575:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
feature = 'path_distances'
distributions = {'apical_dendrite': {'filtration_metric': 'path_distances', 'min_bar_length': 1.0, 'num_trees': {'data': {'bins': [1],....4106653615432989, 0.5277795547616266, -0.18579814237229897], ...], ...], ...}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'params1.json'
ref_cell = 'expected_bio_rat_L5_TPC_B_with_params1.h5'
ref_persistence_diagram = 'expected_bio_rat_L5_TPC_B_with_params1_persistence_diagram.json'
rng_or_seed = None, skip_preprocessing = False
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw3/test_default1')
def _test_full(
feature,
distributions,
parameters,
ref_cell,
ref_persistence_diagram,
rng_or_seed=None,
skip_preprocessing=False,
output_dir=None,
):
distributions, params = _load_inputs(join(_path, distributions), join(_path, parameters))
if rng_or_seed is None:
np.random.seed(0)
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
skip_preprocessing=skip_preprocessing,
).grow()
else:
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
rng_or_seed=rng_or_seed,
skip_preprocessing=skip_preprocessing,
).grow()
with TemporaryDirectory("test_grower") as folder:
out_neuron = join(folder, "test_output_neuron_.h5")
n.write(out_neuron)
# For checking purposes, we can output the cells as swc
if output_dir is not None:
if not os.path.exists(output_dir):
os.mkdir(output_dir)
n.write(join(output_dir, basename(ref_cell)))
if ref_persistence_diagram is not None:
# Load with TMD and extract radial persistence
n0 = tmd.io.load_neuron(out_neuron)
actual_persistence_diagram = tmd.methods.get_persistence_diagram(
n0.apical_dendrite[0], feature=feature
)
if output_dir is not None:
with open(
join(output_dir, basename(ref_persistence_diagram)), "w", encoding="utf-8"
) as f:
json.dump(actual_persistence_diagram, f, sort_keys=True, indent=2)
with open(join(_path, ref_persistence_diagram), encoding="utf-8") as f:
expected_persistence_diagram = json.load(f)
assert_close_persistent_diagram(
actual_persistence_diagram, expected_persistence_diagram
)
> assert not diff(out_neuron, join(_path, ref_cell))
E AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f1e1cadfd50>
E + where <morph_tool.morphio_diff.DiffResult object at 0x7f1e1cadfd50> = diff('/tmp/tmpjcoht39dtest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params1.h5')
E + where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params1.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params1.h5')
tests/test_neuron_functional.py:132: AssertionError
Check failure on line 1 in TestBioRatL5Tpc4
github-actions / JUnit Test Report
TestBioRatL5Tpc4.test_skip_rng_and_preprocessing
AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f635b8d4090>
+ where <morph_tool.morphio_diff.DiffResult object at 0x7f635b8d4090> = diff('/tmp/tmpql92idbutest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params4.h5')
+ where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params4.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params4.h5')
Raw output
self = <tests.test_neuron_functional.TestBioRatL5Tpc4 object at 0x7f635b9a4350>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw0/test_skip_rng_and_preprocessin0')
def test_skip_rng_and_preprocessing(self, tmpdir):
> _test_full(
"path_distances",
"bio_rat_L5_TPC_B_distribution.json",
"params4_orientation_manager.json",
"expected_bio_rat_L5_TPC_B_with_params4.h5",
"expected_bio_rat_L5_TPC_B_with_params4_persistence_diagram.json",
skip_preprocessing=True,
rng_or_seed=build_random_generator(0),
output_dir=tmpdir,
)
tests/test_neuron_functional.py:745:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
feature = 'path_distances'
distributions = {'apical_dendrite': {'filtration_metric': 'path_distances', 'min_bar_length': 1.0, 'num_trees': {'data': {'bins': [1],....4106653615432989, 0.5277795547616266, -0.18579814237229897], ...], ...], ...}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'params4_orientation_manager.json'
ref_cell = 'expected_bio_rat_L5_TPC_B_with_params4.h5'
ref_persistence_diagram = 'expected_bio_rat_L5_TPC_B_with_params4_persistence_diagram.json'
rng_or_seed = RandomState(MT19937) at 0x7F635B945740, skip_preprocessing = True
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw0/test_skip_rng_and_preprocessin0')
def _test_full(
feature,
distributions,
parameters,
ref_cell,
ref_persistence_diagram,
rng_or_seed=None,
skip_preprocessing=False,
output_dir=None,
):
distributions, params = _load_inputs(join(_path, distributions), join(_path, parameters))
if rng_or_seed is None:
np.random.seed(0)
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
skip_preprocessing=skip_preprocessing,
).grow()
else:
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
rng_or_seed=rng_or_seed,
skip_preprocessing=skip_preprocessing,
).grow()
with TemporaryDirectory("test_grower") as folder:
out_neuron = join(folder, "test_output_neuron_.h5")
n.write(out_neuron)
# For checking purposes, we can output the cells as swc
if output_dir is not None:
if not os.path.exists(output_dir):
os.mkdir(output_dir)
n.write(join(output_dir, basename(ref_cell)))
if ref_persistence_diagram is not None:
# Load with TMD and extract radial persistence
n0 = tmd.io.load_neuron(out_neuron)
actual_persistence_diagram = tmd.methods.get_persistence_diagram(
n0.apical_dendrite[0], feature=feature
)
if output_dir is not None:
with open(
join(output_dir, basename(ref_persistence_diagram)), "w", encoding="utf-8"
) as f:
json.dump(actual_persistence_diagram, f, sort_keys=True, indent=2)
with open(join(_path, ref_persistence_diagram), encoding="utf-8") as f:
expected_persistence_diagram = json.load(f)
assert_close_persistent_diagram(
actual_persistence_diagram, expected_persistence_diagram
)
> assert not diff(out_neuron, join(_path, ref_cell))
E AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f635b8d4090>
E + where <morph_tool.morphio_diff.DiffResult object at 0x7f635b8d4090> = diff('/tmp/tmpql92idbutest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params4.h5')
E + where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params4.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params4.h5')
tests/test_neuron_functional.py:132: AssertionError
Check failure on line 1 in TestBioRatL5Tpc2
github-actions / JUnit Test Report
TestBioRatL5Tpc2.test_skip_rng_and_preprocessing
AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7fe397383550>
+ where <morph_tool.morphio_diff.DiffResult object at 0x7fe397383550> = diff('/tmp/tmp3pg6b2ogtest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params2.h5')
+ where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params2.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params2.h5')
Raw output
self = <tests.test_neuron_functional.TestBioRatL5Tpc2 object at 0x7fe3995a9790>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw1/test_skip_rng_and_preprocessin1')
def test_skip_rng_and_preprocessing(self, tmpdir):
> _test_full(
"path_distances",
"bio_rat_L5_TPC_B_distribution.json",
"params2_orientation_manager.json",
"expected_bio_rat_L5_TPC_B_with_params2.h5",
"expected_bio_rat_L5_TPC_B_with_params2_persistence_diagram.json",
skip_preprocessing=True,
rng_or_seed=build_random_generator(0),
output_dir=tmpdir,
)
tests/test_neuron_functional.py:653:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
feature = 'path_distances'
distributions = {'apical_dendrite': {'filtration_metric': 'path_distances', 'min_bar_length': 1.0, 'num_trees': {'data': {'bins': [1],....4106653615432989, 0.5277795547616266, -0.18579814237229897], ...], ...], ...}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'params2_orientation_manager.json'
ref_cell = 'expected_bio_rat_L5_TPC_B_with_params2.h5'
ref_persistence_diagram = 'expected_bio_rat_L5_TPC_B_with_params2_persistence_diagram.json'
rng_or_seed = RandomState(MT19937) at 0x7FE39731A240, skip_preprocessing = True
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw1/test_skip_rng_and_preprocessin1')
def _test_full(
feature,
distributions,
parameters,
ref_cell,
ref_persistence_diagram,
rng_or_seed=None,
skip_preprocessing=False,
output_dir=None,
):
distributions, params = _load_inputs(join(_path, distributions), join(_path, parameters))
if rng_or_seed is None:
np.random.seed(0)
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
skip_preprocessing=skip_preprocessing,
).grow()
else:
n = NeuronGrower(
input_distributions=distributions,
input_parameters=params,
rng_or_seed=rng_or_seed,
skip_preprocessing=skip_preprocessing,
).grow()
with TemporaryDirectory("test_grower") as folder:
out_neuron = join(folder, "test_output_neuron_.h5")
n.write(out_neuron)
# For checking purposes, we can output the cells as swc
if output_dir is not None:
if not os.path.exists(output_dir):
os.mkdir(output_dir)
n.write(join(output_dir, basename(ref_cell)))
if ref_persistence_diagram is not None:
# Load with TMD and extract radial persistence
n0 = tmd.io.load_neuron(out_neuron)
actual_persistence_diagram = tmd.methods.get_persistence_diagram(
n0.apical_dendrite[0], feature=feature
)
if output_dir is not None:
with open(
join(output_dir, basename(ref_persistence_diagram)), "w", encoding="utf-8"
) as f:
json.dump(actual_persistence_diagram, f, sort_keys=True, indent=2)
with open(join(_path, ref_persistence_diagram), encoding="utf-8") as f:
expected_persistence_diagram = json.load(f)
assert_close_persistent_diagram(
actual_persistence_diagram, expected_persistence_diagram
)
> assert not diff(out_neuron, join(_path, ref_cell))
E AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7fe397383550>
E + where <morph_tool.morphio_diff.DiffResult object at 0x7fe397383550> = diff('/tmp/tmp3pg6b2ogtest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params2.h5')
E + where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params2.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params2.h5')
tests/test_neuron_functional.py:132: AssertionError