Add context handling with accept/reject #681
223 tests run, 185 passed, 0 skipped, 38 failed.
Annotations
github-actions / JUnit Test Report
test_grower.test_grow__run[Use global numpy random seed]
AssertionError: Attributes Section.points of:
Section(id=2, points=[(-9.5638 23.2797 -3.17081),..., (-213.429 -31.9038 -13.2378)])
Section(id=2, points=[(-9.5638 23.2797 -3.17081),..., (-212.837 -31.7317 -13.2097)])
have different shapes: (212, 3) vs (213, 3)
assert not <morph_tool.morphio_diff.DiffResult object at 0x7fc9a64c3710>
Raw output
rng_type = 'global'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fc9a6591b90>
@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()
_check_neurots_soma(astro_grower.soma_grower.soma)
difference = diff(astro_grower.neuron, _path / "astrocyte.h5")
> assert not difference, difference.info
E AssertionError: Attributes Section.points of:
E Section(id=2, points=[(-9.5638 23.2797 -3.17081),..., (-213.429 -31.9038 -13.2378)])
E Section(id=2, points=[(-9.5638 23.2797 -3.17081),..., (-212.837 -31.7317 -13.2097)])
E have different shapes: (212, 3) vs (213, 3)
E assert not <morph_tool.morphio_diff.DiffResult object at 0x7fc9a64c3710>
tests/astrocyte/test_grower.py:275: AssertionError
Check failure on line 158 in tests/test_extract_input.py
github-actions / JUnit Test Report
test_extract_input.test_trunk_distr
AssertionError:
Items are not equal:
item=0
key='weights'
key='data'
key='apical_3d_angles'
key='trunk'
ACTUAL: 1.0248080120788594
DESIRED: 1.0248077967009541
Raw output
POPUL = <neurom.core.population.Population object at 0x7fd59ac7d610>
NEU = <neurom.core.population.Population object at 0x7fd59ac7fdd0>
def test_trunk_distr(POPUL, NEU):
bins_BAS = [
0.19391773616376634,
0.4880704446023673,
0.7822231530409682,
1.076375861479569,
1.3705285699181702,
1.6646812783567713,
1.9588339867953721,
2.2529866952339734,
2.547139403672574,
2.841292112111175,
]
absolute_elevation_deviation_BAS = {
"data": {
"weights": [2, 0, 0, 3, 1, 2, 1, 1, 1, 2],
}
}
bins_absolute_ele_dev_BAS = [
-0.7718245274301169,
-0.6464835753472811,
-0.5211426232644452,
-0.39580167118160936,
-0.27046071909877345,
-0.1451197670159376,
-0.019778814933101796,
0.10556213714973406,
0.23090308923256997,
0.35624404131540577,
]
bins_absolute_ele_dev_APIC = [1.03738723]
target_trunkBAS = {
"trunk": {
"azimuth": {"uniform": {"max": 0.0, "min": np.pi}},
"orientation_deviation": {"data": {"weights": [4, 3, 1, 2, 0, 1, 0, 0, 0, 2]}},
"absolute_elevation_deviation": absolute_elevation_deviation_BAS,
"pia_3d_angles": {
"data": {
"weights": [
1.2274214110745432,
0.6137107055372726,
0.6137107055372716,
0.6137107055372716,
1.2274214110745432,
0.6137107055372716,
1.841132116611821,
0.0,
0.0,
1.2274214110745432,
]
}
},
"apical_3d_angles": {
"data": {
"weights": [
1.0248077967009541,
0.0,
1.0248077967009541,
2.0496155934019082,
0.5124038983504771,
1.0248077967009541,
0.0,
0.0,
0.5124038983504771,
0.5124038983504771,
]
}
},
}
}
target_trunkAPIC = {
"trunk": {
"azimuth": {"uniform": {"max": 0.0, "min": np.pi}},
"orientation_deviation": {"data": {"bins": [0.0], "weights": [2]}},
"absolute_elevation_deviation": {"data": {"weights": [2]}},
"pia_3d_angles": {"data": {"weights": [8.9044]}},
}
}
trunkAP = extract_input.from_neurom.trunk_neurite(
POPUL, neurite_type=neurom.APICAL_DENDRITE, bins=1
)
trunkBAS = extract_input.from_neurom.trunk_neurite(POPUL, bins=10)
trunkNEU = extract_input.from_neurom.trunk_neurite(NEU, bins=10)
assert "apical_3d_angles" not in trunkNEU
assert_array_almost_equal(trunkBAS["trunk"]["orientation_deviation"]["data"]["bins"], bins_BAS)
assert_array_almost_equal(
trunkBAS["trunk"]["absolute_elevation_deviation"]["data"]["bins"],
bins_absolute_ele_dev_BAS,
)
assert_array_almost_equal(
trunkAP["trunk"]["absolute_elevation_deviation"]["data"]["bins"],
bins_absolute_ele_dev_APIC,
)
del trunkBAS["trunk"]["orientation_deviation"]["data"]["bins"]
del trunkBAS["trunk"]["absolute_elevation_deviation"]["data"]["bins"]
del trunkBAS["trunk"]["pia_3d_angles"]["data"]["bins"]
del trunkBAS["trunk"]["apical_3d_angles"]["data"]["bins"]
del trunkAP["trunk"]["absolute_elevation_deviation"]["data"]["bins"]
del trunkAP["trunk"]["pia_3d_angles"]["data"]["bins"]
> assert_equal(trunkBAS, target_trunkBAS)
E AssertionError:
E Items are not equal:
E item=0
E key='weights'
E key='data'
E key='apical_3d_angles'
E key='trunk'
E
E ACTUAL: 1.0248080120788594
E DESIRED: 1.0248077967009541
tests/test_extract_input.py:158: AssertionError
Check failure on line 261 in tests/test_extract_input.py
github-actions / JUnit Test Report
test_extract_input.test_diameter_extract
AssertionError: Failed for res[basal_dendrite][taper]
Raw output
POPUL = <neurom.core.population.Population object at 0x7fd59add7910>
NEU = <neurom.core.population.Population object at 0x7fd59add6ad0>
def test_diameter_extract(POPUL, NEU):
res = extract_input.from_diameter.model(NEU)
assert_equal(set(res.keys()), {"basal_dendrite"})
expected = {
"Rall_ratio": 1.5,
"siblings_ratio": 1.0,
"taper": [0.24, 0.1],
"term": [2.0, 2.0],
"trunk": [3.9],
"trunk_taper": [0.30],
}
assert_equal(set(res["basal_dendrite"]), set(expected))
for key, value in expected.items():
assert_array_almost_equal(res["basal_dendrite"][key], value)
with pytest.raises(NeuroTSError):
extract_input.from_diameter.model(load_morphologies(os.path.join(_PATH, "simple.swc")))
# Test on Population
res = extract_input.from_diameter.model(POPUL)
assert_equal(set(res.keys()), {"axon", "basal_dendrite", "apical_dendrite"})
expected = {
"basal_dendrite": {
"Rall_ratio": 1.5,
"siblings_ratio": 1.0,
"taper": [
0.003361,
0.009487,
0.009931,
0.016477,
0.023878,
0.024852,
0.027809,
0.027975,
],
"term": [0.3] * 8,
"trunk": [0.6, 0.6, 0.72, 0.84, 1.2, 1.5, 1.8, 2.4],
"trunk_taper": [
0,
3.036411e-02,
3.053287e-02,
5.059035e-02,
1.168936e-01,
1.172027e-01,
0.15,
2.121002e-01,
],
},
"apical_dendrite": {
"Rall_ratio": 1.5,
"siblings_ratio": 1.0,
"taper": [
0.010331,
0.02135,
0.02264,
0.033914,
0.035313,
0.041116,
0.055751,
0.056211,
],
"term": [0.3] * 8,
"trunk": [1.57, 7.51],
"trunk_taper": [0.05324615, 0.65223652],
},
"axon": {
"Rall_ratio": 1.5,
"siblings_ratio": 1.0,
"taper": [
0.04079,
0.055286,
0.092382,
0.099524,
0.11986,
0.140346,
0.214172,
0.407058,
],
"term": [0.12] * 8,
"trunk": [2.1, 3.0],
"trunk_taper": [0.0435508, 0.0717109],
},
}
for neurite_type in ["basal_dendrite", "apical_dendrite", "axon"]:
for key in expected[neurite_type]:
try:
assert_equal(res[neurite_type].keys(), expected[neurite_type].keys())
if key in ["taper", "term", "trunk", "trunk_taper"]:
tested = sorted(res[neurite_type][key])[:8]
else:
tested = res[neurite_type][key]
> assert_array_almost_equal(tested, expected[neurite_type][key])
tests/test_extract_input.py:259:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/contextlib.py:81: in inner
return func(*args, **kwds)
.tox/py311/lib/python3.11/site-packages/numpy/_utils/__init__.py:85: in wrapper
return fun(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<function assert_array_almost_equal.<locals>.compare at 0x7fd5ba33c860>, [0.003360855160281062, 0.009486976079642773,...3, 0.023877551779150963, 0.024852415546774864, ...], [0.003361, 0.009487, 0.009931, 0.016477, 0.023878, 0.024852, ...])
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: 1 / 8 (12.5%)
E Max absolute difference among violations: 0.00341872
E Max relative difference among violations: 0.12220632
E ACTUAL: array([0.003361, 0.009487, 0.009931, 0.016477, 0.023878, 0.024852,
E 0.027809, 0.031394])
E DESIRED: array([0.003361, 0.009487, 0.009931, 0.016477, 0.023878, 0.024852,
E 0.027809, 0.027975])
/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/contextlib.py:81: AssertionError
The above exception was the direct cause of the following exception:
POPUL = <neurom.core.population.Population object at 0x7fd59add7910>
NEU = <neurom.core.population.Population object at 0x7fd59add6ad0>
def test_diameter_extract(POPUL, NEU):
res = extract_input.from_diameter.model(NEU)
assert_equal(set(res.keys()), {"basal_dendrite"})
expected = {
"Rall_ratio": 1.5,
"siblings_ratio": 1.0,
"taper": [0.24, 0.1],
"term": [2.0, 2.0],
"trunk": [3.9],
"trunk_taper": [0.30],
}
assert_equal(set(res["basal_dendrite"]), set(expected))
for key, value in expected.items():
assert_array_almost_equal(res["basal_dendrite"][key], value)
with pytest.raises(NeuroTSError):
extract_input.from_diameter.model(load_morphologies(os.path.join(_PATH, "simple.swc")))
# Test on Population
res = extract_input.from_diameter.model(POPUL)
assert_equal(set(res.keys()), {"axon", "basal_dendrite", "apical_dendrite"})
expected = {
"basal_dendrite": {
"Rall_ratio": 1.5,
"siblings_ratio": 1.0,
"taper": [
0.003361,
0.009487,
0.009931,
0.016477,
0.023878,
0.024852,
0.027809,
0.027975,
],
"term": [0.3] * 8,
"trunk": [0.6, 0.6, 0.72, 0.84, 1.2, 1.5, 1.8, 2.4],
"trunk_taper": [
0,
3.036411e-02,
3.053287e-02,
5.059035e-02,
1.168936e-01,
1.172027e-01,
0.15,
2.121002e-01,
],
},
"apical_dendrite": {
"Rall_ratio": 1.5,
"siblings_ratio": 1.0,
"taper": [
0.010331,
0.02135,
0.02264,
0.033914,
0.035313,
0.041116,
0.055751,
0.056211,
],
"term": [0.3] * 8,
"trunk": [1.57, 7.51],
"trunk_taper": [0.05324615, 0.65223652],
},
"axon": {
"Rall_ratio": 1.5,
"siblings_ratio": 1.0,
"taper": [
0.04079,
0.055286,
0.092382,
0.099524,
0.11986,
0.140346,
0.214172,
0.407058,
],
"term": [0.12] * 8,
"trunk": [2.1, 3.0],
"trunk_taper": [0.0435508, 0.0717109],
},
}
for neurite_type in ["basal_dendrite", "apical_dendrite", "axon"]:
for key in expected[neurite_type]:
try:
assert_equal(res[neurite_type].keys(), expected[neurite_type].keys())
if key in ["taper", "term", "trunk", "trunk_taper"]:
tested = sorted(res[neurite_type][key])[:8]
else:
tested = res[neurite_type][key]
assert_array_almost_equal(tested, expected[neurite_type][key])
except AssertionError as err:
> raise AssertionError(f"Failed for res[{neurite_type}][{key}]") from err
E AssertionError: Failed for res[basal_dendrite][taper]
tests/test_extract_input.py:261: AssertionError
Check failure on line 59 in tests/test_morphmath_utils.py
github-actions / JUnit Test Report
test_morphmath_utils.test_in_squared_proximity
assert np.False_
+ where np.False_ = <function in_squared_proximity at 0x7f1c4d91b560>(array([0., 0., 1.]), array([0., 0., 3.]), 4.0)
+ where <function in_squared_proximity at 0x7f1c4d91b560> = tested.in_squared_proximity
Raw output
def test_in_squared_proximity():
point1 = np.array([0.0, 0.0, 1.0])
point2 = np.array([0.0, 0.0, 3.0])
squared_proximity = 4.0
> assert tested.in_squared_proximity(point1, point2, squared_proximity)
E assert np.False_
E + where np.False_ = <function in_squared_proximity at 0x7f1c4d91b560>(array([0., 0., 1.]), array([0., 0., 3.]), 4.0)
E + where <function in_squared_proximity at 0x7f1c4d91b560> = tested.in_squared_proximity
tests/test_morphmath_utils.py:59: AssertionError
Check failure on line 1 in TestPathGrower
github-actions / JUnit Test Report
TestPathGrower.test_default
AssertionError:
Arrays are not almost equal to 0 decimals
Mismatched elements: 24 / 30 (80%)
Max absolute difference among violations: 4.26086988
Max relative difference among violations: inf
ACTUAL: [repr failed for <ndarray>: precision must be an integer]
DESIRED: [repr failed for <ndarray>: precision must be an integer]
Raw output
self = <tests.test_neuron_functional.TestPathGrower object at 0x7f1c3ff25250>
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_path_params.json",
"path_grower.h5",
"bio_path_persistence_diagram.json",
output_dir=tmpdir,
)
tests/test_neuron_functional.py:453:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_neuron_functional.py:123: in _test_full
assert_close_persistent_diagram(
tests/test_neuron_functional.py:58: in assert_close_persistent_diagram
assert_array_almost_equal(distances, np.zeros(len(distances)), decimal=0.1)
/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/contextlib.py:81: in inner
return func(*args, **kwds)
.tox/py311/lib/python3.11/site-packages/numpy/_utils/__init__.py:85: in wrapper
return fun(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<function assert_array_almost_equal.<locals>.compare at 0x7f1c3fe9a480>, array([1.02273544, 2.6839639 , 4.26086988, 2...., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]))
kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 0 decimals', 'precision': 0.1, '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 0 decimals
E
E Mismatched elements: 24 / 30 (80%)
E Max absolute difference among violations: 4.26086988
E Max relative difference among violations: inf
E ACTUAL: [repr failed for <ndarray>: precision must be an integer]
E DESIRED: [repr failed for <ndarray>: precision must be an integer]
/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/contextlib.py:81: AssertionError
github-actions / JUnit Test Report
test_grower.test_grow__run[Use RNG instance with legacy constructor]
AssertionError: Attributes Section.points of:
Section(id=2, points=[(-9.5638 23.2797 -3.17081),..., (-213.429 -31.9038 -13.2378)])
Section(id=2, points=[(-9.5638 23.2797 -3.17081),..., (-212.837 -31.7317 -13.2097)])
have different shapes: (212, 3) vs (213, 3)
assert not <morph_tool.morphio_diff.DiffResult object at 0x7fc9a65175d0>
Raw output
rng_type = 'legacy'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fc9a64c0990>
@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()
_check_neurots_soma(astro_grower.soma_grower.soma)
difference = diff(astro_grower.neuron, _path / "astrocyte.h5")
> assert not difference, difference.info
E AssertionError: Attributes Section.points of:
E Section(id=2, points=[(-9.5638 23.2797 -3.17081),..., (-213.429 -31.9038 -13.2378)])
E Section(id=2, points=[(-9.5638 23.2797 -3.17081),..., (-212.837 -31.7317 -13.2097)])
E have different shapes: (212, 3) vs (213, 3)
E assert not <morph_tool.morphio_diff.DiffResult object at 0x7fc9a65175d0>
tests/astrocyte/test_grower.py:275: AssertionError
Check failure on line 1 in TestPathGrower
github-actions / JUnit Test Report
TestPathGrower.test_with_rng
AssertionError:
Arrays are not almost equal to 0 decimals
Mismatched elements: 24 / 30 (80%)
Max absolute difference among violations: 4.26086988
Max relative difference among violations: inf
ACTUAL: [repr failed for <ndarray>: precision must be an integer]
DESIRED: [repr failed for <ndarray>: precision must be an integer]
Raw output
self = <tests.test_neuron_functional.TestPathGrower object at 0x7f1c3ff258d0>
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_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:463:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_neuron_functional.py:123: in _test_full
assert_close_persistent_diagram(
tests/test_neuron_functional.py:58: in assert_close_persistent_diagram
assert_array_almost_equal(distances, np.zeros(len(distances)), decimal=0.1)
/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/contextlib.py:81: in inner
return func(*args, **kwds)
.tox/py311/lib/python3.11/site-packages/numpy/_utils/__init__.py:85: in wrapper
return fun(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<function assert_array_almost_equal.<locals>.compare at 0x7f1c3fe9a520>, array([1.02273544, 2.6839639 , 4.26086988, 2...., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]))
kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 0 decimals', 'precision': 0.1, '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 0 decimals
E
E Mismatched elements: 24 / 30 (80%)
E Max absolute difference among violations: 4.26086988
E Max relative difference among violations: inf
E ACTUAL: [repr failed for <ndarray>: precision must be an integer]
E DESIRED: [repr failed for <ndarray>: precision must be an integer]
/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/contextlib.py:81: AssertionError
Check failure on line 250 in tests/test_neuron_functional.py
github-actions / JUnit Test Report
test_neuron_functional.test_convert_orientation2points
AssertionError:
Arrays are not almost equal to 6 decimals
Mismatched elements: 6 / 6 (100%)
Max absolute difference among violations: 17.38693647
Max relative difference among violations: 2.1029131
ACTUAL: array([[-6.56841 , -3.085387, -7.509794],
[-7.405242, 7.282838, -1.08779 ]])
DESIRED: array([[ 7.677438, -1.937618, 6.809053],
[ 9.981695, 2.831232, -1.187655]])
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, [[7.67743835, -1.93761793, 6.80905306], [9.98169472, 2.83123167, -1.18765494]]
)
tests/test_neuron_functional.py:250:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/contextlib.py:81: in inner
return func(*args, **kwds)
.tox/py311/lib/python3.11/site-packages/numpy/_utils/__init__.py:85: in wrapper
return fun(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<function assert_array_almost_equal.<locals>.compare at 0x7fd59ab9eac0>, [array([-6.56841023, -3.08538661, -7.5097938....40524175, 7.28283825, -1.08779045])], [[7.67743835, -1.93761793, 6.80905306], [9.98169472, 2.83123167, -1.18765494]])
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: 6 / 6 (100%)
E Max absolute difference among violations: 17.38693647
E Max relative difference among violations: 2.1029131
E ACTUAL: array([[-6.56841 , -3.085387, -7.509794],
E [-7.405242, 7.282838, -1.08779 ]])
E DESIRED: array([[ 7.677438, -1.937618, 6.809053],
E [ 9.981695, 2.831232, -1.187655]])
/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/contextlib.py:81: AssertionError
Check failure on line 1 in TestGradientPathGrower
github-actions / JUnit Test Report
TestGradientPathGrower.test_skip_rng_and_preprocessing
AssertionError:
Arrays are not almost equal to 0 decimals
Mismatched elements: 24 / 30 (80%)
Max absolute difference among violations: 4.2608813
Max relative difference among violations: inf
ACTUAL: [repr failed for <ndarray>: precision must be an integer]
DESIRED: [repr failed for <ndarray>: precision must be an integer]
Raw output
self = <tests.test_neuron_functional.TestGradientPathGrower object at 0x7fc9a64dd850>
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_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:555:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_neuron_functional.py:123: in _test_full
assert_close_persistent_diagram(
tests/test_neuron_functional.py:58: in assert_close_persistent_diagram
assert_array_almost_equal(distances, np.zeros(len(distances)), decimal=0.1)
/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/contextlib.py:81: in inner
return func(*args, **kwds)
.tox/py311/lib/python3.11/site-packages/numpy/_utils/__init__.py:85: in wrapper
return fun(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<function assert_array_almost_equal.<locals>.compare at 0x7fc9a655b2e0>, array([1.02273094, 2.68396358, 4.2608813 , 2...., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]))
kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 0 decimals', 'precision': 0.1, '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 0 decimals
E
E Mismatched elements: 24 / 30 (80%)
E Max absolute difference among violations: 4.2608813
E Max relative difference among violations: inf
E ACTUAL: [repr failed for <ndarray>: precision must be an integer]
E DESIRED: [repr failed for <ndarray>: precision must be an integer]
/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/contextlib.py:81: AssertionError
Check failure on line 1 in TestPathGrower
github-actions / JUnit Test Report
TestPathGrower.test_skip_preprocessing
AssertionError:
Arrays are not almost equal to 0 decimals
Mismatched elements: 24 / 30 (80%)
Max absolute difference among violations: 4.26086988
Max relative difference among violations: inf
ACTUAL: [repr failed for <ndarray>: precision must be an integer]
DESIRED: [repr failed for <ndarray>: precision must be an integer]
Raw output
self = <tests.test_neuron_functional.TestPathGrower object at 0x7f1c3ff25f50>
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:474:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_neuron_functional.py:123: in _test_full
assert_close_persistent_diagram(
tests/test_neuron_functional.py:58: in assert_close_persistent_diagram
assert_array_almost_equal(distances, np.zeros(len(distances)), decimal=0.1)
/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/contextlib.py:81: in inner
return func(*args, **kwds)
.tox/py311/lib/python3.11/site-packages/numpy/_utils/__init__.py:85: in wrapper
return fun(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<function assert_array_almost_equal.<locals>.compare at 0x7f1c3fed8180>, array([1.02273544, 2.6839639 , 4.26086988, 2...., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]))
kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 0 decimals', 'precision': 0.1, '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 0 decimals
E
E Mismatched elements: 24 / 30 (80%)
E Max absolute difference among violations: 4.26086988
E Max relative difference among violations: inf
E ACTUAL: [repr failed for <ndarray>: precision must be an integer]
E DESIRED: [repr failed for <ndarray>: precision must be an integer]
/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/contextlib.py:81: AssertionError
Check failure on line 290 in tests/test_neuron_functional.py
github-actions / JUnit Test Report
test_neuron_functional.test_breaker_of_tmd_algo
AssertionError:
Arrays are not equal
Mismatched elements: 1 / 1 (100%)
Max absolute difference among violations: 3
Max relative difference among violations: 0.3
ACTUAL: array([7])
DESIRED: array([10])
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])
tests/test_neuron_functional.py:290:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py311/lib/python3.11/site-packages/numpy/_utils/__init__.py:85: in wrapper
return fun(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<built-in function eq>, [7], [10])
kwds = {'err_msg': '', 'header': 'Arrays are not equal', 'strict': False, 'verbose': True}
@wraps(func)
def inner(*args, **kwds):
with self._recreate_cm():
> return func(*args, **kwds)
E AssertionError:
E Arrays are not equal
E
E Mismatched elements: 1 / 1 (100%)
E Max absolute difference among violations: 3
E Max relative difference among violations: 0.3
E ACTUAL: array([7])
E DESIRED: array([10])
/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/contextlib.py:81: AssertionError
Check failure on line 126 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 0x7fd59acc9090>
+ where <morph_tool.morphio_diff.DiffResult object at 0x7fd59acc9090> = diff('/tmp/tmp_w1c4apftest_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-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:399:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
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-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 0x7fd59acc9090>
E + where <morph_tool.morphio_diff.DiffResult object at 0x7fd59acc9090> = diff('/tmp/tmp_w1c4apftest_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:126: AssertionError
Check failure on line 440 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 among violations: 1.18019676
Max relative difference among violations: 0.09410097
ACTUAL: array([[ -0.753967, 7.840627, 11.521165],
[-12.96143 , -1.246392, 2.842452],
[ 12.204874, -0.050845, 6.305438],
[ -2.604422, 13.722016, 1.223284]])
DESIRED: 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:440:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/contextlib.py:81: in inner
return func(*args, **kwds)
.tox/py311/lib/python3.11/site-packages/numpy/_utils/__init__.py:85: in wrapper
return fun(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<function assert_array_almost_equal.<locals>.compare at 0x7fd59aca4b80>, [[-0.7539672255516052, 7.8406267166137695, 1...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 among violations: 1.18019676
E Max relative difference among violations: 0.09410097
E ACTUAL: array([[ -0.753967, 7.840627, 11.521165],
E [-12.96143 , -1.246392, 2.842452],
E [ 12.204874, -0.050845, 6.305438],
E [ -2.604422, 13.722016, 1.223284]])
E DESIRED: 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.10/x64/lib/python3.11/contextlib.py:81: AssertionError
Check failure on line 1 in TestBioRatL5Tpc2
github-actions / JUnit Test Report
TestBioRatL5Tpc2.test_skip_preprocessing
AssertionError:
Arrays are not almost equal to 7 decimals
ACTUAL: 166
DESIRED: 116
Raw output
self = <tests.test_neuron_functional.TestBioRatL5Tpc2 object at 0x7fd59ae46b90>
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:636:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_neuron_functional.py:123: in _test_full
assert_close_persistent_diagram(
tests/test_neuron_functional.py:57: in assert_close_persistent_diagram
assert_almost_equal(len(expected), len(actual))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (166, 116), kwds = {}
@wraps(func)
def inner(*args, **kwds):
with self._recreate_cm():
> return func(*args, **kwds)
E AssertionError:
E Arrays are not almost equal to 7 decimals
E ACTUAL: 166
E DESIRED: 116
/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/contextlib.py:81: AssertionError
Check failure on line 1 in TestBioRatL5Tpc1
github-actions / JUnit Test Report
TestBioRatL5Tpc1.test_default
AssertionError:
Arrays are not almost equal to 7 decimals
ACTUAL: 166
DESIRED: 116
Raw output
self = <tests.test_neuron_functional.TestBioRatL5Tpc1 object at 0x7fc9a64dce10>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw0/test_default0')
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:569:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_neuron_functional.py:123: in _test_full
assert_close_persistent_diagram(
tests/test_neuron_functional.py:57: in assert_close_persistent_diagram
assert_almost_equal(len(expected), len(actual))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (166, 116), kwds = {}
@wraps(func)
def inner(*args, **kwds):
with self._recreate_cm():
> return func(*args, **kwds)
E AssertionError:
E Arrays are not almost equal to 7 decimals
E ACTUAL: 166
E DESIRED: 116
/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/contextlib.py:81: AssertionError
Check failure on line 1 in TestPathGrower
github-actions / JUnit Test Report
TestPathGrower.test_skip_rng_and_preprocessing
AssertionError:
Arrays are not almost equal to 0 decimals
Mismatched elements: 24 / 30 (80%)
Max absolute difference among violations: 4.26086988
Max relative difference among violations: inf
ACTUAL: [repr failed for <ndarray>: precision must be an integer]
DESIRED: [repr failed for <ndarray>: precision must be an integer]
Raw output
self = <tests.test_neuron_functional.TestPathGrower object at 0x7f1c3ff0e4d0>
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:485:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_neuron_functional.py:123: in _test_full
assert_close_persistent_diagram(
tests/test_neuron_functional.py:58: in assert_close_persistent_diagram
assert_array_almost_equal(distances, np.zeros(len(distances)), decimal=0.1)
/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/contextlib.py:81: in inner
return func(*args, **kwds)
.tox/py311/lib/python3.11/site-packages/numpy/_utils/__init__.py:85: in wrapper
return fun(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<function assert_array_almost_equal.<locals>.compare at 0x7f1c3fed8860>, array([1.02273544, 2.6839639 , 4.26086988, 2...., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]))
kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 0 decimals', 'precision': 0.1, '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 0 decimals
E
E Mismatched elements: 24 / 30 (80%)
E Max absolute difference among violations: 4.26086988
E Max relative difference among violations: inf
E ACTUAL: [repr failed for <ndarray>: precision must be an integer]
E DESIRED: [repr failed for <ndarray>: precision must be an integer]
/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/contextlib.py:81: AssertionError
Check failure on line 1 in TestGradientPathGrower
github-actions / JUnit Test Report
TestGradientPathGrower.test_default
AssertionError:
Arrays are not almost equal to 0 decimals
Mismatched elements: 24 / 30 (80%)
Max absolute difference among violations: 4.2608813
Max relative difference among violations: inf
ACTUAL: [repr failed for <ndarray>: precision must be an integer]
DESIRED: [repr failed for <ndarray>: precision must be an integer]
Raw output
self = <tests.test_neuron_functional.TestGradientPathGrower object at 0x7f1c3ff266d0>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw3/test_default1')
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:523:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_neuron_functional.py:123: in _test_full
assert_close_persistent_diagram(
tests/test_neuron_functional.py:58: in assert_close_persistent_diagram
assert_array_almost_equal(distances, np.zeros(len(distances)), decimal=0.1)
/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/contextlib.py:81: in inner
return func(*args, **kwds)
.tox/py311/lib/python3.11/site-packages/numpy/_utils/__init__.py:85: in wrapper
return fun(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<function assert_array_almost_equal.<locals>.compare at 0x7f1c3fed8d60>, array([1.02273094, 2.68396358, 4.2608813 , 2...., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]))
kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 0 decimals', 'precision': 0.1, '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 0 decimals
E
E Mismatched elements: 24 / 30 (80%)
E Max absolute difference among violations: 4.2608813
E Max relative difference among violations: inf
E ACTUAL: [repr failed for <ndarray>: precision must be an integer]
E DESIRED: [repr failed for <ndarray>: precision must be an integer]
/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/contextlib.py:81: AssertionError
Check failure on line 1 in TestBioRatL5Tpc1
github-actions / JUnit Test Report
TestBioRatL5Tpc1.test_with_rng
AssertionError:
Arrays are not almost equal to 7 decimals
ACTUAL: 166
DESIRED: 116
Raw output
self = <tests.test_neuron_functional.TestBioRatL5Tpc1 object at 0x7fc9a64dd310>
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_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",
rng_or_seed=build_random_generator(0),
output_dir=tmpdir,
)
tests/test_neuron_functional.py:579:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_neuron_functional.py:123: in _test_full
assert_close_persistent_diagram(
tests/test_neuron_functional.py:57: in assert_close_persistent_diagram
assert_almost_equal(len(expected), len(actual))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (166, 116), kwds = {}
@wraps(func)
def inner(*args, **kwds):
with self._recreate_cm():
> return func(*args, **kwds)
E AssertionError:
E Arrays are not almost equal to 7 decimals
E ACTUAL: 166
E DESIRED: 116
/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/contextlib.py:81: AssertionError
Check failure on line 1 in TestBioRatL5Tpc2
github-actions / JUnit Test Report
TestBioRatL5Tpc2.test_skip_rng_and_preprocessing
AssertionError:
Arrays are not almost equal to 7 decimals
ACTUAL: 166
DESIRED: 116
Raw output
self = <tests.test_neuron_functional.TestBioRatL5Tpc2 object at 0x7fd59ae47150>
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",
"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:647:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_neuron_functional.py:123: in _test_full
assert_close_persistent_diagram(
tests/test_neuron_functional.py:57: in assert_close_persistent_diagram
assert_almost_equal(len(expected), len(actual))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (166, 116), kwds = {}
@wraps(func)
def inner(*args, **kwds):
with self._recreate_cm():
> return func(*args, **kwds)
E AssertionError:
E Arrays are not almost equal to 7 decimals
E ACTUAL: 166
E DESIRED: 116
/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/contextlib.py:81: AssertionError
Check failure on line 1 in TestGradientPathGrower
github-actions / JUnit Test Report
TestGradientPathGrower.test_with_rng
AssertionError:
Arrays are not almost equal to 0 decimals
Mismatched elements: 24 / 30 (80%)
Max absolute difference among violations: 4.2608813
Max relative difference among violations: inf
ACTUAL: [repr failed for <ndarray>: precision must be an integer]
DESIRED: [repr failed for <ndarray>: precision must be an integer]
Raw output
self = <tests.test_neuron_functional.TestGradientPathGrower object at 0x7f1c3ff26a90>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw3/test_with_rng1')
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:533:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_neuron_functional.py:123: in _test_full
assert_close_persistent_diagram(
tests/test_neuron_functional.py:58: in assert_close_persistent_diagram
assert_array_almost_equal(distances, np.zeros(len(distances)), decimal=0.1)
/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/contextlib.py:81: in inner
return func(*args, **kwds)
.tox/py311/lib/python3.11/site-packages/numpy/_utils/__init__.py:85: in wrapper
return fun(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<function assert_array_almost_equal.<locals>.compare at 0x7f1c3fed9da0>, array([1.02273094, 2.68396358, 4.2608813 , 2...., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]))
kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 0 decimals', 'precision': 0.1, '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 0 decimals
E
E Mismatched elements: 24 / 30 (80%)
E Max absolute difference among violations: 4.2608813
E Max relative difference among violations: inf
E ACTUAL: [repr failed for <ndarray>: precision must be an integer]
E DESIRED: [repr failed for <ndarray>: precision must be an integer]
/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/contextlib.py:81: AssertionError
Check failure on line 1 in TestBioRatL5Tpc1
github-actions / JUnit Test Report
TestBioRatL5Tpc1.test_skip_preprocessing
AssertionError:
Arrays are not almost equal to 7 decimals
ACTUAL: 166
DESIRED: 116
Raw output
self = <tests.test_neuron_functional.TestBioRatL5Tpc1 object at 0x7fc9a64de310>
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",
"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,
output_dir=tmpdir,
)
tests/test_neuron_functional.py:590:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_neuron_functional.py:123: in _test_full
assert_close_persistent_diagram(
tests/test_neuron_functional.py:57: in assert_close_persistent_diagram
assert_almost_equal(len(expected), len(actual))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (166, 116), kwds = {}
@wraps(func)
def inner(*args, **kwds):
with self._recreate_cm():
> return func(*args, **kwds)
E AssertionError:
E Arrays are not almost equal to 7 decimals
E ACTUAL: 166
E DESIRED: 116
/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/contextlib.py:81: AssertionError
Check failure on line 1 in TestBioRatL5Tpc3
github-actions / JUnit Test Report
TestBioRatL5Tpc3.test_default
AssertionError:
Arrays are not almost equal to 7 decimals
ACTUAL: 166
DESIRED: 116
Raw output
self = <tests.test_neuron_functional.TestBioRatL5Tpc3 object at 0x7fd59ac9f890>
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",
"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:661:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_neuron_functional.py:123: in _test_full
assert_close_persistent_diagram(
tests/test_neuron_functional.py:57: in assert_close_persistent_diagram
assert_almost_equal(len(expected), len(actual))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (166, 116), kwds = {}
@wraps(func)
def inner(*args, **kwds):
with self._recreate_cm():
> return func(*args, **kwds)
E AssertionError:
E Arrays are not almost equal to 7 decimals
E ACTUAL: 166
E DESIRED: 116
/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/contextlib.py:81: AssertionError
Check failure on line 1 in TestGradientPathGrower
github-actions / JUnit Test Report
TestGradientPathGrower.test_skip_preprocessing
AssertionError:
Arrays are not almost equal to 0 decimals
Mismatched elements: 24 / 30 (80%)
Max absolute difference among violations: 4.2608813
Max relative difference among violations: inf
ACTUAL: [repr failed for <ndarray>: precision must be an integer]
DESIRED: [repr failed for <ndarray>: precision must be an integer]
Raw output
self = <tests.test_neuron_functional.TestGradientPathGrower object at 0x7f1c3ff26e50>
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:544:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_neuron_functional.py:123: in _test_full
assert_close_persistent_diagram(
tests/test_neuron_functional.py:58: in assert_close_persistent_diagram
assert_array_almost_equal(distances, np.zeros(len(distances)), decimal=0.1)
/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/contextlib.py:81: in inner
return func(*args, **kwds)
.tox/py311/lib/python3.11/site-packages/numpy/_utils/__init__.py:85: in wrapper
return fun(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<function assert_array_almost_equal.<locals>.compare at 0x7f1c3fe9bec0>, array([1.02273094, 2.68396358, 4.2608813 , 2...., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]))
kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 0 decimals', 'precision': 0.1, '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 0 decimals
E
E Mismatched elements: 24 / 30 (80%)
E Max absolute difference among violations: 4.2608813
E Max relative difference among violations: inf
E ACTUAL: [repr failed for <ndarray>: precision must be an integer]
E DESIRED: [repr failed for <ndarray>: precision must be an integer]
/opt/hostedtoolcache/Python/3.11.10/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:
Arrays are not almost equal to 7 decimals
ACTUAL: 166
DESIRED: 116
Raw output
self = <tests.test_neuron_functional.TestBioRatL5Tpc1 object at 0x7fc9a64de890>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw0/test_skip_rng_and_preprocessin1')
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:601:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_neuron_functional.py:123: in _test_full
assert_close_persistent_diagram(
tests/test_neuron_functional.py:57: in assert_close_persistent_diagram
assert_almost_equal(len(expected), len(actual))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (166, 116), kwds = {}
@wraps(func)
def inner(*args, **kwds):
with self._recreate_cm():
> return func(*args, **kwds)
E AssertionError:
E Arrays are not almost equal to 7 decimals
E ACTUAL: 166
E DESIRED: 116
/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/contextlib.py:81: AssertionError
Check failure on line 1 in TestBioRatL5Tpc3
github-actions / JUnit Test Report
TestBioRatL5Tpc3.test_with_rng
AssertionError:
Arrays are not almost equal to 7 decimals
ACTUAL: 166
DESIRED: 116
Raw output
self = <tests.test_neuron_functional.TestBioRatL5Tpc3 object at 0x7fd59ac9db50>
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",
"params3.json",
"expected_bio_rat_L5_TPC_B_with_params3.h5",
"expected_bio_rat_L5_TPC_B_with_params3_persistence_diagram.json",
rng_or_seed=build_random_generator(0),
output_dir=tmpdir,
)
tests/test_neuron_functional.py:671:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_neuron_functional.py:123: in _test_full
assert_close_persistent_diagram(
tests/test_neuron_functional.py:57: in assert_close_persistent_diagram
assert_almost_equal(len(expected), len(actual))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (166, 116), kwds = {}
@wraps(func)
def inner(*args, **kwds):
with self._recreate_cm():
> return func(*args, **kwds)
E AssertionError:
E Arrays are not almost equal to 7 decimals
E ACTUAL: 166
E DESIRED: 116
/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/contextlib.py:81: AssertionError