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 228 in tests/test_algo.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

tests/test_algo.py.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: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dict1 = {'direction': array([0.57735027, 0.57735027, 0.57735027]), 'first_point': array([1.1, 0. , 0. ]), 'process': 'secondary', 'stop': {'TMD': <neurots.generate.algorithms.common.TMDStop object at 0x7f22d034ec70>}}
dict2 = {'direction': array([0.20348076, 0.54109933, 0.81597003]), 'first_point': [1.1, 0.0, 0.0], 'process': 'secondary', 'stop': {'TMD': <neurots.generate.algorithms.common.TMDStop object at 0x7f22d034e790>}}

    def _assert_dict_or_array(dict1, dict2):
        assert_equal(set(dict1.keys()), set(dict2.keys()))
        for key in dict1.keys():
            if isinstance(dict1[key], np.ndarray):
>               assert_array_almost_equal(dict1[key], dict2[key])
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 ])

tests/test_algo.py:79: AssertionError

Check failure on line 284 in tests/test_algo.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

tests/test_algo.py.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: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dict1 = {'direction': array([0.57735027, 0.57735027, 0.57735027]), 'first_point': array([1.1, 0. , 0. ]), 'process': 'major', 'stop': {'TMD': <neurots.generate.algorithms.common.TMDStop object at 0x7f12d37f80a0>}}
dict2 = {'direction': array([0.400454, 0.573604, 0.714573]), 'first_point': [1.1, 0.0, 0.0], 'process': 'major', 'stop': {'TMD': <neurots.generate.algorithms.common.TMDStop object at 0x7f12d381cc40>}}

    def _assert_dict_or_array(dict1, dict2):
        assert_equal(set(dict1.keys()), set(dict2.keys()))
        for key in dict1.keys():
            if isinstance(dict1[key], np.ndarray):
>               assert_array_almost_equal(dict1[key], dict2[key])
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])

tests/test_algo.py:79: AssertionError

Check failure on line 527 in tests/test_neuron_functional.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

tests/test_neuron_functional.py.test_default

AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f22d02f4610>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7f22d02f4610> = diff('/tmp/tmp34p5xkhmtest_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 0x7f22d02f4340>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/tmp/popen-gw3/test_default0')

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

tests/test_neuron_functional.py: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/min_versions/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 0x7f22d02f4610>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7f22d02f4610> = diff('/tmp/tmp34p5xkhmtest_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 619 in tests/test_neuron_functional.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

tests/test_neuron_functional.py.test_default

AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7fd1253c5730>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7fd1253c5730> = diff('/tmp/tmp2_4zozdftest_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 0x7fd125338d00>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/tmp/popen-gw1/test_default0')

    def test_default(self, tmpdir):
>       _test_full(
            "path_distances",
            "bio_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/min_versions/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 0x7fd1253c5730>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7fd1253c5730> = diff('/tmp/tmp2_4zozdftest_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 537 in tests/test_neuron_functional.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

tests/test_neuron_functional.py.test_with_rng

AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f22d02a59a0>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7f22d02a59a0> = diff('/tmp/tmpmgvbtrn8test_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 0x7f22d02a5b50>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/tmp/popen-gw3/test_with_rng0')

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

tests/test_neuron_functional.py: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 0x7F22D041B640, skip_preprocessing = False
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/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 0x7f22d02a59a0>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7f22d02a59a0> = diff('/tmp/tmpmgvbtrn8test_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 548 in tests/test_neuron_functional.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

tests/test_neuron_functional.py.test_skip_preprocessing

AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f22d0571070>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7f22d0571070> = diff('/tmp/tmppw2kdlr3test_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 0x7f22d00e4340>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/tmp/popen-gw3/test_skip_preprocessing0')

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

tests/test_neuron_functional.py: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/min_versions/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 0x7f22d0571070>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7f22d0571070> = diff('/tmp/tmppw2kdlr3test_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 24 in tests/test_morphmath_bifurcation.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

tests/test_morphmath_bifurcation.py.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])),
        )
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.]])

tests/test_morphmath_bifurcation.py:26: AssertionError

Check failure on line 46 in tests/test_morphmath_bifurcation.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

tests/test_morphmath_bifurcation.py.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)]),
            ),
        )
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]])

tests/test_morphmath_bifurcation.py:48: AssertionError

Check failure on line 60 in tests/test_morphmath_bifurcation.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

tests/test_morphmath_bifurcation.py.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]],
        )
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]])

tests/test_morphmath_bifurcation.py:62: AssertionError

Check failure on line 721 in tests/test_neuron_functional.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

tests/test_neuron_functional.py.test_with_rng

AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7fb4e7a2cdf0>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7fb4e7a2cdf0> = diff('/tmp/tmptra733z_test_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 0x7fb4e79acdc0>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/tmp/popen-gw2/test_with_rng0')

    def test_with_rng(self, tmpdir):
>       _test_full(
            "path_distances",
            "bio_rat_L5_TPC_B_distribution.json",
            "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 0x7FB4E88AE740, skip_preprocessing = False
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/tmp/popen-gw2/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 0x7fb4e7a2cdf0>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7fb4e7a2cdf0> = diff('/tmp/tmptra733z_test_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 629 in tests/test_neuron_functional.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

tests/test_neuron_functional.py.test_with_rng

AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7fd124e4ecd0>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7fd124e4ecd0> = diff('/tmp/tmp4p1w7rcjtest_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 0x7fd1252cbd00>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/tmp/popen-gw1/test_with_rng0')

    def test_with_rng(self, tmpdir):
>       _test_full(
            "path_distances",
            "bio_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 0x7FD12545B740, skip_preprocessing = False
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/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 0x7fd124e4ecd0>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7fd124e4ecd0> = diff('/tmp/tmp4p1w7rcjtest_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 559 in tests/test_neuron_functional.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

tests/test_neuron_functional.py.test_skip_rng_and_preprocessing

AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f22d00e4280>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7f22d00e4280> = diff('/tmp/tmprrquqw9utest_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 0x7f22d00a4160>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/tmp/popen-gw3/test_skip_rng_and_preprocessin0')

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

tests/test_neuron_functional.py: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 0x7F22D041B340, skip_preprocessing = True
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/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 0x7f22d00e4280>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7f22d00e4280> = diff('/tmp/tmprrquqw9utest_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 573 in tests/test_neuron_functional.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

tests/test_neuron_functional.py.test_default

AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f22d0084f10>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7f22d0084f10> = diff('/tmp/tmp73aapa6otest_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 0x7f22d00812b0>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/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/min_versions/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 0x7f22d0084f10>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7f22d0084f10> = diff('/tmp/tmp73aapa6otest_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 732 in tests/test_neuron_functional.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

tests/test_neuron_functional.py.test_skip_preprocessing

AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7fb4e7af1970>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7fb4e7af1970> = diff('/tmp/tmp5gs059rytest_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 0x7fb4e77882e0>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/tmp/popen-gw2/test_skip_preprocessing0')

    def test_skip_preprocessing(self, tmpdir):
>       _test_full(
            "path_distances",
            "bio_rat_L5_TPC_B_distribution.json",
            "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/min_versions/tmp/popen-gw2/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 0x7fb4e7af1970>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7fb4e7af1970> = diff('/tmp/tmp5gs059rytest_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 640 in tests/test_neuron_functional.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

tests/test_neuron_functional.py.test_skip_preprocessing

AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7fd124ee5c10>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7fd124ee5c10> = diff('/tmp/tmp7qpq3pdrtest_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 0x7fd1250a17c0>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/tmp/popen-gw1/test_skip_preprocessing0')

    def test_skip_preprocessing(self, tmpdir):
>       _test_full(
            "path_distances",
            "bio_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/min_versions/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 0x7fd124ee5c10>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7fd124ee5c10> = diff('/tmp/tmp7qpq3pdrtest_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 583 in tests/test_neuron_functional.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

tests/test_neuron_functional.py.test_with_rng

AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f22d051d250>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7f22d051d250> = diff('/tmp/tmpb4yrbc5ttest_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 0x7f22d006d700>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/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 0x7F22D041BC40, skip_preprocessing = False
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/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 0x7f22d051d250>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7f22d051d250> = diff('/tmp/tmpb4yrbc5ttest_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 743 in tests/test_neuron_functional.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

tests/test_neuron_functional.py.test_skip_rng_and_preprocessing

AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7fb4e7545f70>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7fb4e7545f70> = diff('/tmp/tmplvkafgoptest_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 0x7fb4e7545c70>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/tmp/popen-gw2/test_skip_rng_and_preprocessin0')

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

tests/test_neuron_functional.py:745: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

feature = 'path_distances'
distributions = {'apical_dendrite': {'filtration_metric': 'path_distances', 'min_bar_length': 1.0, 'num_trees': {'data': {'bins': [1],....4106653615432989, 0.5277795547616266, -0.18579814237229897], ...], ...], ...}, 'diameter': {'method': 'uniform'}, ...}
parameters = 'params4_orientation_manager.json'
ref_cell = 'expected_bio_rat_L5_TPC_B_with_params4.h5'
ref_persistence_diagram = 'expected_bio_rat_L5_TPC_B_with_params4_persistence_diagram.json'
rng_or_seed = RandomState(MT19937) at 0x7FB4DC74A840, skip_preprocessing = True
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/tmp/popen-gw2/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 0x7fb4e7545f70>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7fb4e7545f70> = diff('/tmp/tmplvkafgoptest_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 284 in tests/test_neuron_functional.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

tests/test_neuron_functional.py.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,
        )
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])

tests/test_neuron_functional.py:297: AssertionError

Check failure on line 651 in tests/test_neuron_functional.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

tests/test_neuron_functional.py.test_skip_rng_and_preprocessing

AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7fd124efba30>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7fd124efba30> = diff('/tmp/tmp7ttgeugatest_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 0x7fd124edceb0>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/tmp/popen-gw1/test_skip_rng_and_preprocessin0')

    def test_skip_rng_and_preprocessing(self, tmpdir):
>       _test_full(
            "path_distances",
            "bio_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 0x7FD12545B840, skip_preprocessing = True
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/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 0x7fd124efba30>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7fd124efba30> = diff('/tmp/tmp7ttgeugatest_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 457 in tests/test_neuron_functional.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

tests/test_neuron_functional.py.test_default

AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f12d3779d00>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7f12d3779d00> = diff('/tmp/tmp_mn0lb3mtest_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 0x7f12d3763d30>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/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/min_versions/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 0x7f12d3779d00>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7f12d3779d00> = diff('/tmp/tmp_mn0lb3mtest_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 594 in tests/test_neuron_functional.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

tests/test_neuron_functional.py.test_skip_preprocessing

AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f22d00479a0>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7f22d00479a0> = diff('/tmp/tmp5xxr0z1ltest_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 0x7f22d04bf670>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/tmp/popen-gw3/test_skip_preprocessing1')

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

tests/test_neuron_functional.py:596: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

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 = None, skip_preprocessing = True
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/tmp/popen-gw3/test_skip_preprocessing1')

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

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

tests/test_neuron_functional.py.test_with_rng

AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7f12d37571c0>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7f12d37571c0> = diff('/tmp/tmpojx6_kq_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 0x7f12d343e2b0>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/tmp/popen-gw0/test_with_rng0')

    def test_with_rng(self, tmpdir):
>       _test_full(
            "path_distances",
            "bio_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 0x7F12CA5A1A40, skip_preprocessing = False
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/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 0x7f12d37571c0>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7f12d37571c0> = diff('/tmp/tmpojx6_kq_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 30 in tests/test_rotation.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

tests/test_rotation.py.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],
        )
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])

tests/test_rotation.py:32: AssertionError

Check failure on line 436 in tests/test_soma_grower.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

tests/test_soma_grower.py.test_soma_grower

AssertionError: 
Arrays are not almost equal to 6 decimals

Mismatched elements: 30 / 33 (90.9%)
Max absolute difference: 2.5715265
Max relative difference: 0.26042482
 x: array([[ -1.44443 ,  -8.843385,  14.457643],
       [ -1.693793,  -9.399601,  15.327622],
       [ -1.843625, -10.025176,  16.045628],...
 y: array([[ -1.44443 ,  -8.843385,  14.457643],
       [ -1.742285,  -9.295837,  15.371422],
       [ -1.963416,  -9.790936,  16.168482],...
Raw output
def test_soma_grower():
        # pylint: disable=no-member
        # pylint: disable=unsubscriptable-object
        np.random.seed(0)
        with open(os.path.join(_path, "dummy_distribution.json"), encoding="utf-8") as f:
            distributions = json.load(f)
    
        with open(os.path.join(_path, "dummy_params.json"), encoding="utf-8") as f:
            params = json.load(f)
    
        grower = NeuronGrower(input_distributions=distributions, input_parameters=params).grow()
        expected = morphio.Morphology(os.path.join(_path, "dummy_neuron.asc"))
    
        assert_array_almost_equal(grower.soma.points, expected.soma.points)
        assert_array_almost_equal(grower.root_sections[0].points, expected.root_sections[0].points)
        for sec_actual, sec_expected in zip(grower.iter(), expected.iter()):
>           assert_array_almost_equal(sec_actual.points, sec_expected.points)
E           AssertionError: 
E           Arrays are not almost equal to 6 decimals
E           
E           Mismatched elements: 30 / 33 (90.9%)
E           Max absolute difference: 2.5715265
E           Max relative difference: 0.26042482
E            x: array([[ -1.44443 ,  -8.843385,  14.457643],
E                  [ -1.693793,  -9.399601,  15.327622],
E                  [ -1.843625, -10.025176,  16.045628],...
E            y: array([[ -1.44443 ,  -8.843385,  14.457643],
E                  [ -1.742285,  -9.295837,  15.371422],
E                  [ -1.963416,  -9.790936,  16.168482],...

tests/test_soma_grower.py:453: AssertionError

Check failure on line 665 in tests/test_neuron_functional.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

tests/test_neuron_functional.py.test_default

AssertionError: assert not <morph_tool.morphio_diff.DiffResult object at 0x7fd12536ac70>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7fd12536ac70> = diff('/tmp/tmp2ylshzvstest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params3.h5')
 +    where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params3.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params3.h5')
Raw output
self = <tests.test_neuron_functional.TestBioRatL5Tpc3 object at 0x7fd124e08dc0>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/tmp/popen-gw1/test_default1')

    def test_default(self, tmpdir):
>       _test_full(
            "path_distances",
            "bio_rat_L5_TPC_B_distribution.json",
            "params3.json",
            "expected_bio_rat_L5_TPC_B_with_params3.h5",
            "expected_bio_rat_L5_TPC_B_with_params3_persistence_diagram.json",
            output_dir=tmpdir,
        )

tests/test_neuron_functional.py:667: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

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 = 'params3.json'
ref_cell = 'expected_bio_rat_L5_TPC_B_with_params3.h5'
ref_persistence_diagram = 'expected_bio_rat_L5_TPC_B_with_params3_persistence_diagram.json'
rng_or_seed = None, skip_preprocessing = False
output_dir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/tmp/popen-gw1/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 0x7fd12536ac70>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7fd12536ac70> = diff('/tmp/tmp2ylshzvstest_grower/test_output_neuron_.h5', '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params3.h5')
E            +    where '/home/runner/work/NeuroTS/NeuroTS/tests/data/expected_bio_rat_L5_TPC_B_with_params3.h5' = join('/home/runner/work/NeuroTS/NeuroTS/tests/data', 'expected_bio_rat_L5_TPC_B_with_params3.h5')

tests/test_neuron_functional.py:132: AssertionError