Fix: Handle near symetrical two major apical branches #312
216 tests run, 183 passed, 0 skipped, 33 failed.
Annotations
Check failure on line 620 in tests/test_neuron_functional.py
github-actions / JUnit Test Report
tests/test_neuron_functional.py.test_default
AssertionError:
Arrays are not almost equal to 0 decimals
Mismatched elements: 99 / 166 (59.6%)
Max absolute difference: 5.97778481
Max relative difference: inf
x: [repr failed for <ndarray>: precision must be an integer]
y: [repr failed for <ndarray>: precision must be an integer]
Raw output
self = <tests.test_neuron_functional.TestBioRatL5Tpc2 object at 0x7f79ce1a44c0>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/tmp/popen-gw2/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:622:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_neuron_functional.py:130: in _test_full
assert_close_persistent_diagram(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
actual = [[126.20707288384438, 124.18468019366264], [170.9764948785305, 167.0840221941471], [426.96366888284683, 424.6997688412...05736828, 1213.6682691276073], [1270.4692129194736, 1268.4174081385136], [1267.8909048736095, 1265.8486044704914], ...]
expected = [[126.09063404798508, 124.10453796386719], [124.20069247484207, 121.377720952034], [123.74416822195053, 119.4144430160...34535217, 117.54309237003326], [123.21093481779099, 118.67947047948837], [169.95419105887413, 164.44511690735817], ...]
def assert_close_persistent_diagram(actual, expected):
# compute distances between points
distances = np.min(cdist(np.array(tmd.analysis.sort_ph(expected)), actual), axis=0)
# We compare distances between expected and generated peristence as it is more stable to check.
# This comparison does not depend on ordering of the points
# and ensures that the points of the original persistence are consistently generated.
assert_almost_equal(len(expected), len(actual))
> assert_array_almost_equal(distances, np.zeros(len(distances)), decimal=0.1)
E AssertionError:
E Arrays are not almost equal to 0 decimals
E
E Mismatched elements: 99 / 166 (59.6%)
E Max absolute difference: 5.97778481
E Max relative difference: inf
E x: [repr failed for <ndarray>: precision must be an integer]
E y: [repr failed for <ndarray>: precision must be an integer]
tests/test_neuron_functional.py:64: AssertionError
Check failure on line 435 in tests/test_extract_input.py
github-actions / JUnit Test Report
tests/test_extract_input.py.test_parameters
AssertionError:
Items are not equal:
key='std'
key='norm'
key='step_size'
key='basal_dendrite'
ACTUAL: 0.0
DESIRED: 0.2
Raw output
def test_parameters():
params = extract_input.parameters(
neurite_types=["basal_dendrite", "apical_dendrite"],
method="tmd",
feature="radial_distances",
)
expected_params = {
"basal_dendrite": {
"randomness": 0.24,
"targeting": 0.14,
"radius": 0.3,
"orientation": None,
"growth_method": "tmd",
"branching_method": "bio_oriented",
"modify": None,
"step_size": {"norm": {"mean": 1.0, "std": 0.2}},
"tree_type": 3,
"metric": "radial_distances",
},
"apical_dendrite": {
"randomness": 0.24,
"targeting": 0.14,
"radius": 0.3,
"orientation": [[0.0, 1.0, 0.0]],
"growth_method": "tmd_apical",
"branching_method": "directional",
"modify": None,
"step_size": {"norm": {"mean": 1.0, "std": 0.2}},
"tree_type": 4,
"metric": "radial_distances",
},
"axon": {},
"origin": [0.0, 0.0, 0.0],
"grow_types": ["basal_dendrite", "apical_dendrite"],
"diameter_params": {"method": "default", "models": ["simpler"]},
}
> assert_equal(params, expected_params)
E AssertionError:
E Items are not equal:
E key='std'
E key='norm'
E key='step_size'
E key='basal_dendrite'
E
E ACTUAL: 0.0
E DESIRED: 0.2
tests/test_extract_input.py:472: AssertionError
Check failure on line 230 in tests/test_neuron_functional.py
github-actions / JUnit Test Report
tests/test_neuron_functional.py.test_convert_orientation2points
AssertionError:
Arrays are not almost equal to 6 decimals
Mismatched elements: 6 / 6 (100%)
Max absolute difference: 17.21720264
Max relative difference: 1.97487997
x: array([[ 3.988692, -4.746541, -8.403649],
[ 4.742347, 8.33385 , 4.137356]])
y: array([[ 2.770599, 4.868847, 8.813554],
[-6.314678, 6.2103 , 5.533321]])
Raw output
def test_convert_orientation2points():
"""Test NeuronGrower._convert_orientation2points()"""
np.random.seed(0)
distributions, parameters = _load_inputs(
os.path.join(_path, "bio_path_distribution.json"),
os.path.join(_path, "bio_path_params.json"),
)
distributions["diameter"]["method"] = "M1"
parameters["diameter_params"]["method"] = "M1"
ng = NeuronGrower(parameters, distributions)
pts = ng._convert_orientation2points([[0, 1, 0]], 1, distributions["apical_dendrite"], {})
assert_array_almost_equal(pts, [[0, 15.27995, 0]])
# Test with no existing trunk
ng = NeuronGrower(parameters, distributions)
pts = ng._convert_orientation2points(None, 2, distributions["apical_dendrite"], {})
assert_array_almost_equal(
pts, [[-10.399604, -0.173343, 0.937449], [10.31932, 0.172005, -1.594578]]
)
with pytest.raises(ValueError):
ng._convert_orientation2points("from_space", 1, distributions["apical_dendrite"], {})
# Test with existing trunks
ng.grow()
pts = ng._convert_orientation2points(None, 2, distributions["apical_dendrite"], {})
> assert_array_almost_equal(pts, [[2.770599, 4.868847, 8.813554], [-6.314678, 6.2103, 5.533321]])
E AssertionError:
E Arrays are not almost equal to 6 decimals
E
E Mismatched elements: 6 / 6 (100%)
E Max absolute difference: 17.21720264
E Max relative difference: 1.97487997
E x: array([[ 3.988692, -4.746541, -8.403649],
E [ 4.742347, 8.33385 , 4.137356]])
E y: array([[ 2.770599, 4.868847, 8.813554],
E [-6.314678, 6.2103 , 5.533321]])
tests/test_neuron_functional.py:259: AssertionError
Check failure on line 722 in tests/test_neuron_functional.py
github-actions / JUnit Test Report
tests/test_neuron_functional.py.test_with_rng
AssertionError:
Arrays are not almost equal to 0 decimals
Mismatched elements: 99 / 166 (59.6%)
Max absolute difference: 5.97778481
Max relative difference: inf
x: [repr failed for <ndarray>: precision must be an integer]
y: [repr failed for <ndarray>: precision must be an integer]
Raw output
self = <tests.test_neuron_functional.TestBioRatL5Tpc4 object at 0x7f921ffdb550>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/tmp/popen-gw0/test_with_rng0')
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:724:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_neuron_functional.py:130: in _test_full
assert_close_persistent_diagram(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
actual = [[126.20707288384438, 124.18468019366264], [170.9764948785305, 167.0840221941471], [426.96366888284683, 424.6997688412...13998508, 1213.6682779490948], [1270.4692512452602, 1268.4173727333546], [1267.8909016549587, 1265.8485963642597], ...]
expected = [[126.09063404798508, 124.10453796386719], [124.20069247484207, 121.377720952034], [123.74416822195053, 119.4144430160...34535217, 117.54309237003326], [123.21093481779099, 118.67947047948837], [169.95419105887413, 164.44511690735817], ...]
def assert_close_persistent_diagram(actual, expected):
# compute distances between points
distances = np.min(cdist(np.array(tmd.analysis.sort_ph(expected)), actual), axis=0)
# We compare distances between expected and generated peristence as it is more stable to check.
# This comparison does not depend on ordering of the points
# and ensures that the points of the original persistence are consistently generated.
assert_almost_equal(len(expected), len(actual))
> assert_array_almost_equal(distances, np.zeros(len(distances)), decimal=0.1)
E AssertionError:
E Arrays are not almost equal to 0 decimals
E
E Mismatched elements: 99 / 166 (59.6%)
E Max absolute difference: 5.97778481
E Max relative difference: inf
E x: [repr failed for <ndarray>: precision must be an integer]
E y: [repr failed for <ndarray>: precision must be an integer]
tests/test_neuron_functional.py:64: AssertionError
Check failure on line 285 in tests/test_neuron_functional.py
github-actions / JUnit Test Report
tests/test_neuron_functional.py.test_breaker_of_tmd_algo
AssertionError:
Arrays are not equal
Mismatched elements: 1 / 1 (100%)
Max absolute difference: 20
Max relative difference: 1.81818182
x: array([31])
y: array([11])
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, [11])
E AssertionError:
E Arrays are not equal
E
E Mismatched elements: 1 / 1 (100%)
E Max absolute difference: 20
E Max relative difference: 1.81818182
E x: array([31])
E y: array([11])
tests/test_neuron_functional.py:297: AssertionError
Check failure on line 630 in tests/test_neuron_functional.py
github-actions / JUnit Test Report
tests/test_neuron_functional.py.test_with_rng
AssertionError:
Arrays are not almost equal to 0 decimals
Mismatched elements: 99 / 166 (59.6%)
Max absolute difference: 5.97778481
Max relative difference: inf
x: [repr failed for <ndarray>: precision must be an integer]
y: [repr failed for <ndarray>: precision must be an integer]
Raw output
self = <tests.test_neuron_functional.TestBioRatL5Tpc2 object at 0x7f79cdfab880>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/tmp/popen-gw2/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:632:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_neuron_functional.py:130: in _test_full
assert_close_persistent_diagram(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
actual = [[126.20707288384438, 124.18468019366264], [170.9764948785305, 167.0840221941471], [426.96366888284683, 424.6997688412...05736828, 1213.6682691276073], [1270.4692129194736, 1268.4174081385136], [1267.8909048736095, 1265.8486044704914], ...]
expected = [[126.09063404798508, 124.10453796386719], [124.20069247484207, 121.377720952034], [123.74416822195053, 119.4144430160...34535217, 117.54309237003326], [123.21093481779099, 118.67947047948837], [169.95419105887413, 164.44511690735817], ...]
def assert_close_persistent_diagram(actual, expected):
# compute distances between points
distances = np.min(cdist(np.array(tmd.analysis.sort_ph(expected)), actual), axis=0)
# We compare distances between expected and generated peristence as it is more stable to check.
# This comparison does not depend on ordering of the points
# and ensures that the points of the original persistence are consistently generated.
assert_almost_equal(len(expected), len(actual))
> assert_array_almost_equal(distances, np.zeros(len(distances)), decimal=0.1)
E AssertionError:
E Arrays are not almost equal to 0 decimals
E
E Mismatched elements: 99 / 166 (59.6%)
E Max absolute difference: 5.97778481
E Max relative difference: inf
E x: [repr failed for <ndarray>: precision must be an integer]
E y: [repr failed for <ndarray>: precision must be an integer]
tests/test_neuron_functional.py:64: AssertionError
Check failure on line 404 in tests/test_neuron_functional.py
github-actions / JUnit Test Report
tests/test_neuron_functional.py.test_basic_grower
AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f5f9cb21610>
+ where <morph_tool.morphio_diff.DiffResult object at 0x7f5f9cb21610> = diff('/tmp/tmpb_mul8ngtest_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/min_versions/tmp/popen-gw1/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:406:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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': 'default'}, ...}
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/min_versions/tmp/popen-gw1/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 0x7f5f9cb21610>
E + where <morph_tool.morphio_diff.DiffResult object at 0x7f5f9cb21610> = diff('/tmp/tmpb_mul8ngtest_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:134: AssertionError
Check failure on line 424 in tests/test_neuron_functional.py
github-actions / JUnit Test Report
tests/test_neuron_functional.py.test_basic_grower_with_generator
AssertionError:
Arrays are not almost equal to 6 decimals
Mismatched elements: 12 / 12 (100%)
Max absolute difference: 0.48995399
Max relative difference: 0.03906569
x: array([[ -0.735153, 7.644973, 11.233667],
[-12.953229, -1.245603, 2.840654],
[ 11.739761, -0.048908, 6.065145],
[ -2.473414, 13.031774, 1.161751]])
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,
)
E AssertionError:
E Arrays are not almost equal to 6 decimals
E
E Mismatched elements: 12 / 12 (100%)
E Max absolute difference: 0.48995399
E Max relative difference: 0.03906569
E x: array([[ -0.735153, 7.644973, 11.233667],
E [-12.953229, -1.245603, 2.840654],
E [ 11.739761, -0.048908, 6.065145],
E [ -2.473414, 13.031774, 1.161751]])
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]])
tests/test_neuron_functional.py:447: AssertionError
Check failure on line 458 in tests/test_neuron_functional.py
github-actions / JUnit Test Report
tests/test_neuron_functional.py.test_default
AssertionError:
Arrays are not almost equal to 0 decimals
Mismatched elements: 24 / 30 (80%)
Max absolute difference: 6.52711276
Max relative difference: inf
x: [repr failed for <ndarray>: precision must be an integer]
y: [repr failed for <ndarray>: precision must be an integer]
Raw output
self = <tests.test_neuron_functional.TestPathGrower object at 0x7f5f9cc99e50>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/tmp/popen-gw1/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:460:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_neuron_functional.py:130: in _test_full
assert_close_persistent_diagram(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
actual = [[228.43791699409485, 176.3804026246071], [410.6560436785221, 257.72839722037315], [356.80644530057907, 227.2868405580...966556429863, 262.0794067978859], [293.5738722085953, 230.16321766376495], [297.7998881340027, 262.5229294896126], ...]
expected = [[230.7538954615593, 174.5645745396614], [211.8444786965847, 121.25272232294083], [245.5548558831215, 109.709204673767...2109594345, 89.25957471132278], [128.93621239066124, 118.54867050051689], [158.5662106871605, 138.94545936584473], ...]
def assert_close_persistent_diagram(actual, expected):
# compute distances between points
distances = np.min(cdist(np.array(tmd.analysis.sort_ph(expected)), actual), axis=0)
# We compare distances between expected and generated peristence as it is more stable to check.
# This comparison does not depend on ordering of the points
# and ensures that the points of the original persistence are consistently generated.
assert_almost_equal(len(expected), len(actual))
> assert_array_almost_equal(distances, np.zeros(len(distances)), decimal=0.1)
E AssertionError:
E Arrays are not almost equal to 0 decimals
E
E Mismatched elements: 24 / 30 (80%)
E Max absolute difference: 6.52711276
E Max relative difference: inf
E x: [repr failed for <ndarray>: precision must be an integer]
E y: [repr failed for <ndarray>: precision must be an integer]
tests/test_neuron_functional.py:64: AssertionError
Check failure on line 468 in tests/test_neuron_functional.py
github-actions / JUnit Test Report
tests/test_neuron_functional.py.test_with_rng
AssertionError:
Arrays are not almost equal to 0 decimals
Mismatched elements: 24 / 30 (80%)
Max absolute difference: 6.52711276
Max relative difference: inf
x: [repr failed for <ndarray>: precision must be an integer]
y: [repr failed for <ndarray>: precision must be an integer]
Raw output
self = <tests.test_neuron_functional.TestPathGrower object at 0x7f5f9cb24490>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/tmp/popen-gw1/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:470:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_neuron_functional.py:130: in _test_full
assert_close_persistent_diagram(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
actual = [[228.43791699409485, 176.3804026246071], [410.6560436785221, 257.72839722037315], [356.80644530057907, 227.2868405580...966556429863, 262.0794067978859], [293.5738722085953, 230.16321766376495], [297.7998881340027, 262.5229294896126], ...]
expected = [[230.7538954615593, 174.5645745396614], [211.8444786965847, 121.25272232294083], [245.5548558831215, 109.709204673767...2109594345, 89.25957471132278], [128.93621239066124, 118.54867050051689], [158.5662106871605, 138.94545936584473], ...]
def assert_close_persistent_diagram(actual, expected):
# compute distances between points
distances = np.min(cdist(np.array(tmd.analysis.sort_ph(expected)), actual), axis=0)
# We compare distances between expected and generated peristence as it is more stable to check.
# This comparison does not depend on ordering of the points
# and ensures that the points of the original persistence are consistently generated.
assert_almost_equal(len(expected), len(actual))
> assert_array_almost_equal(distances, np.zeros(len(distances)), decimal=0.1)
E AssertionError:
E Arrays are not almost equal to 0 decimals
E
E Mismatched elements: 24 / 30 (80%)
E Max absolute difference: 6.52711276
E Max relative difference: inf
E x: [repr failed for <ndarray>: precision must be an integer]
E y: [repr failed for <ndarray>: precision must be an integer]
tests/test_neuron_functional.py:64: AssertionError
Check failure on line 733 in tests/test_neuron_functional.py
github-actions / JUnit Test Report
tests/test_neuron_functional.py.test_skip_preprocessing
AssertionError:
Arrays are not almost equal to 0 decimals
Mismatched elements: 99 / 166 (59.6%)
Max absolute difference: 5.97778481
Max relative difference: inf
x: [repr failed for <ndarray>: precision must be an integer]
y: [repr failed for <ndarray>: precision must be an integer]
Raw output
self = <tests.test_neuron_functional.TestBioRatL5Tpc4 object at 0x7f921fffe580>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/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:735:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_neuron_functional.py:130: in _test_full
assert_close_persistent_diagram(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
actual = [[126.20707288384438, 124.18468019366264], [170.9764948785305, 167.0840221941471], [426.96366888284683, 424.6997688412...13998508, 1213.6682779490948], [1270.4692512452602, 1268.4173727333546], [1267.8909016549587, 1265.8485963642597], ...]
expected = [[126.09063404798508, 124.10453796386719], [124.20069247484207, 121.377720952034], [123.74416822195053, 119.4144430160...34535217, 117.54309237003326], [123.21093481779099, 118.67947047948837], [169.95419105887413, 164.44511690735817], ...]
def assert_close_persistent_diagram(actual, expected):
# compute distances between points
distances = np.min(cdist(np.array(tmd.analysis.sort_ph(expected)), actual), axis=0)
# We compare distances between expected and generated peristence as it is more stable to check.
# This comparison does not depend on ordering of the points
# and ensures that the points of the original persistence are consistently generated.
assert_almost_equal(len(expected), len(actual))
> assert_array_almost_equal(distances, np.zeros(len(distances)), decimal=0.1)
E AssertionError:
E Arrays are not almost equal to 0 decimals
E
E Mismatched elements: 99 / 166 (59.6%)
E Max absolute difference: 5.97778481
E Max relative difference: inf
E x: [repr failed for <ndarray>: precision must be an integer]
E y: [repr failed for <ndarray>: precision must be an integer]
tests/test_neuron_functional.py:64: AssertionError
Check failure on line 528 in tests/test_neuron_functional.py
github-actions / JUnit Test Report
tests/test_neuron_functional.py.test_default
AssertionError:
Arrays are not almost equal to 0 decimals
Mismatched elements: 24 / 30 (80%)
Max absolute difference: 6.52711158
Max relative difference: inf
x: [repr failed for <ndarray>: precision must be an integer]
y: [repr failed for <ndarray>: precision must be an integer]
Raw output
self = <tests.test_neuron_functional.TestGradientPathGrower object at 0x7f526cdb9610>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/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:530:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_neuron_functional.py:130: in _test_full
assert_close_persistent_diagram(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
actual = [[228.4379117488861, 176.3804066181183], [410.6560550928116, 257.7284023165703], [356.8064535856247, 227.2868487834930...6505765915, 262.0794129371643], [293.5738842487335, 230.16322070360184], [297.79988700151443, 262.52293276786804], ...]
expected = [[230.75390711426735, 174.5645757317543], [211.84447130560875, 121.25272387266159], [245.55485528707504, 109.709209322...8195462227, 89.25957936048508], [128.93621596693993, 118.54866543412209], [158.5662096142769, 138.94545817375183], ...]
def assert_close_persistent_diagram(actual, expected):
# compute distances between points
distances = np.min(cdist(np.array(tmd.analysis.sort_ph(expected)), actual), axis=0)
# We compare distances between expected and generated peristence as it is more stable to check.
# This comparison does not depend on ordering of the points
# and ensures that the points of the original persistence are consistently generated.
assert_almost_equal(len(expected), len(actual))
> assert_array_almost_equal(distances, np.zeros(len(distances)), decimal=0.1)
E AssertionError:
E Arrays are not almost equal to 0 decimals
E
E Mismatched elements: 24 / 30 (80%)
E Max absolute difference: 6.52711158
E Max relative difference: inf
E x: [repr failed for <ndarray>: precision must be an integer]
E y: [repr failed for <ndarray>: precision must be an integer]
tests/test_neuron_functional.py:64: AssertionError
Check failure on line 641 in tests/test_neuron_functional.py
github-actions / JUnit Test Report
tests/test_neuron_functional.py.test_skip_preprocessing
AssertionError:
Arrays are not almost equal to 0 decimals
Mismatched elements: 99 / 166 (59.6%)
Max absolute difference: 5.97778481
Max relative difference: inf
x: [repr failed for <ndarray>: precision must be an integer]
y: [repr failed for <ndarray>: precision must be an integer]
Raw output
self = <tests.test_neuron_functional.TestBioRatL5Tpc2 object at 0x7f79cdf94d00>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/tmp/popen-gw2/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:643:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_neuron_functional.py:130: in _test_full
assert_close_persistent_diagram(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
actual = [[126.20707288384438, 124.18468019366264], [170.9764948785305, 167.0840221941471], [426.96366888284683, 424.6997688412...05736828, 1213.6682691276073], [1270.4692129194736, 1268.4174081385136], [1267.8909048736095, 1265.8486044704914], ...]
expected = [[126.09063404798508, 124.10453796386719], [124.20069247484207, 121.377720952034], [123.74416822195053, 119.4144430160...34535217, 117.54309237003326], [123.21093481779099, 118.67947047948837], [169.95419105887413, 164.44511690735817], ...]
def assert_close_persistent_diagram(actual, expected):
# compute distances between points
distances = np.min(cdist(np.array(tmd.analysis.sort_ph(expected)), actual), axis=0)
# We compare distances between expected and generated peristence as it is more stable to check.
# This comparison does not depend on ordering of the points
# and ensures that the points of the original persistence are consistently generated.
assert_almost_equal(len(expected), len(actual))
> assert_array_almost_equal(distances, np.zeros(len(distances)), decimal=0.1)
E AssertionError:
E Arrays are not almost equal to 0 decimals
E
E Mismatched elements: 99 / 166 (59.6%)
E Max absolute difference: 5.97778481
E Max relative difference: inf
E x: [repr failed for <ndarray>: precision must be an integer]
E y: [repr failed for <ndarray>: precision must be an integer]
tests/test_neuron_functional.py:64: AssertionError
Check failure on line 479 in tests/test_neuron_functional.py
github-actions / JUnit Test Report
tests/test_neuron_functional.py.test_skip_preprocessing
AssertionError:
Arrays are not almost equal to 0 decimals
Mismatched elements: 24 / 30 (80%)
Max absolute difference: 6.52711276
Max relative difference: inf
x: [repr failed for <ndarray>: precision must be an integer]
y: [repr failed for <ndarray>: precision must be an integer]
Raw output
self = <tests.test_neuron_functional.TestPathGrower object at 0x7f5f9ca92be0>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/tmp/popen-gw1/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:481:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_neuron_functional.py:130: in _test_full
assert_close_persistent_diagram(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
actual = [[228.43791699409485, 176.3804026246071], [410.6560436785221, 257.72839722037315], [356.80644530057907, 227.2868405580...966556429863, 262.0794067978859], [293.5738722085953, 230.16321766376495], [297.7998881340027, 262.5229294896126], ...]
expected = [[230.7538954615593, 174.5645745396614], [211.8444786965847, 121.25272232294083], [245.5548558831215, 109.709204673767...2109594345, 89.25957471132278], [128.93621239066124, 118.54867050051689], [158.5662106871605, 138.94545936584473], ...]
def assert_close_persistent_diagram(actual, expected):
# compute distances between points
distances = np.min(cdist(np.array(tmd.analysis.sort_ph(expected)), actual), axis=0)
# We compare distances between expected and generated peristence as it is more stable to check.
# This comparison does not depend on ordering of the points
# and ensures that the points of the original persistence are consistently generated.
assert_almost_equal(len(expected), len(actual))
> assert_array_almost_equal(distances, np.zeros(len(distances)), decimal=0.1)
E AssertionError:
E Arrays are not almost equal to 0 decimals
E
E Mismatched elements: 24 / 30 (80%)
E Max absolute difference: 6.52711276
E Max relative difference: inf
E x: [repr failed for <ndarray>: precision must be an integer]
E y: [repr failed for <ndarray>: precision must be an integer]
tests/test_neuron_functional.py:64: AssertionError
Check failure on line 538 in tests/test_neuron_functional.py
github-actions / JUnit Test Report
tests/test_neuron_functional.py.test_with_rng
AssertionError:
Arrays are not almost equal to 0 decimals
Mismatched elements: 24 / 30 (80%)
Max absolute difference: 6.52711158
Max relative difference: inf
x: [repr failed for <ndarray>: precision must be an integer]
y: [repr failed for <ndarray>: precision must be an integer]
Raw output
self = <tests.test_neuron_functional.TestGradientPathGrower object at 0x7f526cd3f6a0>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/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:540:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_neuron_functional.py:130: in _test_full
assert_close_persistent_diagram(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
actual = [[228.4379117488861, 176.3804066181183], [410.6560550928116, 257.7284023165703], [356.8064535856247, 227.2868487834930...6505765915, 262.0794129371643], [293.5738842487335, 230.16322070360184], [297.79988700151443, 262.52293276786804], ...]
expected = [[230.75390711426735, 174.5645757317543], [211.84447130560875, 121.25272387266159], [245.55485528707504, 109.709209322...8195462227, 89.25957936048508], [128.93621596693993, 118.54866543412209], [158.5662096142769, 138.94545817375183], ...]
def assert_close_persistent_diagram(actual, expected):
# compute distances between points
distances = np.min(cdist(np.array(tmd.analysis.sort_ph(expected)), actual), axis=0)
# We compare distances between expected and generated peristence as it is more stable to check.
# This comparison does not depend on ordering of the points
# and ensures that the points of the original persistence are consistently generated.
assert_almost_equal(len(expected), len(actual))
> assert_array_almost_equal(distances, np.zeros(len(distances)), decimal=0.1)
E AssertionError:
E Arrays are not almost equal to 0 decimals
E
E Mismatched elements: 24 / 30 (80%)
E Max absolute difference: 6.52711158
E Max relative difference: inf
E x: [repr failed for <ndarray>: precision must be an integer]
E y: [repr failed for <ndarray>: precision must be an integer]
tests/test_neuron_functional.py:64: AssertionError
Check failure on line 490 in tests/test_neuron_functional.py
github-actions / JUnit Test Report
tests/test_neuron_functional.py.test_skip_rng_and_preprocessing
AssertionError:
Arrays are not almost equal to 0 decimals
Mismatched elements: 24 / 30 (80%)
Max absolute difference: 6.52711276
Max relative difference: inf
x: [repr failed for <ndarray>: precision must be an integer]
y: [repr failed for <ndarray>: precision must be an integer]
Raw output
self = <tests.test_neuron_functional.TestPathGrower object at 0x7f5f9ca9cf40>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/tmp/popen-gw1/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:492:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_neuron_functional.py:130: in _test_full
assert_close_persistent_diagram(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
actual = [[228.43791699409485, 176.3804026246071], [410.6560436785221, 257.72839722037315], [356.80644530057907, 227.2868405580...966556429863, 262.0794067978859], [293.5738722085953, 230.16321766376495], [297.7998881340027, 262.5229294896126], ...]
expected = [[230.7538954615593, 174.5645745396614], [211.8444786965847, 121.25272232294083], [245.5548558831215, 109.709204673767...2109594345, 89.25957471132278], [128.93621239066124, 118.54867050051689], [158.5662106871605, 138.94545936584473], ...]
def assert_close_persistent_diagram(actual, expected):
# compute distances between points
distances = np.min(cdist(np.array(tmd.analysis.sort_ph(expected)), actual), axis=0)
# We compare distances between expected and generated peristence as it is more stable to check.
# This comparison does not depend on ordering of the points
# and ensures that the points of the original persistence are consistently generated.
assert_almost_equal(len(expected), len(actual))
> assert_array_almost_equal(distances, np.zeros(len(distances)), decimal=0.1)
E AssertionError:
E Arrays are not almost equal to 0 decimals
E
E Mismatched elements: 24 / 30 (80%)
E Max absolute difference: 6.52711276
E Max relative difference: inf
E x: [repr failed for <ndarray>: precision must be an integer]
E y: [repr failed for <ndarray>: precision must be an integer]
tests/test_neuron_functional.py:64: AssertionError
Check failure on line 744 in tests/test_neuron_functional.py
github-actions / JUnit Test Report
tests/test_neuron_functional.py.test_skip_rng_and_preprocessing
AssertionError:
Arrays are not almost equal to 0 decimals
Mismatched elements: 99 / 166 (59.6%)
Max absolute difference: 5.97778481
Max relative difference: inf
x: [repr failed for <ndarray>: precision must be an integer]
y: [repr failed for <ndarray>: precision must be an integer]
Raw output
self = <tests.test_neuron_functional.TestBioRatL5Tpc4 object at 0x7f92163a4880>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/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:746:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_neuron_functional.py:130: in _test_full
assert_close_persistent_diagram(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
actual = [[126.20707288384438, 124.18468019366264], [170.9764948785305, 167.0840221941471], [426.96366888284683, 424.6997688412...13998508, 1213.6682779490948], [1270.4692512452602, 1268.4173727333546], [1267.8909016549587, 1265.8485963642597], ...]
expected = [[126.09063404798508, 124.10453796386719], [124.20069247484207, 121.377720952034], [123.74416822195053, 119.4144430160...34535217, 117.54309237003326], [123.21093481779099, 118.67947047948837], [169.95419105887413, 164.44511690735817], ...]
def assert_close_persistent_diagram(actual, expected):
# compute distances between points
distances = np.min(cdist(np.array(tmd.analysis.sort_ph(expected)), actual), axis=0)
# We compare distances between expected and generated peristence as it is more stable to check.
# This comparison does not depend on ordering of the points
# and ensures that the points of the original persistence are consistently generated.
assert_almost_equal(len(expected), len(actual))
> assert_array_almost_equal(distances, np.zeros(len(distances)), decimal=0.1)
E AssertionError:
E Arrays are not almost equal to 0 decimals
E
E Mismatched elements: 99 / 166 (59.6%)
E Max absolute difference: 5.97778481
E Max relative difference: inf
E x: [repr failed for <ndarray>: precision must be an integer]
E y: [repr failed for <ndarray>: precision must be an integer]
tests/test_neuron_functional.py:64: AssertionError
Check failure on line 652 in tests/test_neuron_functional.py
github-actions / JUnit Test Report
tests/test_neuron_functional.py.test_skip_rng_and_preprocessing
AssertionError:
Arrays are not almost equal to 0 decimals
Mismatched elements: 99 / 166 (59.6%)
Max absolute difference: 5.97778481
Max relative difference: inf
x: [repr failed for <ndarray>: precision must be an integer]
y: [repr failed for <ndarray>: precision must be an integer]
Raw output
self = <tests.test_neuron_functional.TestBioRatL5Tpc2 object at 0x7f79ce173370>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/tmp/popen-gw2/test_skip_rng_and_preprocessin0')
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:654:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_neuron_functional.py:130: in _test_full
assert_close_persistent_diagram(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
actual = [[126.20707288384438, 124.18468019366264], [170.9764948785305, 167.0840221941471], [426.96366888284683, 424.6997688412...05736828, 1213.6682691276073], [1270.4692129194736, 1268.4174081385136], [1267.8909048736095, 1265.8486044704914], ...]
expected = [[126.09063404798508, 124.10453796386719], [124.20069247484207, 121.377720952034], [123.74416822195053, 119.4144430160...34535217, 117.54309237003326], [123.21093481779099, 118.67947047948837], [169.95419105887413, 164.44511690735817], ...]
def assert_close_persistent_diagram(actual, expected):
# compute distances between points
distances = np.min(cdist(np.array(tmd.analysis.sort_ph(expected)), actual), axis=0)
# We compare distances between expected and generated peristence as it is more stable to check.
# This comparison does not depend on ordering of the points
# and ensures that the points of the original persistence are consistently generated.
assert_almost_equal(len(expected), len(actual))
> assert_array_almost_equal(distances, np.zeros(len(distances)), decimal=0.1)
E AssertionError:
E Arrays are not almost equal to 0 decimals
E
E Mismatched elements: 99 / 166 (59.6%)
E Max absolute difference: 5.97778481
E Max relative difference: inf
E x: [repr failed for <ndarray>: precision must be an integer]
E y: [repr failed for <ndarray>: precision must be an integer]
tests/test_neuron_functional.py:64: AssertionError
Check failure on line 549 in tests/test_neuron_functional.py
github-actions / JUnit Test Report
tests/test_neuron_functional.py.test_skip_preprocessing
AssertionError:
Arrays are not almost equal to 0 decimals
Mismatched elements: 24 / 30 (80%)
Max absolute difference: 6.52711158
Max relative difference: inf
x: [repr failed for <ndarray>: precision must be an integer]
y: [repr failed for <ndarray>: precision must be an integer]
Raw output
self = <tests.test_neuron_functional.TestGradientPathGrower object at 0x7f526cd13be0>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/tmp/popen-gw3/test_skip_preprocessing0')
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:551:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_neuron_functional.py:130: in _test_full
assert_close_persistent_diagram(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
actual = [[228.4379117488861, 176.3804066181183], [410.6560550928116, 257.7284023165703], [356.8064535856247, 227.2868487834930...6505765915, 262.0794129371643], [293.5738842487335, 230.16322070360184], [297.79988700151443, 262.52293276786804], ...]
expected = [[230.75390711426735, 174.5645757317543], [211.84447130560875, 121.25272387266159], [245.55485528707504, 109.709209322...8195462227, 89.25957936048508], [128.93621596693993, 118.54866543412209], [158.5662096142769, 138.94545817375183], ...]
def assert_close_persistent_diagram(actual, expected):
# compute distances between points
distances = np.min(cdist(np.array(tmd.analysis.sort_ph(expected)), actual), axis=0)
# We compare distances between expected and generated peristence as it is more stable to check.
# This comparison does not depend on ordering of the points
# and ensures that the points of the original persistence are consistently generated.
assert_almost_equal(len(expected), len(actual))
> assert_array_almost_equal(distances, np.zeros(len(distances)), decimal=0.1)
E AssertionError:
E Arrays are not almost equal to 0 decimals
E
E Mismatched elements: 24 / 30 (80%)
E Max absolute difference: 6.52711158
E Max relative difference: inf
E x: [repr failed for <ndarray>: precision must be an integer]
E y: [repr failed for <ndarray>: precision must be an integer]
tests/test_neuron_functional.py:64: AssertionError
Check failure on line 436 in tests/test_soma_grower.py
github-actions / JUnit Test Report
tests/test_soma_grower.py.test_soma_grower
AssertionError:
Arrays are not almost equal to 6 decimals
Mismatched elements: 3 / 9 (33.3%)
Max absolute difference: 0.10920715
Max relative difference: 0.04758658
x: array([[-1.161602, -7.935147, 13.00619 ],
[-1.224638, -8.365755, 13.711984],
[-1.375695, -8.734178, 14.549607]], dtype=float32)
y: array([[-1.161602, -7.935147, 13.00619 ],
[-1.224638, -8.365755, 13.711984],
[-1.44443 , -8.843385, 14.457643]], dtype=float32)
Raw output
def test_soma_grower():
# pylint: disable=no-member
# pylint: disable=unsubscriptable-object
np.random.seed(0)
with open(os.path.join(_path, "dummy_distribution.json"), encoding="utf-8") as f:
distributions = json.load(f)
with open(os.path.join(_path, "dummy_params.json"), encoding="utf-8") as f:
params = json.load(f)
grower = NeuronGrower(input_distributions=distributions, input_parameters=params).grow()
expected = morphio.Morphology(os.path.join(_path, "dummy_neuron.asc"))
assert_array_almost_equal(grower.soma.points, expected.soma.points)
> assert_array_almost_equal(grower.root_sections[0].points, expected.root_sections[0].points)
E AssertionError:
E Arrays are not almost equal to 6 decimals
E
E Mismatched elements: 3 / 9 (33.3%)
E Max absolute difference: 0.10920715
E Max relative difference: 0.04758658
E x: array([[-1.161602, -7.935147, 13.00619 ],
E [-1.224638, -8.365755, 13.711984],
E [-1.375695, -8.734178, 14.549607]], dtype=float32)
E y: array([[-1.161602, -7.935147, 13.00619 ],
E [-1.224638, -8.365755, 13.711984],
E [-1.44443 , -8.843385, 14.457643]], dtype=float32)
tests/test_soma_grower.py:452: AssertionError
Check failure on line 560 in tests/test_neuron_functional.py
github-actions / JUnit Test Report
tests/test_neuron_functional.py.test_skip_rng_and_preprocessing
AssertionError:
Arrays are not almost equal to 0 decimals
Mismatched elements: 24 / 30 (80%)
Max absolute difference: 6.52711158
Max relative difference: inf
x: [repr failed for <ndarray>: precision must be an integer]
y: [repr failed for <ndarray>: precision must be an integer]
Raw output
self = <tests.test_neuron_functional.TestGradientPathGrower object at 0x7f526cddc430>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/tmp/popen-gw3/test_skip_rng_and_preprocessin0')
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:562:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_neuron_functional.py:130: in _test_full
assert_close_persistent_diagram(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
actual = [[228.4379117488861, 176.3804066181183], [410.6560550928116, 257.7284023165703], [356.8064535856247, 227.2868487834930...6505765915, 262.0794129371643], [293.5738842487335, 230.16322070360184], [297.79988700151443, 262.52293276786804], ...]
expected = [[230.75390711426735, 174.5645757317543], [211.84447130560875, 121.25272387266159], [245.55485528707504, 109.709209322...8195462227, 89.25957936048508], [128.93621596693993, 118.54866543412209], [158.5662096142769, 138.94545817375183], ...]
def assert_close_persistent_diagram(actual, expected):
# compute distances between points
distances = np.min(cdist(np.array(tmd.analysis.sort_ph(expected)), actual), axis=0)
# We compare distances between expected and generated peristence as it is more stable to check.
# This comparison does not depend on ordering of the points
# and ensures that the points of the original persistence are consistently generated.
assert_almost_equal(len(expected), len(actual))
> assert_array_almost_equal(distances, np.zeros(len(distances)), decimal=0.1)
E AssertionError:
E Arrays are not almost equal to 0 decimals
E
E Mismatched elements: 24 / 30 (80%)
E Max absolute difference: 6.52711158
E Max relative difference: inf
E x: [repr failed for <ndarray>: precision must be an integer]
E y: [repr failed for <ndarray>: precision must be an integer]
tests/test_neuron_functional.py:64: AssertionError
Check failure on line 456 in tests/test_soma_grower.py
github-actions / JUnit Test Report
tests/test_soma_grower.py.test_apical_points
AssertionError:
Arrays are not equal
Mismatched elements: 1 / 1 (100%)
Max absolute difference: 17
Max relative difference: 0.13385827
x: array(110)
y: array([127])
Raw output
def test_apical_points():
# Found apical point
np.random.seed(0)
with open(os.path.join(_path, "bio_distribution.json"), encoding="utf-8") as f:
distributions = json.load(f)
with open(os.path.join(_path, "bio_path_params.json"), encoding="utf-8") as f:
params = json.load(f)
grower = NeuronGrower(input_distributions=distributions, input_parameters=params)
grower.grow()
apicals = grower.apical_sections
expected = [127]
> assert_array_equal(apicals[0], expected)
E AssertionError:
E Arrays are not equal
E
E Mismatched elements: 1 / 1 (100%)
E Max absolute difference: 17
E Max relative difference: 0.13385827
E x: array(110)
E y: array([127])
tests/test_soma_grower.py:471: AssertionError
Check failure on line 246 in tests/astrocyte/test_grower.py
github-actions / JUnit Test Report
tests/astrocyte/test_grower.py.test_grow__run[Use global numpy random seed]
TypeError: bifurcate() got an unexpected keyword argument 'two_major'
Raw output
rng_type = 'global'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f921632bc10>
@pytest.mark.parametrize(
"rng_type",
[
pytest.param("global", id="Use global numpy random seed"),
pytest.param("legacy", id="Use RNG instance with legacy constructor"),
],
)
def test_grow__run(rng_type, monkeypatch):
"""Test the astrocyte grower."""
parameters = _parameters()
distributions = _distributions()
context = _context()
if rng_type == "global":
rng = _global_rng()
elif rng_type == "legacy":
rng = _legacy_rng()
else:
raise ValueError("Bad rng_type")
# In this test all the cos and arccos values are rounded because np.cos and np.arccos
# functions can return different value, depending on the system libraries used to actually
# compute these values.
monkeypatch.setattr(np, "cos", _rounded_cos)
monkeypatch.setattr(np, "arccos", _rounded_arccos)
astro_grower = AstrocyteGrower(
input_distributions=distributions,
input_parameters=parameters,
context=context,
rng_or_seed=rng,
)
> astro_grower.grow()
tests/astrocyte/test_grower.py:280:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
neurots/generate/grower.py:165: in grow
self.next() # pylint: disable=E1102
neurots/generate/grower.py:151: in next
grower.next_point()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <neurots.astrocyte.tree.TreeGrowerSpaceColonization object at 0x7f9216329040>
def next_point(self):
"""Operates the tree growth according to the selected algorithm."""
if not isinstance(self.growth_algo, basicgrower.TrunkAlgo):
ordered_sections = self.order_per_bif(self.active_sections)
else:
# TrunkAlgo does not keep track of the bifurcations so it is not
# possible to order per bifurcation
ordered_sections = np.copy(self.active_sections)
for section_grower in ordered_sections:
# the current section_grower is generated
# In here the stop criterion can be modified accordingly
state = self.growth_algo.extend(section_grower)
if state != "continue":
section = self.append_section(section_grower)
if state == "bifurcate":
# Save the final normed direction of parent
latest = section_grower.latest_directions[-1]
section_grower.id = section.id
# the current section_grower bifurcates
# Returns two section_grower dictionaries: (S1, S2)
> for child_section in self.growth_algo.bifurcate(
section_grower, two_major=self.two_major
):
E TypeError: bifurcate() got an unexpected keyword argument 'two_major'
neurots/generate/tree.py:265: TypeError
Check failure on line 246 in tests/astrocyte/test_grower.py
github-actions / JUnit Test Report
tests/astrocyte/test_grower.py.test_grow__run[Use RNG instance with legacy constructor]
TypeError: bifurcate() got an unexpected keyword argument 'two_major'
Raw output
rng_type = 'legacy'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f921639edc0>
@pytest.mark.parametrize(
"rng_type",
[
pytest.param("global", id="Use global numpy random seed"),
pytest.param("legacy", id="Use RNG instance with legacy constructor"),
],
)
def test_grow__run(rng_type, monkeypatch):
"""Test the astrocyte grower."""
parameters = _parameters()
distributions = _distributions()
context = _context()
if rng_type == "global":
rng = _global_rng()
elif rng_type == "legacy":
rng = _legacy_rng()
else:
raise ValueError("Bad rng_type")
# In this test all the cos and arccos values are rounded because np.cos and np.arccos
# functions can return different value, depending on the system libraries used to actually
# compute these values.
monkeypatch.setattr(np, "cos", _rounded_cos)
monkeypatch.setattr(np, "arccos", _rounded_arccos)
astro_grower = AstrocyteGrower(
input_distributions=distributions,
input_parameters=parameters,
context=context,
rng_or_seed=rng,
)
> astro_grower.grow()
tests/astrocyte/test_grower.py:280:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
neurots/generate/grower.py:165: in grow
self.next() # pylint: disable=E1102
neurots/generate/grower.py:151: in next
grower.next_point()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <neurots.astrocyte.tree.TreeGrowerSpaceColonization object at 0x7f9216322040>
def next_point(self):
"""Operates the tree growth according to the selected algorithm."""
if not isinstance(self.growth_algo, basicgrower.TrunkAlgo):
ordered_sections = self.order_per_bif(self.active_sections)
else:
# TrunkAlgo does not keep track of the bifurcations so it is not
# possible to order per bifurcation
ordered_sections = np.copy(self.active_sections)
for section_grower in ordered_sections:
# the current section_grower is generated
# In here the stop criterion can be modified accordingly
state = self.growth_algo.extend(section_grower)
if state != "continue":
section = self.append_section(section_grower)
if state == "bifurcate":
# Save the final normed direction of parent
latest = section_grower.latest_directions[-1]
section_grower.id = section.id
# the current section_grower bifurcates
# Returns two section_grower dictionaries: (S1, S2)
> for child_section in self.growth_algo.bifurcate(
section_grower, two_major=self.two_major
):
E TypeError: bifurcate() got an unexpected keyword argument 'two_major'
neurots/generate/tree.py:265: TypeError
Check failure on line 666 in tests/test_neuron_functional.py
github-actions / JUnit Test Report
tests/test_neuron_functional.py.test_default
AssertionError:
Arrays are not almost equal to 0 decimals
Mismatched elements: 99 / 166 (59.6%)
Max absolute difference: 5.97780123
Max relative difference: inf
x: [repr failed for <ndarray>: precision must be an integer]
y: [repr failed for <ndarray>: precision must be an integer]
Raw output
self = <tests.test_neuron_functional.TestBioRatL5Tpc3 object at 0x7f79ce1b0220>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/tmp/popen-gw2/test_default1')
def test_default(self, tmpdir):
> _test_full(
"path_distances",
"bio_rat_L5_TPC_B_distribution.json",
"params3.json",
"expected_bio_rat_L5_TPC_B_with_params3.h5",
"expected_bio_rat_L5_TPC_B_with_params3_persistence_diagram.json",
output_dir=tmpdir,
)
tests/test_neuron_functional.py:668:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_neuron_functional.py:130: in _test_full
assert_close_persistent_diagram(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
actual = [[126.20707288384438, 124.18468019366264], [170.97648984193802, 167.08401316404343], [426.9636752009392, 424.699791133...01372147, 1213.6682864427567], [1270.4692350029945, 1268.4173693060875], [1267.8908437490463, 1265.8485562205315], ...]
expected = [[126.09063404798508, 124.10453796386719], [124.20069247484207, 121.377720952034], [123.74416822195053, 119.4144430160...34535217, 117.54309237003326], [123.21093481779099, 118.67947047948837], [169.95419105887413, 164.44511690735817], ...]
def assert_close_persistent_diagram(actual, expected):
# compute distances between points
distances = np.min(cdist(np.array(tmd.analysis.sort_ph(expected)), actual), axis=0)
# We compare distances between expected and generated peristence as it is more stable to check.
# This comparison does not depend on ordering of the points
# and ensures that the points of the original persistence are consistently generated.
assert_almost_equal(len(expected), len(actual))
> assert_array_almost_equal(distances, np.zeros(len(distances)), decimal=0.1)
E AssertionError:
E Arrays are not almost equal to 0 decimals
E
E Mismatched elements: 99 / 166 (59.6%)
E Max absolute difference: 5.97780123
E Max relative difference: inf
E x: [repr failed for <ndarray>: precision must be an integer]
E y: [repr failed for <ndarray>: precision must be an integer]
tests/test_neuron_functional.py:64: AssertionError