Skip to content

Fix: Better first_point fix #607

Fix: Better first_point fix

Fix: Better first_point fix #607

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

221 tests run, 192 passed, 0 skipped, 29 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 0x7fedf3504cd0>}}
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 0x7fedf3504880>}}

    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 0x7f57fd3f60d0>}}
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 0x7f57fd41cac0>}}

    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 0x7fedf361a850>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7fedf361a850> = diff('/tmp/tmpgjp1eczotest_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 0x7fedf34b6b80>
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 0x7fedf361a850>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7fedf361a850> = diff('/tmp/tmpgjp1eczotest_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 0x7f28b13f49d0>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7f28b13f49d0> = diff('/tmp/tmpisajdbgttest_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 0x7f28b12e0520>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/tmp/popen-gw2/test_default0')

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

tests/test_neuron_functional.py: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-gw2/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 0x7f28b13f49d0>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7f28b13f49d0> = diff('/tmp/tmpisajdbgttest_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 0x7fedf361a400>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7fedf361a400> = diff('/tmp/tmpkmagba3gtest_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 0x7fedf3453040>
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 0x7FEDF35EA540, 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 0x7fedf361a400>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7fedf361a400> = diff('/tmp/tmpkmagba3gtest_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 0x7fedf34546d0>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7fedf34546d0> = diff('/tmp/tmpu6lcf2a1test_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 0x7fedf34542e0>
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 0x7fedf34546d0>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7fedf34546d0> = diff('/tmp/tmpu6lcf2a1test_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 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 0x7f668b786730>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7f668b786730> = diff('/tmp/tmpxac_w97itest_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 0x7f668bd6d2e0>
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",
            "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 0x7F668BE5CC40, 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 0x7f668b786730>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7f668b786730> = diff('/tmp/tmpxac_w97itest_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 0x7f28b0e73f40>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7f28b0e73f40> = diff('/tmp/tmphdd5hdovtest_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 0x7f28b0e73d90>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/tmp/popen-gw2/test_with_rng0')

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

tests/test_neuron_functional.py: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 0x7F28B14BB840, 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 0x7f28b0e73f40>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7f28b0e73f40> = diff('/tmp/tmphdd5hdovtest_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 0x7fedf347a5e0>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7fedf347a5e0> = diff('/tmp/tmp8j0fu1e6test_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 0x7fedf347a7f0>
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 0x7FEDF35EA940, 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 0x7fedf347a5e0>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7fedf347a5e0> = diff('/tmp/tmp8j0fu1e6test_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 0x7fedf33b2580>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7fedf33b2580> = diff('/tmp/tmpfbp1jjyntest_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 0x7fedf3462e80>
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 0x7fedf33b2580>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7fedf33b2580> = diff('/tmp/tmpfbp1jjyntest_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 0x7f668bd7cdf0>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7f668bd7cdf0> = diff('/tmp/tmpg5bc831atest_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 0x7f668b91a2b0>
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",
            "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-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 0x7f668bd7cdf0>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7f668bd7cdf0> = diff('/tmp/tmpg5bc831atest_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 0x7f28b0e73be0>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7f28b0e73be0> = diff('/tmp/tmpuhn5uizntest_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 0x7f28b0e47670>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/tmp/popen-gw2/test_skip_preprocessing0')

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

tests/test_neuron_functional.py: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-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 0x7f28b0e73be0>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7f28b0e73be0> = diff('/tmp/tmpuhn5uizntest_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 0x7fedf3567df0>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7fedf3567df0> = diff('/tmp/tmputrml713test_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 0x7fedf33967c0>
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 0x7FEDF35EAC40, 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 0x7fedf3567df0>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7fedf3567df0> = diff('/tmp/tmputrml713test_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 0x7f668bd36f40>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7f668bd36f40> = diff('/tmp/tmpy1rbn7lytest_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 0x7f668bd50190>
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",
            "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 0x7F668CC70740, 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 0x7f668bd36f40>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7f668bd36f40> = diff('/tmp/tmpy1rbn7lytest_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: 43.76776957
Max relative difference: 1.61248272
 x: array([11.60786, 89.85161, -9.43781], dtype=float32)
 y: array([55.37563, 63.32176, -3.61258])
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,
        )
>       assert_array_almost_equal(
            n.sections[30].points[-1], np.array([55.375633, 63.321762, -3.612582]), decimal=5
        )
E       AssertionError: 
E       Arrays are not almost equal to 5 decimals
E       
E       Mismatched elements: 3 / 3 (100%)
E       Max absolute difference: 43.76776957
E       Max relative difference: 1.61248272
E        x: array([11.60786, 89.85161, -9.43781], dtype=float32)
E        y: array([55.37563, 63.32176, -3.61258])

tests/test_neuron_functional.py:302: 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 0x7f28b1470550>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7f28b1470550> = diff('/tmp/tmplyx8or_utest_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 0x7f28b0e4b310>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/tmp/popen-gw2/test_skip_rng_and_preprocessin0')

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

tests/test_neuron_functional.py: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 0x7F28B14BB540, 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 0x7f28b1470550>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7f28b1470550> = diff('/tmp/tmplyx8or_utest_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 0x7f57fd5304c0>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7f57fd5304c0> = diff('/tmp/tmpplye4y9utest_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 0x7f57fd3211f0>
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 0x7f57fd5304c0>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7f57fd5304c0> = diff('/tmp/tmpplye4y9utest_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 0x7fedf34b8b50>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7fedf34b8b50> = diff('/tmp/tmpevqgev3xtest_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 0x7fedf34b8760>
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 0x7fedf34b8b50>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7fedf34b8b50> = diff('/tmp/tmpevqgev3xtest_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 0x7f57fd29bf40>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7f57fd29bf40> = diff('/tmp/tmpq96_h4i0test_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 0x7f57fd26d2e0>
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 0x7F57F475FA40, 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 0x7f57fd29bf40>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7f57fd29bf40> = diff('/tmp/tmpq96_h4i0test_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 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: 489 / 492 (99.4%)
Max absolute difference: 186.62946
Max relative difference: 4.2926846
 x: array([[ 5.195270e+00,  7.041611e+01,  3.315341e+00],
       [ 5.170112e+00,  7.071500e+01,  3.239163e+00],
       [ 5.038309e+00,  7.147916e+01,  3.080816e+00],...
 y: array([[  5.19527 ,  70.41611 ,   3.315341],
       [  5.214483,  70.71144 ,   3.224864],
       [  5.240782,  71.47416 ,   3.015216],...
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: 489 / 492 (99.4%)
E           Max absolute difference: 186.62946
E           Max relative difference: 4.2926846
E            x: array([[ 5.195270e+00,  7.041611e+01,  3.315341e+00],
E                  [ 5.170112e+00,  7.071500e+01,  3.239163e+00],
E                  [ 5.038309e+00,  7.147916e+01,  3.080816e+00],...
E            y: array([[  5.19527 ,  70.41611 ,   3.315341],
E                  [  5.214483,  70.71144 ,   3.224864],
E                  [  5.240782,  71.47416 ,   3.015216],...

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 0x7f28b122bb20>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7f28b122bb20> = diff('/tmp/tmpapf9ll1ptest_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 0x7f28b13acd60>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/tmp/popen-gw2/test_default1')

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

tests/test_neuron_functional.py: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-gw2/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 0x7f28b122bb20>
E            +  where <morph_tool.morphio_diff.DiffResult object at 0x7f28b122bb20> = diff('/tmp/tmpapf9ll1ptest_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

Check failure on line 478 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 0x7f57fd3532e0>
 +  where <morph_tool.morphio_diff.DiffResult object at 0x7f57fd3532e0> = diff('/tmp/tmp94n4yt2utest_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 0x7f57fd34e220>
tmpdir = local('/home/runner/work/NeuroTS/NeuroTS/.tox/min_versions/tmp/popen-gw0/test_skip_preprocessing0')

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

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

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

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

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

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

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

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

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

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

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

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