Skip to content

Fix: Better first_point fix #610

Fix: Better first_point fix

Fix: Better first_point fix #610

GitHub Actions / JUnit Test Report failed Dec 5, 2023 in 0s

221 tests run, 188 passed, 0 skipped, 33 failed.

Annotations

Check failure on line 79 in tests/test_algo.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_algo.test_TMDApicalAlgo

AssertionError: 
Arrays are not almost equal to 6 decimals

Mismatched elements: 3 / 3 (100%)
Max absolute difference: 0.37386951
Max relative difference: 1.83737032
 x: array([0.57735, 0.57735, 0.57735])
 y: array([0.203481, 0.541099, 0.81597 ])
Raw output
def test_TMDApicalAlgo():
        algo, grower = _setup_test(TMDApicalAlgo, SectionGrowerPath)
    
        stop, num_sec = algo.initialize()
        expected_stop = {"TMD": TMDStop(bif_id=1, bif=9.7747, term_id=0, term=159.798, ref=0.0)}
        assert stop == expected_stop
        assert_equal(num_sec, 10)
    
        grower.id = 1
        s1, s2 = algo.bifurcate(grower)
        assert_equal(algo.apical_section, 1)
        _assert_dict_or_array(
            s1,
            {
                "direction": [0.57735, 0.57735, 0.57735],
                "process": "major",
                "first_point": [1.1, 0.0, 0.0],
                "stop": {"TMD": TMDStop(bif_id=2, bif=18.5246, term_id=0, term=159.798, ref=0.0)},
            },
        )
    
>       _assert_dict_or_array(
            s2,
            {
                "direction": np.array([0.20348076, 0.54109933, 0.81597003]),
                "process": "secondary",
                "first_point": [1.1, 0.0, 0.0],
                "stop": {"TMD": TMDStop(bif_id=2, bif=18.5246, term_id=1, term=124.8796, ref=0.0)},
            },
        )

tests/test_algo.py:250: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_algo.py:79: in _assert_dict_or_array
    assert_array_almost_equal(dict1[key], dict2[key])
/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/contextlib.py:81: in inner
    return func(*args, **kwds)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

args = (<function assert_array_almost_equal.<locals>.compare at 0x7f70ef0311c0>, array([0.57735027, 0.57735027, 0.57735027]), array([0.20348076, 0.54109933, 0.81597003]))
kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 6 decimals', 'precision': 6, 'verbose': True}

    @wraps(func)
    def inner(*args, **kwds):
        with self._recreate_cm():
>           return func(*args, **kwds)
E           AssertionError: 
E           Arrays are not almost equal to 6 decimals
E           
E           Mismatched elements: 3 / 3 (100%)
E           Max absolute difference: 0.37386951
E           Max relative difference: 1.83737032
E            x: array([0.57735, 0.57735, 0.57735])
E            y: array([0.203481, 0.541099, 0.81597 ])

/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/contextlib.py:81: AssertionError

Check failure on line 79 in tests/test_algo.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_algo.test_TMDGradientAlgo

AssertionError: 
Arrays are not almost equal to 6 decimals

Mismatched elements: 3 / 3 (100%)
Max absolute difference: 0.17689627
Max relative difference: 0.4417393
 x: array([0.57735, 0.57735, 0.57735])
 y: array([0.400454, 0.573604, 0.714573])
Raw output
def test_TMDGradientAlgo():
        algo, grower = _setup_test(TMDGradientAlgo, SectionGrowerPath)
    
        stop, num_sec = algo.initialize()
        expected_stop = {"TMD": TMDStop(bif_id=1, bif=9.7747, term_id=0, term=159.798, ref=0.0)}
        assert stop == expected_stop
        assert_equal(num_sec, 10)
    
        s1, s2 = algo.bifurcate(grower)
        _assert_dict_or_array(
            s1,
            {
                "direction": [0.57735, 0.57735, 0.57735],
                "process": "major",
                "first_point": [1.1, 0.0, 0.0],
                "stop": {"TMD": TMDStop(bif_id=2, bif=18.5246, term_id=0, term=159.798, ref=0.0)},
            },
        )
    
>       _assert_dict_or_array(
            s2,
            {
                "direction": np.array([0.400454, 0.573604, 0.714573]),
                "process": "major",
                "first_point": [1.1, 0.0, 0.0],
                "stop": {"TMD": TMDStop(bif_id=2, bif=18.5246, term_id=1, term=124.8796, ref=0.0)},
            },
        )

tests/test_algo.py:304: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_algo.py:79: in _assert_dict_or_array
    assert_array_almost_equal(dict1[key], dict2[key])
/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/contextlib.py:81: in inner
    return func(*args, **kwds)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

args = (<function assert_array_almost_equal.<locals>.compare at 0x7f70eeee4b80>, array([0.57735027, 0.57735027, 0.57735027]), array([0.400454, 0.573604, 0.714573]))
kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 6 decimals', 'precision': 6, 'verbose': True}

    @wraps(func)
    def inner(*args, **kwds):
        with self._recreate_cm():
>           return func(*args, **kwds)
E           AssertionError: 
E           Arrays are not almost equal to 6 decimals
E           
E           Mismatched elements: 3 / 3 (100%)
E           Max absolute difference: 0.17689627
E           Max relative difference: 0.4417393
E            x: array([0.57735, 0.57735, 0.57735])
E            y: array([0.400454, 0.573604, 0.714573])

/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/contextlib.py:81: AssertionError

Check failure on line 297 in tests/test_neuron_functional.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_neuron_functional.test_breaker_of_tmd_algo

AssertionError: 
Arrays are not almost equal to 5 decimals

Mismatched elements: 3 / 3 (100%)
Max absolute difference: 91.49147879
Max relative difference: 2.17589941
 x: array([-118.23524,  133.53914,   -8.61812], dtype=float32)
 y: array([-170.45485,   42.04766,  -26.37539])
Raw output
def test_breaker_of_tmd_algo():
        """Test example that could break tmd_algo. Test should fail if problem occurs.
        Otherwise, this grower should run smoothly.
        """
        distributions, params = _load_inputs(
            join(_path, "bio_distr_breaker.json"), join(_path, "bio_params_breaker.json")
        )
        np.random.seed(3367155)
        N = NeuronGrower(input_distributions=distributions, input_parameters=params)
        n = N.grow()
    
        assert_array_equal(N.apical_sections, [10])
>       assert_array_almost_equal(
            n.sections[118].points[-1],
            np.array([-170.45485, 42.04766, -26.375393]),
            decimal=5,
        )

tests/test_neuron_functional.py:297: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/contextlib.py:81: in inner
    return func(*args, **kwds)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

args = (<function assert_array_almost_equal.<locals>.compare at 0x7f70eeef4860>, array([-118.235245,  133.53914 ,   -8.618125], dtype=float32), array([-170.45485 ,   42.04766 ,  -26.375393]))
kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 5 decimals', 'precision': 5, 'verbose': True}

    @wraps(func)
    def inner(*args, **kwds):
        with self._recreate_cm():
>           return func(*args, **kwds)
E           AssertionError: 
E           Arrays are not almost equal to 5 decimals
E           
E           Mismatched elements: 3 / 3 (100%)
E           Max absolute difference: 91.49147879
E           Max relative difference: 2.17589941
E            x: array([-118.23524,  133.53914,   -8.61812], dtype=float32)
E            y: array([-170.45485,   42.04766,  -26.37539])

/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/contextlib.py:81: AssertionError

Check failure on line 26 in tests/test_morphmath_bifurcation.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_morphmath_bifurcation.test_get_bif_directional

AssertionError: 
Arrays are not almost equal to 6 decimals

Mismatched elements: 2 / 6 (33.3%)
Max absolute difference: 1.
Max relative difference: 1.
 x: array([[0., 1., 0.],
       [0., 1., 0.]])
 y: array([[0., 1., 0.],
       [0., 0., 1.]])
Raw output
def test_get_bif_directional():
>       assert_array_almost_equal(
            _bf.directional([0.0, 1.0, 0.0], [0.0, 0.0, 0.0, np.pi / 2]),
            (np.array([0.0, 1.0, 0.0]), np.array([0.0, 0.0, 1.0])),
        )

tests/test_morphmath_bifurcation.py:26: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/contextlib.py:81: in inner
    return func(*args, **kwds)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

args = (<function assert_array_almost_equal.<locals>.compare at 0x7f4a92c0d080>, (array([0., 1., 0.]), array([0., 1., 0.])), (array([0., 1., 0.]), array([0., 0., 1.])))
kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 6 decimals', 'precision': 6, 'verbose': True}

    @wraps(func)
    def inner(*args, **kwds):
        with self._recreate_cm():
>           return func(*args, **kwds)
E           AssertionError: 
E           Arrays are not almost equal to 6 decimals
E           
E           Mismatched elements: 2 / 6 (33.3%)
E           Max absolute difference: 1.
E           Max relative difference: 1.
E            x: array([[0., 1., 0.],
E                  [0., 1., 0.]])
E            y: array([[0., 1., 0.],
E                  [0., 0., 1.]])

/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/contextlib.py:81: AssertionError

Check failure on line 48 in tests/test_morphmath_bifurcation.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_morphmath_bifurcation.test_get_bif_bio_oriented

AssertionError: 
Arrays are not almost equal to 6 decimals

Mismatched elements: 2 / 6 (33.3%)
Max absolute difference: 0.70710678
Max relative difference: 1.
 x: array([[0., 1., 0.],
       [0., 1., 0.]])
 y: array([[0.      , 1.      , 0.      ],
       [0.      , 0.707107, 0.707107]])
Raw output
def test_get_bif_bio_oriented():
>       assert_array_almost_equal(
            _bf.bio_oriented([0.0, 1.0, 0.0], [0.0, 0.0, 0.0, np.pi / 4]),
            (
                np.array([0.0, 1.0, 0.0]),
                np.array([0.0, 1.0 / np.sqrt(2), 1.0 / np.sqrt(2)]),
            ),
        )

tests/test_morphmath_bifurcation.py:48: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/contextlib.py:81: in inner
    return func(*args, **kwds)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

args = (<function assert_array_almost_equal.<locals>.compare at 0x7f4a90ae8e00>, (array([0., 1., 0.]), array([0., 1., 0.])), (array([0., 1., 0.]), array([0.        , 0.70710678, 0.70710678])))
kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 6 decimals', 'precision': 6, 'verbose': True}

    @wraps(func)
    def inner(*args, **kwds):
        with self._recreate_cm():
>           return func(*args, **kwds)
E           AssertionError: 
E           Arrays are not almost equal to 6 decimals
E           
E           Mismatched elements: 2 / 6 (33.3%)
E           Max absolute difference: 0.70710678
E           Max relative difference: 1.
E            x: array([[0., 1., 0.],
E                  [0., 1., 0.]])
E            y: array([[0.      , 1.      , 0.      ],
E                  [0.      , 0.707107, 0.707107]])

/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/contextlib.py:81: AssertionError

Check failure on line 62 in tests/test_morphmath_bifurcation.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_morphmath_bifurcation.test_get_bif_symmetric

AssertionError: 
Arrays are not almost equal to 6 decimals

Mismatched elements: 4 / 6 (66.7%)
Max absolute difference: 0.479426
Max relative difference: 1.
 x: array([[0., 0., 1.],
       [0., 0., 1.]])
 y: array([[ 0.      , -0.479426,  0.877583],
       [ 0.      ,  0.479426,  0.877583]])
Raw output
def test_get_bif_symmetric():
>       assert_array_almost_equal(
            _bf.symmetric([0, 0, 1], [1, 1, 1, 1]),
            [[0.0, -0.479426, 0.877583], [0.0, 0.479426, 0.877583]],
        )

tests/test_morphmath_bifurcation.py:62: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/contextlib.py:81: in inner
    return func(*args, **kwds)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

args = (<function assert_array_almost_equal.<locals>.compare at 0x7f4a90ae94e0>, (array([0., 0., 1.]), array([0., 0., 1.])), [[0.0, -0.479426, 0.877583], [0.0, 0.479426, 0.877583]])
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: 4 / 6 (66.7%)
E           Max absolute difference: 0.479426
E           Max relative difference: 1.
E            x: array([[0., 0., 1.],
E                  [0., 0., 1.]])
E            y: array([[ 0.      , -0.479426,  0.877583],
E                  [ 0.      ,  0.479426,  0.877583]])

/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/contextlib.py:81: AssertionError

Check failure on line 1 in TestBioRatL5Tpc1

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

TestBioRatL5Tpc1.test_skip_rng_and_preprocessing

AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f4a92b76b10>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7f4a92b76b10> = diff('/tmp/tmpolpash9itest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params1.h5')
 +    where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params1.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params1.h5')
Raw output
self = <tests.test_neuron_functional.TestBioRatL5Tpc1 object at 0x7f4a92ce2610>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw1/test_skip_rng_and_preprocessin0')

    def test_skip_rng_and_preprocessing(self, tmpdir):
>       _test_full(
            "path_distances",
            "bio_rat_L5_TPC_B_distribution.json",
            "params1_orientation_manager.json",
            "expected_bio_rat_L5_TPC_B_with_params1.h5",
            "expected_bio_rat_L5_TPC_B_with_params1_persistence_diagram.json",
            skip_preprocessing=True,
            rng_or_seed=build_random_generator(0),
            output_dir=tmpdir,
        )

tests/test_neuron_functional.py:607: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

feature = 'path_distances'
distributions = {'apical_dendrite': {'filtration_metric': 'path_distances', 'min_bar_length': 1.0, 'num_trees': {'data': {'bins': [1],....4106653615432989, 0.5277795547616266, -0.18579814237229897], ...], ...], ...}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'params1_orientation_manager.json'
ref_cell = 'expected_bio_rat_L5_TPC_B_with_params1.h5'
ref_persistence_diagram = 'expected_bio_rat_L5_TPC_B_with_params1_persistence_diagram.json'
rng_or_seed = RandomState(MT19937) at 0x7F4A908FBA40, skip_preprocessing = True
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw1/test_skip_rng_and_preprocessin0')

    def _test_full(
        feature,
        distributions,
        parameters,
        ref_cell,
        ref_persistence_diagram,
        rng_or_seed=None,
        skip_preprocessing=False,
        output_dir=None,
    ):
        distributions, params = _load_inputs(join(_path, distributions), join(_path, parameters))
        if rng_or_seed is None:
            np.random.seed(0)
            n = NeuronGrower(
                input_distributions=distributions,
                input_parameters=params,
                skip_preprocessing=skip_preprocessing,
            ).grow()
        else:
            n = NeuronGrower(
                input_distributions=distributions,
                input_parameters=params,
                rng_or_seed=rng_or_seed,
                skip_preprocessing=skip_preprocessing,
            ).grow()
    
        with TemporaryDirectory("test_grower") as folder:
            out_neuron = join(folder, "test_output_neuron_.h5")
            n.write(out_neuron)
    
            # For checking purposes, we can output the cells as swc
            if output_dir is not None:
                if not os.path.exists(output_dir):
                    os.mkdir(output_dir)
                n.write(join(output_dir, basename(ref_cell)))
    
            if ref_persistence_diagram is not None:
                # Load with TMD and extract radial persistence
                n0 = tmd.io.load_neuron(out_neuron)
    
                actual_persistence_diagram = tmd.methods.get_persistence_diagram(
                    n0.apical_dendrite[0], feature=feature
                )
                if output_dir is not None:
                    with open(
                        join(output_dir, basename(ref_persistence_diagram)), "w", encoding="utf-8"
                    ) as f:
                        json.dump(actual_persistence_diagram, f, sort_keys=True, indent=2)
    
                with open(join(_path, ref_persistence_diagram), encoding="utf-8") as f:
                    expected_persistence_diagram = json.load(f)
                assert_close_persistent_diagram(
                    actual_persistence_diagram, expected_persistence_diagram
                )
>           assert not diff(out_neuron, join(_path, ref_cell))
E           AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f4a92b76b10>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7f4a92b76b10> = diff('/tmp/tmpolpash9itest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params1.h5')
E            +    where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params1.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params1.h5')

tests/test_neuron_functional.py:132: AssertionError

Check failure on line 1 in TestPathGrower

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

TestPathGrower.test_skip_rng_and_preprocessing

AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f55dbd35310>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7f55dbd35310> = diff('/tmp/tmpa5q3ezo7test_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/path_grower.h5')
 +    where '/home/runner/work/NeuroTS/NeuroTS/tests/data/path_grower.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'path_grower.h5')
Raw output
self = <tests.test_neuron_functional.TestPathGrower object at 0x7f55dba3c910>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw3/test_skip_rng_and_preprocessin0')

    def test_skip_rng_and_preprocessing(self, tmpdir):
>       _test_full(
            "path_distances",
            "bio_distribution.json",
            "bio_path_params_orientation_manager.json",
            "path_grower.h5",
            "bio_path_persistence_diagram.json",
            skip_preprocessing=True,
            rng_or_seed=build_random_generator(0),
            output_dir=tmpdir,
        )

tests/test_neuron_functional.py:491: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

feature = 'path_distances'
distributions = {'apical_dendrite': {'filtration_metric': 'path_distances', 'min_bar_length': 1.0, 'num_trees': {'data': {'bins': [1],...665, 0.02188742478139427], [265.46654445080054, 0, nan, nan, nan, nan]]], ...}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'bio_path_params_orientation_manager.json'
ref_cell = 'path_grower.h5'
ref_persistence_diagram = 'bio_path_persistence_diagram.json'
rng_or_seed = RandomState(MT19937) at 0x7F55DB8B7D40, skip_preprocessing = True
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw3/test_skip_rng_and_preprocessin0')

    def _test_full(
        feature,
        distributions,
        parameters,
        ref_cell,
        ref_persistence_diagram,
        rng_or_seed=None,
        skip_preprocessing=False,
        output_dir=None,
    ):
        distributions, params = _load_inputs(join(_path, distributions), join(_path, parameters))
        if rng_or_seed is None:
            np.random.seed(0)
            n = NeuronGrower(
                input_distributions=distributions,
                input_parameters=params,
                skip_preprocessing=skip_preprocessing,
            ).grow()
        else:
            n = NeuronGrower(
                input_distributions=distributions,
                input_parameters=params,
                rng_or_seed=rng_or_seed,
                skip_preprocessing=skip_preprocessing,
            ).grow()
    
        with TemporaryDirectory("test_grower") as folder:
            out_neuron = join(folder, "test_output_neuron_.h5")
            n.write(out_neuron)
    
            # For checking purposes, we can output the cells as swc
            if output_dir is not None:
                if not os.path.exists(output_dir):
                    os.mkdir(output_dir)
                n.write(join(output_dir, basename(ref_cell)))
    
            if ref_persistence_diagram is not None:
                # Load with TMD and extract radial persistence
                n0 = tmd.io.load_neuron(out_neuron)
    
                actual_persistence_diagram = tmd.methods.get_persistence_diagram(
                    n0.apical_dendrite[0], feature=feature
                )
                if output_dir is not None:
                    with open(
                        join(output_dir, basename(ref_persistence_diagram)), "w", encoding="utf-8"
                    ) as f:
                        json.dump(actual_persistence_diagram, f, sort_keys=True, indent=2)
    
                with open(join(_path, ref_persistence_diagram), encoding="utf-8") as f:
                    expected_persistence_diagram = json.load(f)
                assert_close_persistent_diagram(
                    actual_persistence_diagram, expected_persistence_diagram
                )
>           assert not diff(out_neuron, join(_path, ref_cell))
E           AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f55dbd35310>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7f55dbd35310> = diff('/tmp/tmpa5q3ezo7test_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/path_grower.h5')
E            +    where '/home/runner/work/NeuroTS/NeuroTS/tests/data/path_grower.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'path_grower.h5')

tests/test_neuron_functional.py:132: AssertionError

Check failure on line 1 in TestPathGrower

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

TestPathGrower.test_default

AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f70eeeb5390>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7f70eeeb5390> = diff('/tmp/tmp880epgfutest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/path_grower.h5')
 +    where '/home/runner/work/NeuroTS/NeuroTS/tests/data/path_grower.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'path_grower.h5')
Raw output
self = <tests.test_neuron_functional.TestPathGrower object at 0x7f70ef157010>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw0/test_default0')

    def test_default(self, tmpdir):
>       _test_full(
            "path_distances",
            "bio_distribution.json",
            "bio_path_params.json",
            "path_grower.h5",
            "bio_path_persistence_diagram.json",
            output_dir=tmpdir,
        )

tests/test_neuron_functional.py:459: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

feature = 'path_distances'
distributions = {'apical_dendrite': {'filtration_metric': 'path_distances', 'min_bar_length': 1.0, 'num_trees': {'data': {'bins': [1],...665, 0.02188742478139427], [265.46654445080054, 0, nan, nan, nan, nan]]], ...}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'bio_path_params.json', ref_cell = 'path_grower.h5'
ref_persistence_diagram = 'bio_path_persistence_diagram.json'
rng_or_seed = None, skip_preprocessing = False
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw0/test_default0')

    def _test_full(
        feature,
        distributions,
        parameters,
        ref_cell,
        ref_persistence_diagram,
        rng_or_seed=None,
        skip_preprocessing=False,
        output_dir=None,
    ):
        distributions, params = _load_inputs(join(_path, distributions), join(_path, parameters))
        if rng_or_seed is None:
            np.random.seed(0)
            n = NeuronGrower(
                input_distributions=distributions,
                input_parameters=params,
                skip_preprocessing=skip_preprocessing,
            ).grow()
        else:
            n = NeuronGrower(
                input_distributions=distributions,
                input_parameters=params,
                rng_or_seed=rng_or_seed,
                skip_preprocessing=skip_preprocessing,
            ).grow()
    
        with TemporaryDirectory("test_grower") as folder:
            out_neuron = join(folder, "test_output_neuron_.h5")
            n.write(out_neuron)
    
            # For checking purposes, we can output the cells as swc
            if output_dir is not None:
                if not os.path.exists(output_dir):
                    os.mkdir(output_dir)
                n.write(join(output_dir, basename(ref_cell)))
    
            if ref_persistence_diagram is not None:
                # Load with TMD and extract radial persistence
                n0 = tmd.io.load_neuron(out_neuron)
    
                actual_persistence_diagram = tmd.methods.get_persistence_diagram(
                    n0.apical_dendrite[0], feature=feature
                )
                if output_dir is not None:
                    with open(
                        join(output_dir, basename(ref_persistence_diagram)), "w", encoding="utf-8"
                    ) as f:
                        json.dump(actual_persistence_diagram, f, sort_keys=True, indent=2)
    
                with open(join(_path, ref_persistence_diagram), encoding="utf-8") as f:
                    expected_persistence_diagram = json.load(f)
                assert_close_persistent_diagram(
                    actual_persistence_diagram, expected_persistence_diagram
                )
>           assert not diff(out_neuron, join(_path, ref_cell))
E           AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f70eeeb5390>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7f70eeeb5390> = diff('/tmp/tmp880epgfutest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/path_grower.h5')
E            +    where '/home/runner/work/NeuroTS/NeuroTS/tests/data/path_grower.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'path_grower.h5')

tests/test_neuron_functional.py:132: AssertionError

Check failure on line 1 in TestPathGrower

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

TestPathGrower.test_with_rng

AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f70eef5c850>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7f70eef5c850> = diff('/tmp/tmpincz5kh_test_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/path_grower.h5')
 +    where '/home/runner/work/NeuroTS/NeuroTS/tests/data/path_grower.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'path_grower.h5')
Raw output
self = <tests.test_neuron_functional.TestPathGrower object at 0x7f70ef1576d0>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw0/test_with_rng0')

    def test_with_rng(self, tmpdir):
>       _test_full(
            "path_distances",
            "bio_distribution.json",
            "bio_path_params.json",
            "path_grower.h5",
            "bio_path_persistence_diagram.json",
            rng_or_seed=build_random_generator(0),
            output_dir=tmpdir,
        )

tests/test_neuron_functional.py:469: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

feature = 'path_distances'
distributions = {'apical_dendrite': {'filtration_metric': 'path_distances', 'min_bar_length': 1.0, 'num_trees': {'data': {'bins': [1],...665, 0.02188742478139427], [265.46654445080054, 0, nan, nan, nan, nan]]], ...}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'bio_path_params.json', ref_cell = 'path_grower.h5'
ref_persistence_diagram = 'bio_path_persistence_diagram.json'
rng_or_seed = RandomState(MT19937) at 0x7F70ECE10640, skip_preprocessing = False
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw0/test_with_rng0')

    def _test_full(
        feature,
        distributions,
        parameters,
        ref_cell,
        ref_persistence_diagram,
        rng_or_seed=None,
        skip_preprocessing=False,
        output_dir=None,
    ):
        distributions, params = _load_inputs(join(_path, distributions), join(_path, parameters))
        if rng_or_seed is None:
            np.random.seed(0)
            n = NeuronGrower(
                input_distributions=distributions,
                input_parameters=params,
                skip_preprocessing=skip_preprocessing,
            ).grow()
        else:
            n = NeuronGrower(
                input_distributions=distributions,
                input_parameters=params,
                rng_or_seed=rng_or_seed,
                skip_preprocessing=skip_preprocessing,
            ).grow()
    
        with TemporaryDirectory("test_grower") as folder:
            out_neuron = join(folder, "test_output_neuron_.h5")
            n.write(out_neuron)
    
            # For checking purposes, we can output the cells as swc
            if output_dir is not None:
                if not os.path.exists(output_dir):
                    os.mkdir(output_dir)
                n.write(join(output_dir, basename(ref_cell)))
    
            if ref_persistence_diagram is not None:
                # Load with TMD and extract radial persistence
                n0 = tmd.io.load_neuron(out_neuron)
    
                actual_persistence_diagram = tmd.methods.get_persistence_diagram(
                    n0.apical_dendrite[0], feature=feature
                )
                if output_dir is not None:
                    with open(
                        join(output_dir, basename(ref_persistence_diagram)), "w", encoding="utf-8"
                    ) as f:
                        json.dump(actual_persistence_diagram, f, sort_keys=True, indent=2)
    
                with open(join(_path, ref_persistence_diagram), encoding="utf-8") as f:
                    expected_persistence_diagram = json.load(f)
                assert_close_persistent_diagram(
                    actual_persistence_diagram, expected_persistence_diagram
                )
>           assert not diff(out_neuron, join(_path, ref_cell))
E           AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f70eef5c850>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7f70eef5c850> = diff('/tmp/tmpincz5kh_test_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/path_grower.h5')
E            +    where '/home/runner/work/NeuroTS/NeuroTS/tests/data/path_grower.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'path_grower.h5')

tests/test_neuron_functional.py:132: AssertionError

Check failure on line 1 in TestGradientPathGrower

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

TestGradientPathGrower.test_default

AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f55db7bb990>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7f55db7bb990> = diff('/tmp/tmpft_vpu2ytest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/gradient_path_grower.h5')
 +    where '/home/runner/work/NeuroTS/NeuroTS/tests/data/gradient_path_grower.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'gradient_path_grower.h5')
Raw output
self = <tests.test_neuron_functional.TestGradientPathGrower object at 0x7f55dba3c8d0>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw3/test_default0')

    def test_default(self, tmpdir):
>       _test_full(
            "path_distances",
            "bio_distribution.json",
            "bio_gradient_path_params.json",
            "gradient_path_grower.h5",
            "gradient_path_persistence_diagram.json",
            output_dir=tmpdir,
        )

tests/test_neuron_functional.py:529: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

feature = 'path_distances'
distributions = {'apical_dendrite': {'filtration_metric': 'path_distances', 'min_bar_length': 1.0, 'num_trees': {'data': {'bins': [1],...665, 0.02188742478139427], [265.46654445080054, 0, nan, nan, nan, nan]]], ...}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'bio_gradient_path_params.json'
ref_cell = 'gradient_path_grower.h5'
ref_persistence_diagram = 'gradient_path_persistence_diagram.json'
rng_or_seed = None, skip_preprocessing = False
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw3/test_default0')

    def _test_full(
        feature,
        distributions,
        parameters,
        ref_cell,
        ref_persistence_diagram,
        rng_or_seed=None,
        skip_preprocessing=False,
        output_dir=None,
    ):
        distributions, params = _load_inputs(join(_path, distributions), join(_path, parameters))
        if rng_or_seed is None:
            np.random.seed(0)
            n = NeuronGrower(
                input_distributions=distributions,
                input_parameters=params,
                skip_preprocessing=skip_preprocessing,
            ).grow()
        else:
            n = NeuronGrower(
                input_distributions=distributions,
                input_parameters=params,
                rng_or_seed=rng_or_seed,
                skip_preprocessing=skip_preprocessing,
            ).grow()
    
        with TemporaryDirectory("test_grower") as folder:
            out_neuron = join(folder, "test_output_neuron_.h5")
            n.write(out_neuron)
    
            # For checking purposes, we can output the cells as swc
            if output_dir is not None:
                if not os.path.exists(output_dir):
                    os.mkdir(output_dir)
                n.write(join(output_dir, basename(ref_cell)))
    
            if ref_persistence_diagram is not None:
                # Load with TMD and extract radial persistence
                n0 = tmd.io.load_neuron(out_neuron)
    
                actual_persistence_diagram = tmd.methods.get_persistence_diagram(
                    n0.apical_dendrite[0], feature=feature
                )
                if output_dir is not None:
                    with open(
                        join(output_dir, basename(ref_persistence_diagram)), "w", encoding="utf-8"
                    ) as f:
                        json.dump(actual_persistence_diagram, f, sort_keys=True, indent=2)
    
                with open(join(_path, ref_persistence_diagram), encoding="utf-8") as f:
                    expected_persistence_diagram = json.load(f)
                assert_close_persistent_diagram(
                    actual_persistence_diagram, expected_persistence_diagram
                )
>           assert not diff(out_neuron, join(_path, ref_cell))
E           AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f55db7bb990>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7f55db7bb990> = diff('/tmp/tmpft_vpu2ytest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/gradient_path_grower.h5')
E            +    where '/home/runner/work/NeuroTS/NeuroTS/tests/data/gradient_path_grower.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'gradient_path_grower.h5')

tests/test_neuron_functional.py:132: AssertionError

Check failure on line 1 in TestBioRatL5Tpc2

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

TestBioRatL5Tpc2.test_default

AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f4a92c1ce90>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7f4a92c1ce90> = diff('/tmp/tmpf3hbeykstest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params2.h5')
 +    where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params2.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params2.h5')
Raw output
self = <tests.test_neuron_functional.TestBioRatL5Tpc2 object at 0x7f4a92ce2a10>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw1/test_default0')

    def test_default(self, tmpdir):
>       _test_full(
            "path_distances",
            "bio_rat_L5_TPC_B_distribution.json",
            "params2.json",
            "expected_bio_rat_L5_TPC_B_with_params2.h5",
            "expected_bio_rat_L5_TPC_B_with_params2_persistence_diagram.json",
            output_dir=tmpdir,
        )

tests/test_neuron_functional.py:621: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

feature = 'path_distances'
distributions = {'apical_dendrite': {'filtration_metric': 'path_distances', 'min_bar_length': 1.0, 'num_trees': {'data': {'bins': [1],....4106653615432989, 0.5277795547616266, -0.18579814237229897], ...], ...], ...}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'params2.json'
ref_cell = 'expected_bio_rat_L5_TPC_B_with_params2.h5'
ref_persistence_diagram = 'expected_bio_rat_L5_TPC_B_with_params2_persistence_diagram.json'
rng_or_seed = None, skip_preprocessing = False
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw1/test_default0')

    def _test_full(
        feature,
        distributions,
        parameters,
        ref_cell,
        ref_persistence_diagram,
        rng_or_seed=None,
        skip_preprocessing=False,
        output_dir=None,
    ):
        distributions, params = _load_inputs(join(_path, distributions), join(_path, parameters))
        if rng_or_seed is None:
            np.random.seed(0)
            n = NeuronGrower(
                input_distributions=distributions,
                input_parameters=params,
                skip_preprocessing=skip_preprocessing,
            ).grow()
        else:
            n = NeuronGrower(
                input_distributions=distributions,
                input_parameters=params,
                rng_or_seed=rng_or_seed,
                skip_preprocessing=skip_preprocessing,
            ).grow()
    
        with TemporaryDirectory("test_grower") as folder:
            out_neuron = join(folder, "test_output_neuron_.h5")
            n.write(out_neuron)
    
            # For checking purposes, we can output the cells as swc
            if output_dir is not None:
                if not os.path.exists(output_dir):
                    os.mkdir(output_dir)
                n.write(join(output_dir, basename(ref_cell)))
    
            if ref_persistence_diagram is not None:
                # Load with TMD and extract radial persistence
                n0 = tmd.io.load_neuron(out_neuron)
    
                actual_persistence_diagram = tmd.methods.get_persistence_diagram(
                    n0.apical_dendrite[0], feature=feature
                )
                if output_dir is not None:
                    with open(
                        join(output_dir, basename(ref_persistence_diagram)), "w", encoding="utf-8"
                    ) as f:
                        json.dump(actual_persistence_diagram, f, sort_keys=True, indent=2)
    
                with open(join(_path, ref_persistence_diagram), encoding="utf-8") as f:
                    expected_persistence_diagram = json.load(f)
                assert_close_persistent_diagram(
                    actual_persistence_diagram, expected_persistence_diagram
                )
>           assert not diff(out_neuron, join(_path, ref_cell))
E           AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f4a92c1ce90>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7f4a92c1ce90> = diff('/tmp/tmpf3hbeykstest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params2.h5')
E            +    where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params2.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params2.h5')

tests/test_neuron_functional.py:132: AssertionError

Check failure on line 1 in TestPathGrower

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

TestPathGrower.test_skip_preprocessing

AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f70eccb4210>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7f70eccb4210> = diff('/tmp/tmpddd6l8ldtest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/path_grower.h5')
 +    where '/home/runner/work/NeuroTS/NeuroTS/tests/data/path_grower.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'path_grower.h5')
Raw output
self = <tests.test_neuron_functional.TestPathGrower object at 0x7f70ef157d90>
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_distribution.json",
            "bio_path_params_orientation_manager.json",
            "path_grower.h5",
            "bio_path_persistence_diagram.json",
            skip_preprocessing=True,
            output_dir=tmpdir,
        )

tests/test_neuron_functional.py:480: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

feature = 'path_distances'
distributions = {'apical_dendrite': {'filtration_metric': 'path_distances', 'min_bar_length': 1.0, 'num_trees': {'data': {'bins': [1],...665, 0.02188742478139427], [265.46654445080054, 0, nan, nan, nan, nan]]], ...}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'bio_path_params_orientation_manager.json'
ref_cell = 'path_grower.h5'
ref_persistence_diagram = 'bio_path_persistence_diagram.json'
rng_or_seed = None, skip_preprocessing = True
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw0/test_skip_preprocessing0')

    def _test_full(
        feature,
        distributions,
        parameters,
        ref_cell,
        ref_persistence_diagram,
        rng_or_seed=None,
        skip_preprocessing=False,
        output_dir=None,
    ):
        distributions, params = _load_inputs(join(_path, distributions), join(_path, parameters))
        if rng_or_seed is None:
            np.random.seed(0)
            n = NeuronGrower(
                input_distributions=distributions,
                input_parameters=params,
                skip_preprocessing=skip_preprocessing,
            ).grow()
        else:
            n = NeuronGrower(
                input_distributions=distributions,
                input_parameters=params,
                rng_or_seed=rng_or_seed,
                skip_preprocessing=skip_preprocessing,
            ).grow()
    
        with TemporaryDirectory("test_grower") as folder:
            out_neuron = join(folder, "test_output_neuron_.h5")
            n.write(out_neuron)
    
            # For checking purposes, we can output the cells as swc
            if output_dir is not None:
                if not os.path.exists(output_dir):
                    os.mkdir(output_dir)
                n.write(join(output_dir, basename(ref_cell)))
    
            if ref_persistence_diagram is not None:
                # Load with TMD and extract radial persistence
                n0 = tmd.io.load_neuron(out_neuron)
    
                actual_persistence_diagram = tmd.methods.get_persistence_diagram(
                    n0.apical_dendrite[0], feature=feature
                )
                if output_dir is not None:
                    with open(
                        join(output_dir, basename(ref_persistence_diagram)), "w", encoding="utf-8"
                    ) as f:
                        json.dump(actual_persistence_diagram, f, sort_keys=True, indent=2)
    
                with open(join(_path, ref_persistence_diagram), encoding="utf-8") as f:
                    expected_persistence_diagram = json.load(f)
                assert_close_persistent_diagram(
                    actual_persistence_diagram, expected_persistence_diagram
                )
>           assert not diff(out_neuron, join(_path, ref_cell))
E           AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f70eccb4210>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7f70eccb4210> = diff('/tmp/tmpddd6l8ldtest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/path_grower.h5')
E            +    where '/home/runner/work/NeuroTS/NeuroTS/tests/data/path_grower.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'path_grower.h5')

tests/test_neuron_functional.py:132: AssertionError

Check failure on line 1 in TestGradientPathGrower

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

TestGradientPathGrower.test_with_rng

AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f55db7ab2d0>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7f55db7ab2d0> = diff('/tmp/tmprzsp0cn7test_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/gradient_path_grower.h5')
 +    where '/home/runner/work/NeuroTS/NeuroTS/tests/data/gradient_path_grower.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'gradient_path_grower.h5')
Raw output
self = <tests.test_neuron_functional.TestGradientPathGrower object at 0x7f55db901390>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw3/test_with_rng0')

    def test_with_rng(self, tmpdir):
>       _test_full(
            "path_distances",
            "bio_distribution.json",
            "bio_gradient_path_params.json",
            "gradient_path_grower.h5",
            "gradient_path_persistence_diagram.json",
            rng_or_seed=build_random_generator(0),
            output_dir=tmpdir,
        )

tests/test_neuron_functional.py:539: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

feature = 'path_distances'
distributions = {'apical_dendrite': {'filtration_metric': 'path_distances', 'min_bar_length': 1.0, 'num_trees': {'data': {'bins': [1],...665, 0.02188742478139427], [265.46654445080054, 0, nan, nan, nan, nan]]], ...}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'bio_gradient_path_params.json'
ref_cell = 'gradient_path_grower.h5'
ref_persistence_diagram = 'gradient_path_persistence_diagram.json'
rng_or_seed = RandomState(MT19937) at 0x7F55DB84BE40, skip_preprocessing = False
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw3/test_with_rng0')

    def _test_full(
        feature,
        distributions,
        parameters,
        ref_cell,
        ref_persistence_diagram,
        rng_or_seed=None,
        skip_preprocessing=False,
        output_dir=None,
    ):
        distributions, params = _load_inputs(join(_path, distributions), join(_path, parameters))
        if rng_or_seed is None:
            np.random.seed(0)
            n = NeuronGrower(
                input_distributions=distributions,
                input_parameters=params,
                skip_preprocessing=skip_preprocessing,
            ).grow()
        else:
            n = NeuronGrower(
                input_distributions=distributions,
                input_parameters=params,
                rng_or_seed=rng_or_seed,
                skip_preprocessing=skip_preprocessing,
            ).grow()
    
        with TemporaryDirectory("test_grower") as folder:
            out_neuron = join(folder, "test_output_neuron_.h5")
            n.write(out_neuron)
    
            # For checking purposes, we can output the cells as swc
            if output_dir is not None:
                if not os.path.exists(output_dir):
                    os.mkdir(output_dir)
                n.write(join(output_dir, basename(ref_cell)))
    
            if ref_persistence_diagram is not None:
                # Load with TMD and extract radial persistence
                n0 = tmd.io.load_neuron(out_neuron)
    
                actual_persistence_diagram = tmd.methods.get_persistence_diagram(
                    n0.apical_dendrite[0], feature=feature
                )
                if output_dir is not None:
                    with open(
                        join(output_dir, basename(ref_persistence_diagram)), "w", encoding="utf-8"
                    ) as f:
                        json.dump(actual_persistence_diagram, f, sort_keys=True, indent=2)
    
                with open(join(_path, ref_persistence_diagram), encoding="utf-8") as f:
                    expected_persistence_diagram = json.load(f)
                assert_close_persistent_diagram(
                    actual_persistence_diagram, expected_persistence_diagram
                )
>           assert not diff(out_neuron, join(_path, ref_cell))
E           AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f55db7ab2d0>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7f55db7ab2d0> = diff('/tmp/tmprzsp0cn7test_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/gradient_path_grower.h5')
E            +    where '/home/runner/work/NeuroTS/NeuroTS/tests/data/gradient_path_grower.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'gradient_path_grower.h5')

tests/test_neuron_functional.py:132: AssertionError

Check failure on line 1 in TestBioRatL5Tpc4

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

TestBioRatL5Tpc4.test_default

AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f70ecc9f5d0>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7f70ecc9f5d0> = diff('/tmp/tmpyxmiftintest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params4.h5')
 +    where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params4.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params4.h5')
Raw output
self = <tests.test_neuron_functional.TestBioRatL5Tpc4 object at 0x7f70ef16e650>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw0/test_default1')

    def test_default(self, tmpdir):
>       _test_full(
            "path_distances",
            "bio_rat_L5_TPC_B_distribution.json",
            "params4.json",
            "expected_bio_rat_L5_TPC_B_with_params4.h5",
            "expected_bio_rat_L5_TPC_B_with_params4_persistence_diagram.json",
            output_dir=tmpdir,
        )

tests/test_neuron_functional.py:713: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

feature = 'path_distances'
distributions = {'apical_dendrite': {'filtration_metric': 'path_distances', 'min_bar_length': 1.0, 'num_trees': {'data': {'bins': [1],....4106653615432989, 0.5277795547616266, -0.18579814237229897], ...], ...], ...}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'params4.json'
ref_cell = 'expected_bio_rat_L5_TPC_B_with_params4.h5'
ref_persistence_diagram = 'expected_bio_rat_L5_TPC_B_with_params4_persistence_diagram.json'
rng_or_seed = None, skip_preprocessing = False
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw0/test_default1')

    def _test_full(
        feature,
        distributions,
        parameters,
        ref_cell,
        ref_persistence_diagram,
        rng_or_seed=None,
        skip_preprocessing=False,
        output_dir=None,
    ):
        distributions, params = _load_inputs(join(_path, distributions), join(_path, parameters))
        if rng_or_seed is None:
            np.random.seed(0)
            n = NeuronGrower(
                input_distributions=distributions,
                input_parameters=params,
                skip_preprocessing=skip_preprocessing,
            ).grow()
        else:
            n = NeuronGrower(
                input_distributions=distributions,
                input_parameters=params,
                rng_or_seed=rng_or_seed,
                skip_preprocessing=skip_preprocessing,
            ).grow()
    
        with TemporaryDirectory("test_grower") as folder:
            out_neuron = join(folder, "test_output_neuron_.h5")
            n.write(out_neuron)
    
            # For checking purposes, we can output the cells as swc
            if output_dir is not None:
                if not os.path.exists(output_dir):
                    os.mkdir(output_dir)
                n.write(join(output_dir, basename(ref_cell)))
    
            if ref_persistence_diagram is not None:
                # Load with TMD and extract radial persistence
                n0 = tmd.io.load_neuron(out_neuron)
    
                actual_persistence_diagram = tmd.methods.get_persistence_diagram(
                    n0.apical_dendrite[0], feature=feature
                )
                if output_dir is not None:
                    with open(
                        join(output_dir, basename(ref_persistence_diagram)), "w", encoding="utf-8"
                    ) as f:
                        json.dump(actual_persistence_diagram, f, sort_keys=True, indent=2)
    
                with open(join(_path, ref_persistence_diagram), encoding="utf-8") as f:
                    expected_persistence_diagram = json.load(f)
                assert_close_persistent_diagram(
                    actual_persistence_diagram, expected_persistence_diagram
                )
>           assert not diff(out_neuron, join(_path, ref_cell))
E           AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f70ecc9f5d0>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7f70ecc9f5d0> = diff('/tmp/tmpyxmiftintest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params4.h5')
E            +    where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params4.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params4.h5')

tests/test_neuron_functional.py:132: AssertionError

Check failure on line 1 in TestGradientPathGrower

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

TestGradientPathGrower.test_skip_preprocessing

AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f55db9aa110>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7f55db9aa110> = diff('/tmp/tmprzwa_ocbtest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/gradient_path_grower.h5')
 +    where '/home/runner/work/NeuroTS/NeuroTS/tests/data/gradient_path_grower.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'gradient_path_grower.h5')
Raw output
self = <tests.test_neuron_functional.TestGradientPathGrower object at 0x7f55db94f650>
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_gradient_path_params_orientation_manager.json",
            "gradient_path_grower.h5",
            "gradient_path_persistence_diagram.json",
            skip_preprocessing=True,
            output_dir=tmpdir,
        )

tests/test_neuron_functional.py:550: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

feature = 'path_distances'
distributions = {'apical_dendrite': {'filtration_metric': 'path_distances', 'min_bar_length': 1.0, 'num_trees': {'data': {'bins': [1],...665, 0.02188742478139427], [265.46654445080054, 0, nan, nan, nan, nan]]], ...}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'bio_gradient_path_params_orientation_manager.json'
ref_cell = 'gradient_path_grower.h5'
ref_persistence_diagram = 'gradient_path_persistence_diagram.json'
rng_or_seed = None, skip_preprocessing = True
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw3/test_skip_preprocessing0')

    def _test_full(
        feature,
        distributions,
        parameters,
        ref_cell,
        ref_persistence_diagram,
        rng_or_seed=None,
        skip_preprocessing=False,
        output_dir=None,
    ):
        distributions, params = _load_inputs(join(_path, distributions), join(_path, parameters))
        if rng_or_seed is None:
            np.random.seed(0)
            n = NeuronGrower(
                input_distributions=distributions,
                input_parameters=params,
                skip_preprocessing=skip_preprocessing,
            ).grow()
        else:
            n = NeuronGrower(
                input_distributions=distributions,
                input_parameters=params,
                rng_or_seed=rng_or_seed,
                skip_preprocessing=skip_preprocessing,
            ).grow()
    
        with TemporaryDirectory("test_grower") as folder:
            out_neuron = join(folder, "test_output_neuron_.h5")
            n.write(out_neuron)
    
            # For checking purposes, we can output the cells as swc
            if output_dir is not None:
                if not os.path.exists(output_dir):
                    os.mkdir(output_dir)
                n.write(join(output_dir, basename(ref_cell)))
    
            if ref_persistence_diagram is not None:
                # Load with TMD and extract radial persistence
                n0 = tmd.io.load_neuron(out_neuron)
    
                actual_persistence_diagram = tmd.methods.get_persistence_diagram(
                    n0.apical_dendrite[0], feature=feature
                )
                if output_dir is not None:
                    with open(
                        join(output_dir, basename(ref_persistence_diagram)), "w", encoding="utf-8"
                    ) as f:
                        json.dump(actual_persistence_diagram, f, sort_keys=True, indent=2)
    
                with open(join(_path, ref_persistence_diagram), encoding="utf-8") as f:
                    expected_persistence_diagram = json.load(f)
                assert_close_persistent_diagram(
                    actual_persistence_diagram, expected_persistence_diagram
                )
>           assert not diff(out_neuron, join(_path, ref_cell))
E           AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f55db9aa110>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7f55db9aa110> = diff('/tmp/tmprzwa_ocbtest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/gradient_path_grower.h5')
E            +    where '/home/runner/work/NeuroTS/NeuroTS/tests/data/gradient_path_grower.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'gradient_path_grower.h5')

tests/test_neuron_functional.py:132: AssertionError

Check failure on line 1 in TestBioRatL5Tpc2

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

TestBioRatL5Tpc2.test_with_rng

AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f4a9084bf10>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7f4a9084bf10> = diff('/tmp/tmplll0498xtest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params2.h5')
 +    where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params2.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params2.h5')
Raw output
self = <tests.test_neuron_functional.TestBioRatL5Tpc2 object at 0x7f4a92ce30d0>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw1/test_with_rng0')

    def test_with_rng(self, tmpdir):
>       _test_full(
            "path_distances",
            "bio_rat_L5_TPC_B_distribution.json",
            "params2.json",
            "expected_bio_rat_L5_TPC_B_with_params2.h5",
            "expected_bio_rat_L5_TPC_B_with_params2_persistence_diagram.json",
            rng_or_seed=build_random_generator(0),
            output_dir=tmpdir,
        )

tests/test_neuron_functional.py:631: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

feature = 'path_distances'
distributions = {'apical_dendrite': {'filtration_metric': 'path_distances', 'min_bar_length': 1.0, 'num_trees': {'data': {'bins': [1],....4106653615432989, 0.5277795547616266, -0.18579814237229897], ...], ...], ...}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'params2.json'
ref_cell = 'expected_bio_rat_L5_TPC_B_with_params2.h5'
ref_persistence_diagram = 'expected_bio_rat_L5_TPC_B_with_params2_persistence_diagram.json'
rng_or_seed = RandomState(MT19937) at 0x7F4A92BF8640, skip_preprocessing = False
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw1/test_with_rng0')

    def _test_full(
        feature,
        distributions,
        parameters,
        ref_cell,
        ref_persistence_diagram,
        rng_or_seed=None,
        skip_preprocessing=False,
        output_dir=None,
    ):
        distributions, params = _load_inputs(join(_path, distributions), join(_path, parameters))
        if rng_or_seed is None:
            np.random.seed(0)
            n = NeuronGrower(
                input_distributions=distributions,
                input_parameters=params,
                skip_preprocessing=skip_preprocessing,
            ).grow()
        else:
            n = NeuronGrower(
                input_distributions=distributions,
                input_parameters=params,
                rng_or_seed=rng_or_seed,
                skip_preprocessing=skip_preprocessing,
            ).grow()
    
        with TemporaryDirectory("test_grower") as folder:
            out_neuron = join(folder, "test_output_neuron_.h5")
            n.write(out_neuron)
    
            # For checking purposes, we can output the cells as swc
            if output_dir is not None:
                if not os.path.exists(output_dir):
                    os.mkdir(output_dir)
                n.write(join(output_dir, basename(ref_cell)))
    
            if ref_persistence_diagram is not None:
                # Load with TMD and extract radial persistence
                n0 = tmd.io.load_neuron(out_neuron)
    
                actual_persistence_diagram = tmd.methods.get_persistence_diagram(
                    n0.apical_dendrite[0], feature=feature
                )
                if output_dir is not None:
                    with open(
                        join(output_dir, basename(ref_persistence_diagram)), "w", encoding="utf-8"
                    ) as f:
                        json.dump(actual_persistence_diagram, f, sort_keys=True, indent=2)
    
                with open(join(_path, ref_persistence_diagram), encoding="utf-8") as f:
                    expected_persistence_diagram = json.load(f)
                assert_close_persistent_diagram(
                    actual_persistence_diagram, expected_persistence_diagram
                )
>           assert not diff(out_neuron, join(_path, ref_cell))
E           AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f4a9084bf10>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7f4a9084bf10> = diff('/tmp/tmplll0498xtest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params2.h5')
E            +    where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params2.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params2.h5')

tests/test_neuron_functional.py:132: AssertionError

Check failure on line 1 in TestGradientPathGrower

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

TestGradientPathGrower.test_skip_rng_and_preprocessing

AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f55d7497dd0>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7f55d7497dd0> = diff('/tmp/tmplwnxy2gvtest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/gradient_path_grower.h5')
 +    where '/home/runner/work/NeuroTS/NeuroTS/tests/data/gradient_path_grower.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'gradient_path_grower.h5')
Raw output
self = <tests.test_neuron_functional.TestGradientPathGrower object at 0x7f55dba537d0>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw3/test_skip_rng_and_preprocessin1')

    def test_skip_rng_and_preprocessing(self, tmpdir):
>       _test_full(
            "path_distances",
            "bio_distribution.json",
            "bio_gradient_path_params_orientation_manager.json",
            "gradient_path_grower.h5",
            "gradient_path_persistence_diagram.json",
            skip_preprocessing=True,
            rng_or_seed=build_random_generator(0),
            output_dir=tmpdir,
        )

tests/test_neuron_functional.py:561: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

feature = 'path_distances'
distributions = {'apical_dendrite': {'filtration_metric': 'path_distances', 'min_bar_length': 1.0, 'num_trees': {'data': {'bins': [1],...665, 0.02188742478139427], [265.46654445080054, 0, nan, nan, nan, nan]]], ...}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'bio_gradient_path_params_orientation_manager.json'
ref_cell = 'gradient_path_grower.h5'
ref_persistence_diagram = 'gradient_path_persistence_diagram.json'
rng_or_seed = RandomState(MT19937) at 0x7F55DB84B640, skip_preprocessing = True
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw3/test_skip_rng_and_preprocessin1')

    def _test_full(
        feature,
        distributions,
        parameters,
        ref_cell,
        ref_persistence_diagram,
        rng_or_seed=None,
        skip_preprocessing=False,
        output_dir=None,
    ):
        distributions, params = _load_inputs(join(_path, distributions), join(_path, parameters))
        if rng_or_seed is None:
            np.random.seed(0)
            n = NeuronGrower(
                input_distributions=distributions,
                input_parameters=params,
                skip_preprocessing=skip_preprocessing,
            ).grow()
        else:
            n = NeuronGrower(
                input_distributions=distributions,
                input_parameters=params,
                rng_or_seed=rng_or_seed,
                skip_preprocessing=skip_preprocessing,
            ).grow()
    
        with TemporaryDirectory("test_grower") as folder:
            out_neuron = join(folder, "test_output_neuron_.h5")
            n.write(out_neuron)
    
            # For checking purposes, we can output the cells as swc
            if output_dir is not None:
                if not os.path.exists(output_dir):
                    os.mkdir(output_dir)
                n.write(join(output_dir, basename(ref_cell)))
    
            if ref_persistence_diagram is not None:
                # Load with TMD and extract radial persistence
                n0 = tmd.io.load_neuron(out_neuron)
    
                actual_persistence_diagram = tmd.methods.get_persistence_diagram(
                    n0.apical_dendrite[0], feature=feature
                )
                if output_dir is not None:
                    with open(
                        join(output_dir, basename(ref_persistence_diagram)), "w", encoding="utf-8"
                    ) as f:
                        json.dump(actual_persistence_diagram, f, sort_keys=True, indent=2)
    
                with open(join(_path, ref_persistence_diagram), encoding="utf-8") as f:
                    expected_persistence_diagram = json.load(f)
                assert_close_persistent_diagram(
                    actual_persistence_diagram, expected_persistence_diagram
                )
>           assert not diff(out_neuron, join(_path, ref_cell))
E           AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f55d7497dd0>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7f55d7497dd0> = diff('/tmp/tmplwnxy2gvtest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/gradient_path_grower.h5')
E            +    where '/home/runner/work/NeuroTS/NeuroTS/tests/data/gradient_path_grower.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'gradient_path_grower.h5')

tests/test_neuron_functional.py:132: AssertionError

Check failure on line 1 in TestBioRatL5Tpc4

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

TestBioRatL5Tpc4.test_with_rng

AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f70ec8f5390>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7f70ec8f5390> = diff('/tmp/tmpcvaix3ritest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params4.h5')
 +    where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params4.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params4.h5')
Raw output
self = <tests.test_neuron_functional.TestBioRatL5Tpc4 object at 0x7f70ef16ed10>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw0/test_with_rng1')

    def test_with_rng(self, tmpdir):
>       _test_full(
            "path_distances",
            "bio_rat_L5_TPC_B_distribution.json",
            "params4.json",
            "expected_bio_rat_L5_TPC_B_with_params4.h5",
            "expected_bio_rat_L5_TPC_B_with_params4_persistence_diagram.json",
            rng_or_seed=build_random_generator(0),
            output_dir=tmpdir,
        )

tests/test_neuron_functional.py:723: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

feature = 'path_distances'
distributions = {'apical_dendrite': {'filtration_metric': 'path_distances', 'min_bar_length': 1.0, 'num_trees': {'data': {'bins': [1],....4106653615432989, 0.5277795547616266, -0.18579814237229897], ...], ...], ...}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'params4.json'
ref_cell = 'expected_bio_rat_L5_TPC_B_with_params4.h5'
ref_persistence_diagram = 'expected_bio_rat_L5_TPC_B_with_params4_persistence_diagram.json'
rng_or_seed = RandomState(MT19937) at 0x7F70ECE11240, skip_preprocessing = False
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw0/test_with_rng1')

    def _test_full(
        feature,
        distributions,
        parameters,
        ref_cell,
        ref_persistence_diagram,
        rng_or_seed=None,
        skip_preprocessing=False,
        output_dir=None,
    ):
        distributions, params = _load_inputs(join(_path, distributions), join(_path, parameters))
        if rng_or_seed is None:
            np.random.seed(0)
            n = NeuronGrower(
                input_distributions=distributions,
                input_parameters=params,
                skip_preprocessing=skip_preprocessing,
            ).grow()
        else:
            n = NeuronGrower(
                input_distributions=distributions,
                input_parameters=params,
                rng_or_seed=rng_or_seed,
                skip_preprocessing=skip_preprocessing,
            ).grow()
    
        with TemporaryDirectory("test_grower") as folder:
            out_neuron = join(folder, "test_output_neuron_.h5")
            n.write(out_neuron)
    
            # For checking purposes, we can output the cells as swc
            if output_dir is not None:
                if not os.path.exists(output_dir):
                    os.mkdir(output_dir)
                n.write(join(output_dir, basename(ref_cell)))
    
            if ref_persistence_diagram is not None:
                # Load with TMD and extract radial persistence
                n0 = tmd.io.load_neuron(out_neuron)
    
                actual_persistence_diagram = tmd.methods.get_persistence_diagram(
                    n0.apical_dendrite[0], feature=feature
                )
                if output_dir is not None:
                    with open(
                        join(output_dir, basename(ref_persistence_diagram)), "w", encoding="utf-8"
                    ) as f:
                        json.dump(actual_persistence_diagram, f, sort_keys=True, indent=2)
    
                with open(join(_path, ref_persistence_diagram), encoding="utf-8") as f:
                    expected_persistence_diagram = json.load(f)
                assert_close_persistent_diagram(
                    actual_persistence_diagram, expected_persistence_diagram
                )
>           assert not diff(out_neuron, join(_path, ref_cell))
E           AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f70ec8f5390>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7f70ec8f5390> = diff('/tmp/tmpcvaix3ritest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params4.h5')
E            +    where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params4.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params4.h5')

tests/test_neuron_functional.py:132: AssertionError

Check failure on line 1 in TestBioRatL5Tpc1

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

TestBioRatL5Tpc1.test_default

AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f55db824d90>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7f55db824d90> = diff('/tmp/tmpwfj3pd32test_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params1.h5')
 +    where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params1.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params1.h5')
Raw output
self = <tests.test_neuron_functional.TestBioRatL5Tpc1 object at 0x7f55dba53dd0>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw3/test_default1')

    def test_default(self, tmpdir):
>       _test_full(
            "path_distances",
            "bio_rat_L5_TPC_B_distribution.json",
            "params1.json",
            "expected_bio_rat_L5_TPC_B_with_params1.h5",
            "expected_bio_rat_L5_TPC_B_with_params1_persistence_diagram.json",
            output_dir=tmpdir,
        )

tests/test_neuron_functional.py:575: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

feature = 'path_distances'
distributions = {'apical_dendrite': {'filtration_metric': 'path_distances', 'min_bar_length': 1.0, 'num_trees': {'data': {'bins': [1],....4106653615432989, 0.5277795547616266, -0.18579814237229897], ...], ...], ...}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'params1.json'
ref_cell = 'expected_bio_rat_L5_TPC_B_with_params1.h5'
ref_persistence_diagram = 'expected_bio_rat_L5_TPC_B_with_params1_persistence_diagram.json'
rng_or_seed = None, skip_preprocessing = False
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw3/test_default1')

    def _test_full(
        feature,
        distributions,
        parameters,
        ref_cell,
        ref_persistence_diagram,
        rng_or_seed=None,
        skip_preprocessing=False,
        output_dir=None,
    ):
        distributions, params = _load_inputs(join(_path, distributions), join(_path, parameters))
        if rng_or_seed is None:
            np.random.seed(0)
            n = NeuronGrower(
                input_distributions=distributions,
                input_parameters=params,
                skip_preprocessing=skip_preprocessing,
            ).grow()
        else:
            n = NeuronGrower(
                input_distributions=distributions,
                input_parameters=params,
                rng_or_seed=rng_or_seed,
                skip_preprocessing=skip_preprocessing,
            ).grow()
    
        with TemporaryDirectory("test_grower") as folder:
            out_neuron = join(folder, "test_output_neuron_.h5")
            n.write(out_neuron)
    
            # For checking purposes, we can output the cells as swc
            if output_dir is not None:
                if not os.path.exists(output_dir):
                    os.mkdir(output_dir)
                n.write(join(output_dir, basename(ref_cell)))
    
            if ref_persistence_diagram is not None:
                # Load with TMD and extract radial persistence
                n0 = tmd.io.load_neuron(out_neuron)
    
                actual_persistence_diagram = tmd.methods.get_persistence_diagram(
                    n0.apical_dendrite[0], feature=feature
                )
                if output_dir is not None:
                    with open(
                        join(output_dir, basename(ref_persistence_diagram)), "w", encoding="utf-8"
                    ) as f:
                        json.dump(actual_persistence_diagram, f, sort_keys=True, indent=2)
    
                with open(join(_path, ref_persistence_diagram), encoding="utf-8") as f:
                    expected_persistence_diagram = json.load(f)
                assert_close_persistent_diagram(
                    actual_persistence_diagram, expected_persistence_diagram
                )
>           assert not diff(out_neuron, join(_path, ref_cell))
E           AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f55db824d90>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7f55db824d90> = diff('/tmp/tmpwfj3pd32test_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params1.h5')
E            +    where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params1.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params1.h5')

tests/test_neuron_functional.py:132: AssertionError

Check failure on line 1 in TestBioRatL5Tpc2

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

TestBioRatL5Tpc2.test_skip_preprocessing

AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f4a902e4e90>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7f4a902e4e90> = diff('/tmp/tmpjstpo84htest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params2.h5')
 +    where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params2.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params2.h5')
Raw output
self = <tests.test_neuron_functional.TestBioRatL5Tpc2 object at 0x7f4a92ce3790>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw1/test_skip_preprocessing0')

    def test_skip_preprocessing(self, tmpdir):
>       _test_full(
            "path_distances",
            "bio_rat_L5_TPC_B_distribution.json",
            "params2_orientation_manager.json",
            "expected_bio_rat_L5_TPC_B_with_params2.h5",
            "expected_bio_rat_L5_TPC_B_with_params2_persistence_diagram.json",
            skip_preprocessing=True,
            output_dir=tmpdir,
        )

tests/test_neuron_functional.py:642: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

feature = 'path_distances'
distributions = {'apical_dendrite': {'filtration_metric': 'path_distances', 'min_bar_length': 1.0, 'num_trees': {'data': {'bins': [1],....4106653615432989, 0.5277795547616266, -0.18579814237229897], ...], ...], ...}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'params2_orientation_manager.json'
ref_cell = 'expected_bio_rat_L5_TPC_B_with_params2.h5'
ref_persistence_diagram = 'expected_bio_rat_L5_TPC_B_with_params2_persistence_diagram.json'
rng_or_seed = None, skip_preprocessing = True
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw1/test_skip_preprocessing0')

    def _test_full(
        feature,
        distributions,
        parameters,
        ref_cell,
        ref_persistence_diagram,
        rng_or_seed=None,
        skip_preprocessing=False,
        output_dir=None,
    ):
        distributions, params = _load_inputs(join(_path, distributions), join(_path, parameters))
        if rng_or_seed is None:
            np.random.seed(0)
            n = NeuronGrower(
                input_distributions=distributions,
                input_parameters=params,
                skip_preprocessing=skip_preprocessing,
            ).grow()
        else:
            n = NeuronGrower(
                input_distributions=distributions,
                input_parameters=params,
                rng_or_seed=rng_or_seed,
                skip_preprocessing=skip_preprocessing,
            ).grow()
    
        with TemporaryDirectory("test_grower") as folder:
            out_neuron = join(folder, "test_output_neuron_.h5")
            n.write(out_neuron)
    
            # For checking purposes, we can output the cells as swc
            if output_dir is not None:
                if not os.path.exists(output_dir):
                    os.mkdir(output_dir)
                n.write(join(output_dir, basename(ref_cell)))
    
            if ref_persistence_diagram is not None:
                # Load with TMD and extract radial persistence
                n0 = tmd.io.load_neuron(out_neuron)
    
                actual_persistence_diagram = tmd.methods.get_persistence_diagram(
                    n0.apical_dendrite[0], feature=feature
                )
                if output_dir is not None:
                    with open(
                        join(output_dir, basename(ref_persistence_diagram)), "w", encoding="utf-8"
                    ) as f:
                        json.dump(actual_persistence_diagram, f, sort_keys=True, indent=2)
    
                with open(join(_path, ref_persistence_diagram), encoding="utf-8") as f:
                    expected_persistence_diagram = json.load(f)
                assert_close_persistent_diagram(
                    actual_persistence_diagram, expected_persistence_diagram
                )
>           assert not diff(out_neuron, join(_path, ref_cell))
E           AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f4a902e4e90>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7f4a902e4e90> = diff('/tmp/tmpjstpo84htest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params2.h5')
E            +    where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params2.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params2.h5')

tests/test_neuron_functional.py:132: AssertionError

Check failure on line 1 in TestBioRatL5Tpc4

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

TestBioRatL5Tpc4.test_skip_preprocessing

AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f70eef5c210>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7f70eef5c210> = diff('/tmp/tmpnshpyy31test_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params4.h5')
 +    where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params4.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params4.h5')
Raw output
self = <tests.test_neuron_functional.TestBioRatL5Tpc4 object at 0x7f70ef16f3d0>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw0/test_skip_preprocessing1')

    def test_skip_preprocessing(self, tmpdir):
>       _test_full(
            "path_distances",
            "bio_rat_L5_TPC_B_distribution.json",
            "params4_orientation_manager.json",
            "expected_bio_rat_L5_TPC_B_with_params4.h5",
            "expected_bio_rat_L5_TPC_B_with_params4_persistence_diagram.json",
            skip_preprocessing=True,
            output_dir=tmpdir,
        )

tests/test_neuron_functional.py:734: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

feature = 'path_distances'
distributions = {'apical_dendrite': {'filtration_metric': 'path_distances', 'min_bar_length': 1.0, 'num_trees': {'data': {'bins': [1],....4106653615432989, 0.5277795547616266, -0.18579814237229897], ...], ...], ...}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'params4_orientation_manager.json'
ref_cell = 'expected_bio_rat_L5_TPC_B_with_params4.h5'
ref_persistence_diagram = 'expected_bio_rat_L5_TPC_B_with_params4_persistence_diagram.json'
rng_or_seed = None, skip_preprocessing = True
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw0/test_skip_preprocessing1')

    def _test_full(
        feature,
        distributions,
        parameters,
        ref_cell,
        ref_persistence_diagram,
        rng_or_seed=None,
        skip_preprocessing=False,
        output_dir=None,
    ):
        distributions, params = _load_inputs(join(_path, distributions), join(_path, parameters))
        if rng_or_seed is None:
            np.random.seed(0)
            n = NeuronGrower(
                input_distributions=distributions,
                input_parameters=params,
                skip_preprocessing=skip_preprocessing,
            ).grow()
        else:
            n = NeuronGrower(
                input_distributions=distributions,
                input_parameters=params,
                rng_or_seed=rng_or_seed,
                skip_preprocessing=skip_preprocessing,
            ).grow()
    
        with TemporaryDirectory("test_grower") as folder:
            out_neuron = join(folder, "test_output_neuron_.h5")
            n.write(out_neuron)
    
            # For checking purposes, we can output the cells as swc
            if output_dir is not None:
                if not os.path.exists(output_dir):
                    os.mkdir(output_dir)
                n.write(join(output_dir, basename(ref_cell)))
    
            if ref_persistence_diagram is not None:
                # Load with TMD and extract radial persistence
                n0 = tmd.io.load_neuron(out_neuron)
    
                actual_persistence_diagram = tmd.methods.get_persistence_diagram(
                    n0.apical_dendrite[0], feature=feature
                )
                if output_dir is not None:
                    with open(
                        join(output_dir, basename(ref_persistence_diagram)), "w", encoding="utf-8"
                    ) as f:
                        json.dump(actual_persistence_diagram, f, sort_keys=True, indent=2)
    
                with open(join(_path, ref_persistence_diagram), encoding="utf-8") as f:
                    expected_persistence_diagram = json.load(f)
                assert_close_persistent_diagram(
                    actual_persistence_diagram, expected_persistence_diagram
                )
>           assert not diff(out_neuron, join(_path, ref_cell))
E           AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f70eef5c210>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7f70eef5c210> = diff('/tmp/tmpnshpyy31test_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params4.h5')
E            +    where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params4.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params4.h5')

tests/test_neuron_functional.py:132: AssertionError

Check failure on line 1 in TestBioRatL5Tpc1

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

TestBioRatL5Tpc1.test_with_rng

AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f55d7496dd0>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7f55d7496dd0> = diff('/tmp/tmp5s2blio8test_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params1.h5')
 +    where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params1.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params1.h5')
Raw output
self = <tests.test_neuron_functional.TestBioRatL5Tpc1 object at 0x7f55dba535d0>
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_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:585: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

feature = 'path_distances'
distributions = {'apical_dendrite': {'filtration_metric': 'path_distances', 'min_bar_length': 1.0, 'num_trees': {'data': {'bins': [1],....4106653615432989, 0.5277795547616266, -0.18579814237229897], ...], ...], ...}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'params1.json'
ref_cell = 'expected_bio_rat_L5_TPC_B_with_params1.h5'
ref_persistence_diagram = 'expected_bio_rat_L5_TPC_B_with_params1_persistence_diagram.json'
rng_or_seed = RandomState(MT19937) at 0x7F55D74F9240, skip_preprocessing = False
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw3/test_with_rng1')

    def _test_full(
        feature,
        distributions,
        parameters,
        ref_cell,
        ref_persistence_diagram,
        rng_or_seed=None,
        skip_preprocessing=False,
        output_dir=None,
    ):
        distributions, params = _load_inputs(join(_path, distributions), join(_path, parameters))
        if rng_or_seed is None:
            np.random.seed(0)
            n = NeuronGrower(
                input_distributions=distributions,
                input_parameters=params,
                skip_preprocessing=skip_preprocessing,
            ).grow()
        else:
            n = NeuronGrower(
                input_distributions=distributions,
                input_parameters=params,
                rng_or_seed=rng_or_seed,
                skip_preprocessing=skip_preprocessing,
            ).grow()
    
        with TemporaryDirectory("test_grower") as folder:
            out_neuron = join(folder, "test_output_neuron_.h5")
            n.write(out_neuron)
    
            # For checking purposes, we can output the cells as swc
            if output_dir is not None:
                if not os.path.exists(output_dir):
                    os.mkdir(output_dir)
                n.write(join(output_dir, basename(ref_cell)))
    
            if ref_persistence_diagram is not None:
                # Load with TMD and extract radial persistence
                n0 = tmd.io.load_neuron(out_neuron)
    
                actual_persistence_diagram = tmd.methods.get_persistence_diagram(
                    n0.apical_dendrite[0], feature=feature
                )
                if output_dir is not None:
                    with open(
                        join(output_dir, basename(ref_persistence_diagram)), "w", encoding="utf-8"
                    ) as f:
                        json.dump(actual_persistence_diagram, f, sort_keys=True, indent=2)
    
                with open(join(_path, ref_persistence_diagram), encoding="utf-8") as f:
                    expected_persistence_diagram = json.load(f)
                assert_close_persistent_diagram(
                    actual_persistence_diagram, expected_persistence_diagram
                )
>           assert not diff(out_neuron, join(_path, ref_cell))
E           AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f55d7496dd0>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7f55d7496dd0> = diff('/tmp/tmp5s2blio8test_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params1.h5')
E            +    where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params1.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params1.h5')

tests/test_neuron_functional.py:132: AssertionError

Check failure on line 1 in TestBioRatL5Tpc2

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

TestBioRatL5Tpc2.test_skip_rng_and_preprocessing

AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f4a90a27910>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7f4a90a27910> = diff('/tmp/tmpljy3s0sotest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params2.h5')
 +    where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params2.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params2.h5')
Raw output
self = <tests.test_neuron_functional.TestBioRatL5Tpc2 object at 0x7f4a92ce3e90>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw1/test_skip_rng_and_preprocessin1')

    def test_skip_rng_and_preprocessing(self, tmpdir):
>       _test_full(
            "path_distances",
            "bio_rat_L5_TPC_B_distribution.json",
            "params2_orientation_manager.json",
            "expected_bio_rat_L5_TPC_B_with_params2.h5",
            "expected_bio_rat_L5_TPC_B_with_params2_persistence_diagram.json",
            skip_preprocessing=True,
            rng_or_seed=build_random_generator(0),
            output_dir=tmpdir,
        )

tests/test_neuron_functional.py:653: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

feature = 'path_distances'
distributions = {'apical_dendrite': {'filtration_metric': 'path_distances', 'min_bar_length': 1.0, 'num_trees': {'data': {'bins': [1],....4106653615432989, 0.5277795547616266, -0.18579814237229897], ...], ...], ...}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'params2_orientation_manager.json'
ref_cell = 'expected_bio_rat_L5_TPC_B_with_params2.h5'
ref_persistence_diagram = 'expected_bio_rat_L5_TPC_B_with_params2_persistence_diagram.json'
rng_or_seed = RandomState(MT19937) at 0x7F4A92BFB140, skip_preprocessing = True
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/py311/tmp/popen-gw1/test_skip_rng_and_preprocessin1')

    def _test_full(
        feature,
        distributions,
        parameters,
        ref_cell,
        ref_persistence_diagram,
        rng_or_seed=None,
        skip_preprocessing=False,
        output_dir=None,
    ):
        distributions, params = _load_inputs(join(_path, distributions), join(_path, parameters))
        if rng_or_seed is None:
            np.random.seed(0)
            n = NeuronGrower(
                input_distributions=distributions,
                input_parameters=params,
                skip_preprocessing=skip_preprocessing,
            ).grow()
        else:
            n = NeuronGrower(
                input_distributions=distributions,
                input_parameters=params,
                rng_or_seed=rng_or_seed,
                skip_preprocessing=skip_preprocessing,
            ).grow()
    
        with TemporaryDirectory("test_grower") as folder:
            out_neuron = join(folder, "test_output_neuron_.h5")
            n.write(out_neuron)
    
            # For checking purposes, we can output the cells as swc
            if output_dir is not None:
                if not os.path.exists(output_dir):
                    os.mkdir(output_dir)
                n.write(join(output_dir, basename(ref_cell)))
    
            if ref_persistence_diagram is not None:
                # Load with TMD and extract radial persistence
                n0 = tmd.io.load_neuron(out_neuron)
    
                actual_persistence_diagram = tmd.methods.get_persistence_diagram(
                    n0.apical_dendrite[0], feature=feature
                )
                if output_dir is not None:
                    with open(
                        join(output_dir, basename(ref_persistence_diagram)), "w", encoding="utf-8"
                    ) as f:
                        json.dump(actual_persistence_diagram, f, sort_keys=True, indent=2)
    
                with open(join(_path, ref_persistence_diagram), encoding="utf-8") as f:
                    expected_persistence_diagram = json.load(f)
                assert_close_persistent_diagram(
                    actual_persistence_diagram, expected_persistence_diagram
                )
>           assert not diff(out_neuron, join(_path, ref_cell))
E           AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f4a90a27910>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7f4a90a27910> = diff('/tmp/tmpljy3s0sotest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params2.h5')
E            +    where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params2.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params2.h5')

tests/test_neuron_functional.py:132: AssertionError

Check failure on line 32 in .tox/py311/lib/python3.11/site-packages/scipy/spatial/transform/tests/test_rotation.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_rotation.test_rotate_vector

AssertionError: 
Arrays are not almost equal to 6 decimals

Mismatched elements: 3 / 3 (100%)
Max absolute difference: 0.706011
Max relative difference: 2.40148781
 x: array([1., 1., 1.])
 y: array([0.293989, 1.240039, 1.172976])
Raw output
def test_rotate_vector():
>       assert_array_almost_equal(
            test_module.rotate_vector([1, 1, 1], [2, 3, 4], 2),
            [0.293989, 1.240039, 1.172976],
        )

tests/test_rotation.py:32: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/contextlib.py:81: in inner
    return func(*args, **kwds)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

args = (<function assert_array_almost_equal.<locals>.compare at 0x7fa89c27e160>, array([1., 1., 1.]), [0.293989, 1.240039, 1.172976])
kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 6 decimals', 'precision': 6, 'verbose': True}

    @wraps(func)
    def inner(*args, **kwds):
        with self._recreate_cm():
>           return func(*args, **kwds)
E           AssertionError: 
E           Arrays are not almost equal to 6 decimals
E           
E           Mismatched elements: 3 / 3 (100%)
E           Max absolute difference: 0.706011
E           Max relative difference: 2.40148781
E            x: array([1., 1., 1.])
E            y: array([0.293989, 1.240039, 1.172976])

/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/contextlib.py:81: AssertionError