Skip to content

Feat: Add boundary context #38

Feat: Add boundary context

Feat: Add boundary context #38

GitHub Actions / JUnit Test Report failed Dec 4, 2024 in 0s

90 tests run, 74 passed, 0 skipped, 16 failed.

Annotations

Check failure on line 1 in TestCli

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

TestCli.test_synthesize_morphologies

AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
Raw output
>   old_axon = find_axon(neuron)

.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:128: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   raise NoAxonException('No axon found!')
E   morph_tool.exceptions.NoAxonException: No axon found!

.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:33: NoAxonException

During handling of the above exception, another exception occurred:

self = <tests.test_cli.TestCli object at 0x7fa02703e3d0>
tmpdir = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_morphologies0')
cli_runner = <click.testing.CliRunner object at 0x7fa026fdcbe0>
small_O1_path = '/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/atlas_small_O10'
input_cells = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_morphologies0/input_cells.mvd3')
axon_morph_tsv = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_morphologies0/axon_morphs.tsv')

    def test_synthesize_morphologies(
        self, tmpdir, cli_runner, small_O1_path, input_cells, axon_morph_tsv
    ):
        """Synthesize the morphologies."""
        # fmt: off
>       result = cli_runner.invoke(
            main,
            [
                "synthesize-morphologies",
                "--input-cells", str(input_cells),
                "--tmd-parameters", str(DATA / "parameters.json"),
                "--tmd-distributions", str(DATA / "distributions.json"),
                "--morph-axon", str(axon_morph_tsv),
                "--base-morph-dir", str(DATA / "input-cells"),
                "--atlas", str(small_O1_path),
                "--seed", 0,
                "--out-cells", str(tmpdir / "test_cells.mvd3"),
                "--out-apical", str(tmpdir / "apical.yaml"),
                "--out-apical-nrn-sections", str(tmpdir / "apical_NRN_sections.yaml"),
                "--out-morph-dir", str(tmpdir),
                "--out-debug-data", str(tmpdir / "debug_data.pkl"),
                "--overwrite",
                "--out-morph-ext", "h5",
                "--out-morph-ext", "swc",
                "--out-morph-ext", "asc",
                "--max-drop-ratio", 0.5,
                "--scaling-jitter-std", 0.5,
                "--rotational-jitter-std", 10,
                "--nb-processes", 2,
                "--region-structure", str(DATA / "region_structure.yaml"),
            ],
            catch_exceptions=False,
        )

tests/test_cli.py:149: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.tox/min_versions/lib/python3.9/site-packages/click/testing.py:408: in invoke
    return_value = cli.main(args=args or (), prog_name=prog_name, **extra)
.tox/min_versions/lib/python3.9/site-packages/click/core.py:1059: in main
    rv = self.invoke(ctx)
.tox/min_versions/lib/python3.9/site-packages/click/core.py:1665: in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
.tox/min_versions/lib/python3.9/site-packages/click/core.py:1401: in invoke
    return ctx.invoke(self.callback, **ctx.params)
.tox/min_versions/lib/python3.9/site-packages/click/core.py:767: in invoke
    return __callback(*args, **kwargs)
region_grower/cli.py:339: in synthesize_morphologies
    SynthesizeMorphologies(**kwargs).synthesize()
region_grower/synthesize_morphologies.py:802: in synthesize
    res = self.compute()
region_grower/synthesize_morphologies.py:701: in compute
    computed = future.compute()
.tox/min_versions/lib/python3.9/site-packages/dask/base.py:314: in compute
    (result,) = compute(self, traverse=False, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/dask/base.py:599: in compute
    results = schedule(dsk, keys, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/distributed/client.py:3186: in get
    results = self.gather(packed, asynchronous=asynchronous, direct=direct)
.tox/min_versions/lib/python3.9/site-packages/distributed/client.py:2345: in gather
    return self.sync(
.tox/min_versions/lib/python3.9/site-packages/distributed/utils.py:349: in sync
    return sync(
.tox/min_versions/lib/python3.9/site-packages/distributed/utils.py:416: in sync
    raise exc.with_traceback(tb)
.tox/min_versions/lib/python3.9/site-packages/distributed/utils.py:389: in f
    result = yield future
.tox/min_versions/lib/python3.9/site-packages/tornado/gen.py:766: in run
    value = future.result()
.tox/min_versions/lib/python3.9/site-packages/distributed/client.py:2208: in _gather
    raise exception.with_traceback(traceback)
.tox/min_versions/lib/python3.9/site-packages/dask/optimization.py:990: in __call__
    return core.get(self.dsk, self.outkey, dict(zip(self.inkeys, args)))
.tox/min_versions/lib/python3.9/site-packages/dask/core.py:149: in get
    result = _execute_task(task, cache)
.tox/min_versions/lib/python3.9/site-packages/dask/core.py:119: in _execute_task
    return func(*(_execute_task(a, cache) for a in args))
.tox/min_versions/lib/python3.9/site-packages/dask/utils.py:73: in apply
    return func(*args, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/dask/dataframe/core.py:7006: in apply_and_enforce
    df = func(*args, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/dask/utils.py:1105: in __call__
    return getattr(__obj, self.method)(*args, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/pandas/core/frame.py:10037: in apply
    return op.apply().__finalize__(self, method="apply")
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:831: in apply
    return self.apply_standard()
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:957: in apply_standard
    results, res_index = self.apply_series_generator()
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:973: in apply_series_generator
    results[i] = self.func(v, *self.args, **self.kwargs)
region_grower/synthesize_morphologies.py:182: in _parallel_wrapper
    new_cell = space_worker.synthesize()
region_grower/context.py:560: in synthesize
    return self._synthesize_once(rng)
region_grower/context.py:645: in _synthesize_once
    graft_axon(grower.neuron, axon_morph, rng=rng)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:158: in graft_axon
    position = grafting_position(neuron, axon_or_donor_neuron, rng)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:131: in grafting_position
    axon_direction = _random_direction(axis=_dendrites_mean_direction(neuron),
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:90: in _random_direction
    orthogonal = _rotate_vector(orthogonal, axis, rng.uniform(low=0., high=2. * np.pi))
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:80: in _rotate_vector
    return np.dot(_rotation_around_axis(axis, angle), vec)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:61: in _rotation_around_axis
    d = np.array(axis, dtype=np.float) / np.linalg.norm(axis)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   raise AttributeError(__former_attrs__[attr])
E   AttributeError: module 'numpy' has no attribute 'float'.
E   `np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
E   The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
E       https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

.tox/min_versions/lib/python3.9/site-packages/numpy/__init__.py:324: AttributeError

Check failure on line 139 in tests/test_synthesize_morphologies.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_synthesize_morphologies.test_synthesize[True-True-25]

AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
Raw output
>   old_axon = find_axon(neuron)

.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:128: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   raise NoAxonException('No axon found!')
E   morph_tool.exceptions.NoAxonException: No axon found!

.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:33: NoAxonException

During handling of the above exception, another exception occurred:

tmpdir = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_True_True_25_0')
small_O1_path = '/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/atlas_small_O10'
input_cells = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_True_True_25_0/input_cells.mvd3')
axon_morph_tsv = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_True_True_25_0/axon_morphs.tsv')
with_axon = True, with_NRN = True, min_depth = 25

    @pytest.mark.parametrize("min_depth", [25, 800])
    @pytest.mark.parametrize("with_axon", [True, False])
    @pytest.mark.parametrize("with_NRN", [True, False])
    def test_synthesize(
        tmpdir,
        small_O1_path,
        input_cells,
        axon_morph_tsv,
        with_axon,
        with_NRN,
        min_depth,
    ):  # pylint: disable=unused-argument
        """Test morphology synthesis."""
        tmp_folder = Path(tmpdir)
    
        args = create_args(
            False,
            tmp_folder,
            input_cells,
            small_O1_path,
            axon_morph_tsv if with_axon else None,
            "apical_NRN_sections.yaml" if with_NRN else None,
            min_depth,
            DATA / "region_structure.yaml",
        )
    
        synthesizer = SynthesizeMorphologies(**args)
>       synthesizer.synthesize()

tests/test_synthesize_morphologies.py:139: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
region_grower/synthesize_morphologies.py:802: in synthesize
    res = self.compute()
region_grower/synthesize_morphologies.py:701: in compute
    computed = future.compute()
.tox/min_versions/lib/python3.9/site-packages/dask/base.py:314: in compute
    (result,) = compute(self, traverse=False, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/dask/base.py:599: in compute
    results = schedule(dsk, keys, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/distributed/client.py:3186: in get
    results = self.gather(packed, asynchronous=asynchronous, direct=direct)
.tox/min_versions/lib/python3.9/site-packages/distributed/client.py:2345: in gather
    return self.sync(
.tox/min_versions/lib/python3.9/site-packages/distributed/utils.py:349: in sync
    return sync(
.tox/min_versions/lib/python3.9/site-packages/distributed/utils.py:416: in sync
    raise exc.with_traceback(tb)
.tox/min_versions/lib/python3.9/site-packages/distributed/utils.py:389: in f
    result = yield future
.tox/min_versions/lib/python3.9/site-packages/tornado/gen.py:766: in run
    value = future.result()
.tox/min_versions/lib/python3.9/site-packages/distributed/client.py:2208: in _gather
    raise exception.with_traceback(traceback)
.tox/min_versions/lib/python3.9/site-packages/dask/optimization.py:990: in __call__
    return core.get(self.dsk, self.outkey, dict(zip(self.inkeys, args)))
.tox/min_versions/lib/python3.9/site-packages/dask/core.py:149: in get
    result = _execute_task(task, cache)
.tox/min_versions/lib/python3.9/site-packages/dask/core.py:119: in _execute_task
    return func(*(_execute_task(a, cache) for a in args))
.tox/min_versions/lib/python3.9/site-packages/dask/utils.py:73: in apply
    return func(*args, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/dask/dataframe/core.py:7006: in apply_and_enforce
    df = func(*args, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/dask/utils.py:1105: in __call__
    return getattr(__obj, self.method)(*args, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/pandas/core/frame.py:10037: in apply
    return op.apply().__finalize__(self, method="apply")
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:831: in apply
    return self.apply_standard()
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:957: in apply_standard
    results, res_index = self.apply_series_generator()
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:973: in apply_series_generator
    results[i] = self.func(v, *self.args, **self.kwargs)
region_grower/synthesize_morphologies.py:182: in _parallel_wrapper
    new_cell = space_worker.synthesize()
region_grower/context.py:560: in synthesize
    return self._synthesize_once(rng)
region_grower/context.py:645: in _synthesize_once
    graft_axon(grower.neuron, axon_morph, rng=rng)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:158: in graft_axon
    position = grafting_position(neuron, axon_or_donor_neuron, rng)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:131: in grafting_position
    axon_direction = _random_direction(axis=_dendrites_mean_direction(neuron),
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:90: in _random_direction
    orthogonal = _rotate_vector(orthogonal, axis, rng.uniform(low=0., high=2. * np.pi))
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:80: in _rotate_vector
    return np.dot(_rotation_around_axis(axis, angle), vec)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:61: in _rotation_around_axis
    d = np.array(axis, dtype=np.float) / np.linalg.norm(axis)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   raise AttributeError(__former_attrs__[attr])
E   AttributeError: module 'numpy' has no attribute 'float'.
E   `np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
E   The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
E       https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

.tox/min_versions/lib/python3.9/site-packages/numpy/__init__.py:324: AttributeError

Check failure on line 139 in tests/test_synthesize_morphologies.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_synthesize_morphologies.test_synthesize[True-True-800]

AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
Raw output
>   old_axon = find_axon(neuron)

.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:128: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   raise NoAxonException('No axon found!')
E   morph_tool.exceptions.NoAxonException: No axon found!

.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:33: NoAxonException

During handling of the above exception, another exception occurred:

tmpdir = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_True_True_800_0')
small_O1_path = '/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/atlas_small_O10'
input_cells = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_True_True_800_0/input_cells.mvd3')
axon_morph_tsv = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_True_True_800_0/axon_morphs.tsv')
with_axon = True, with_NRN = True, min_depth = 800

    @pytest.mark.parametrize("min_depth", [25, 800])
    @pytest.mark.parametrize("with_axon", [True, False])
    @pytest.mark.parametrize("with_NRN", [True, False])
    def test_synthesize(
        tmpdir,
        small_O1_path,
        input_cells,
        axon_morph_tsv,
        with_axon,
        with_NRN,
        min_depth,
    ):  # pylint: disable=unused-argument
        """Test morphology synthesis."""
        tmp_folder = Path(tmpdir)
    
        args = create_args(
            False,
            tmp_folder,
            input_cells,
            small_O1_path,
            axon_morph_tsv if with_axon else None,
            "apical_NRN_sections.yaml" if with_NRN else None,
            min_depth,
            DATA / "region_structure.yaml",
        )
    
        synthesizer = SynthesizeMorphologies(**args)
>       synthesizer.synthesize()

tests/test_synthesize_morphologies.py:139: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
region_grower/synthesize_morphologies.py:802: in synthesize
    res = self.compute()
region_grower/synthesize_morphologies.py:701: in compute
    computed = future.compute()
.tox/min_versions/lib/python3.9/site-packages/dask/base.py:314: in compute
    (result,) = compute(self, traverse=False, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/dask/base.py:599: in compute
    results = schedule(dsk, keys, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/distributed/client.py:3186: in get
    results = self.gather(packed, asynchronous=asynchronous, direct=direct)
.tox/min_versions/lib/python3.9/site-packages/distributed/client.py:2345: in gather
    return self.sync(
.tox/min_versions/lib/python3.9/site-packages/distributed/utils.py:349: in sync
    return sync(
.tox/min_versions/lib/python3.9/site-packages/distributed/utils.py:416: in sync
    raise exc.with_traceback(tb)
.tox/min_versions/lib/python3.9/site-packages/distributed/utils.py:389: in f
    result = yield future
.tox/min_versions/lib/python3.9/site-packages/tornado/gen.py:766: in run
    value = future.result()
.tox/min_versions/lib/python3.9/site-packages/distributed/client.py:2208: in _gather
    raise exception.with_traceback(traceback)
.tox/min_versions/lib/python3.9/site-packages/dask/optimization.py:990: in __call__
    return core.get(self.dsk, self.outkey, dict(zip(self.inkeys, args)))
.tox/min_versions/lib/python3.9/site-packages/dask/core.py:149: in get
    result = _execute_task(task, cache)
.tox/min_versions/lib/python3.9/site-packages/dask/core.py:119: in _execute_task
    return func(*(_execute_task(a, cache) for a in args))
.tox/min_versions/lib/python3.9/site-packages/dask/utils.py:73: in apply
    return func(*args, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/dask/dataframe/core.py:7006: in apply_and_enforce
    df = func(*args, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/dask/utils.py:1105: in __call__
    return getattr(__obj, self.method)(*args, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/pandas/core/frame.py:10037: in apply
    return op.apply().__finalize__(self, method="apply")
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:831: in apply
    return self.apply_standard()
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:957: in apply_standard
    results, res_index = self.apply_series_generator()
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:973: in apply_series_generator
    results[i] = self.func(v, *self.args, **self.kwargs)
region_grower/synthesize_morphologies.py:182: in _parallel_wrapper
    new_cell = space_worker.synthesize()
region_grower/context.py:560: in synthesize
    return self._synthesize_once(rng)
region_grower/context.py:645: in _synthesize_once
    graft_axon(grower.neuron, axon_morph, rng=rng)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:158: in graft_axon
    position = grafting_position(neuron, axon_or_donor_neuron, rng)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:131: in grafting_position
    axon_direction = _random_direction(axis=_dendrites_mean_direction(neuron),
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:90: in _random_direction
    orthogonal = _rotate_vector(orthogonal, axis, rng.uniform(low=0., high=2. * np.pi))
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:80: in _rotate_vector
    return np.dot(_rotation_around_axis(axis, angle), vec)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:61: in _rotation_around_axis
    d = np.array(axis, dtype=np.float) / np.linalg.norm(axis)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   raise AttributeError(__former_attrs__[attr])
E   AttributeError: module 'numpy' has no attribute 'float'.
E   `np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
E   The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
E       https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

.tox/min_versions/lib/python3.9/site-packages/numpy/__init__.py:324: AttributeError

Check failure on line 139 in tests/test_synthesize_morphologies.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_synthesize_morphologies.test_synthesize[False-True-25]

AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
Raw output
>   old_axon = find_axon(neuron)

.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:128: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   raise NoAxonException('No axon found!')
E   morph_tool.exceptions.NoAxonException: No axon found!

.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:33: NoAxonException

During handling of the above exception, another exception occurred:

tmpdir = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_False_True_25_0')
small_O1_path = '/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/atlas_small_O10'
input_cells = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_False_True_25_0/input_cells.mvd3')
axon_morph_tsv = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_False_True_25_0/axon_morphs.tsv')
with_axon = True, with_NRN = False, min_depth = 25

    @pytest.mark.parametrize("min_depth", [25, 800])
    @pytest.mark.parametrize("with_axon", [True, False])
    @pytest.mark.parametrize("with_NRN", [True, False])
    def test_synthesize(
        tmpdir,
        small_O1_path,
        input_cells,
        axon_morph_tsv,
        with_axon,
        with_NRN,
        min_depth,
    ):  # pylint: disable=unused-argument
        """Test morphology synthesis."""
        tmp_folder = Path(tmpdir)
    
        args = create_args(
            False,
            tmp_folder,
            input_cells,
            small_O1_path,
            axon_morph_tsv if with_axon else None,
            "apical_NRN_sections.yaml" if with_NRN else None,
            min_depth,
            DATA / "region_structure.yaml",
        )
    
        synthesizer = SynthesizeMorphologies(**args)
>       synthesizer.synthesize()

tests/test_synthesize_morphologies.py:139: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
region_grower/synthesize_morphologies.py:802: in synthesize
    res = self.compute()
region_grower/synthesize_morphologies.py:701: in compute
    computed = future.compute()
.tox/min_versions/lib/python3.9/site-packages/dask/base.py:314: in compute
    (result,) = compute(self, traverse=False, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/dask/base.py:599: in compute
    results = schedule(dsk, keys, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/distributed/client.py:3186: in get
    results = self.gather(packed, asynchronous=asynchronous, direct=direct)
.tox/min_versions/lib/python3.9/site-packages/distributed/client.py:2345: in gather
    return self.sync(
.tox/min_versions/lib/python3.9/site-packages/distributed/utils.py:349: in sync
    return sync(
.tox/min_versions/lib/python3.9/site-packages/distributed/utils.py:416: in sync
    raise exc.with_traceback(tb)
.tox/min_versions/lib/python3.9/site-packages/distributed/utils.py:389: in f
    result = yield future
.tox/min_versions/lib/python3.9/site-packages/tornado/gen.py:766: in run
    value = future.result()
.tox/min_versions/lib/python3.9/site-packages/distributed/client.py:2208: in _gather
    raise exception.with_traceback(traceback)
.tox/min_versions/lib/python3.9/site-packages/dask/optimization.py:990: in __call__
    return core.get(self.dsk, self.outkey, dict(zip(self.inkeys, args)))
.tox/min_versions/lib/python3.9/site-packages/dask/core.py:149: in get
    result = _execute_task(task, cache)
.tox/min_versions/lib/python3.9/site-packages/dask/core.py:119: in _execute_task
    return func(*(_execute_task(a, cache) for a in args))
.tox/min_versions/lib/python3.9/site-packages/dask/utils.py:73: in apply
    return func(*args, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/dask/dataframe/core.py:7006: in apply_and_enforce
    df = func(*args, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/dask/utils.py:1105: in __call__
    return getattr(__obj, self.method)(*args, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/pandas/core/frame.py:10037: in apply
    return op.apply().__finalize__(self, method="apply")
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:831: in apply
    return self.apply_standard()
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:957: in apply_standard
    results, res_index = self.apply_series_generator()
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:973: in apply_series_generator
    results[i] = self.func(v, *self.args, **self.kwargs)
region_grower/synthesize_morphologies.py:182: in _parallel_wrapper
    new_cell = space_worker.synthesize()
region_grower/context.py:560: in synthesize
    return self._synthesize_once(rng)
region_grower/context.py:645: in _synthesize_once
    graft_axon(grower.neuron, axon_morph, rng=rng)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:158: in graft_axon
    position = grafting_position(neuron, axon_or_donor_neuron, rng)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:131: in grafting_position
    axon_direction = _random_direction(axis=_dendrites_mean_direction(neuron),
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:90: in _random_direction
    orthogonal = _rotate_vector(orthogonal, axis, rng.uniform(low=0., high=2. * np.pi))
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:80: in _rotate_vector
    return np.dot(_rotation_around_axis(axis, angle), vec)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:61: in _rotation_around_axis
    d = np.array(axis, dtype=np.float) / np.linalg.norm(axis)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   raise AttributeError(__former_attrs__[attr])
E   AttributeError: module 'numpy' has no attribute 'float'.
E   `np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
E   The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
E       https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

.tox/min_versions/lib/python3.9/site-packages/numpy/__init__.py:324: AttributeError

Check failure on line 139 in tests/test_synthesize_morphologies.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_synthesize_morphologies.test_synthesize[False-True-800]

AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
Raw output
>   old_axon = find_axon(neuron)

.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:128: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   raise NoAxonException('No axon found!')
E   morph_tool.exceptions.NoAxonException: No axon found!

.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:33: NoAxonException

During handling of the above exception, another exception occurred:

tmpdir = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_False_True_8000')
small_O1_path = '/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/atlas_small_O10'
input_cells = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_False_True_8000/input_cells.mvd3')
axon_morph_tsv = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_False_True_8000/axon_morphs.tsv')
with_axon = True, with_NRN = False, min_depth = 800

    @pytest.mark.parametrize("min_depth", [25, 800])
    @pytest.mark.parametrize("with_axon", [True, False])
    @pytest.mark.parametrize("with_NRN", [True, False])
    def test_synthesize(
        tmpdir,
        small_O1_path,
        input_cells,
        axon_morph_tsv,
        with_axon,
        with_NRN,
        min_depth,
    ):  # pylint: disable=unused-argument
        """Test morphology synthesis."""
        tmp_folder = Path(tmpdir)
    
        args = create_args(
            False,
            tmp_folder,
            input_cells,
            small_O1_path,
            axon_morph_tsv if with_axon else None,
            "apical_NRN_sections.yaml" if with_NRN else None,
            min_depth,
            DATA / "region_structure.yaml",
        )
    
        synthesizer = SynthesizeMorphologies(**args)
>       synthesizer.synthesize()

tests/test_synthesize_morphologies.py:139: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
region_grower/synthesize_morphologies.py:802: in synthesize
    res = self.compute()
region_grower/synthesize_morphologies.py:701: in compute
    computed = future.compute()
.tox/min_versions/lib/python3.9/site-packages/dask/base.py:314: in compute
    (result,) = compute(self, traverse=False, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/dask/base.py:599: in compute
    results = schedule(dsk, keys, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/distributed/client.py:3186: in get
    results = self.gather(packed, asynchronous=asynchronous, direct=direct)
.tox/min_versions/lib/python3.9/site-packages/distributed/client.py:2345: in gather
    return self.sync(
.tox/min_versions/lib/python3.9/site-packages/distributed/utils.py:349: in sync
    return sync(
.tox/min_versions/lib/python3.9/site-packages/distributed/utils.py:416: in sync
    raise exc.with_traceback(tb)
.tox/min_versions/lib/python3.9/site-packages/distributed/utils.py:389: in f
    result = yield future
.tox/min_versions/lib/python3.9/site-packages/tornado/gen.py:766: in run
    value = future.result()
.tox/min_versions/lib/python3.9/site-packages/distributed/client.py:2208: in _gather
    raise exception.with_traceback(traceback)
.tox/min_versions/lib/python3.9/site-packages/dask/optimization.py:990: in __call__
    return core.get(self.dsk, self.outkey, dict(zip(self.inkeys, args)))
.tox/min_versions/lib/python3.9/site-packages/dask/core.py:149: in get
    result = _execute_task(task, cache)
.tox/min_versions/lib/python3.9/site-packages/dask/core.py:119: in _execute_task
    return func(*(_execute_task(a, cache) for a in args))
.tox/min_versions/lib/python3.9/site-packages/dask/utils.py:73: in apply
    return func(*args, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/dask/dataframe/core.py:7006: in apply_and_enforce
    df = func(*args, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/dask/utils.py:1105: in __call__
    return getattr(__obj, self.method)(*args, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/pandas/core/frame.py:10037: in apply
    return op.apply().__finalize__(self, method="apply")
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:831: in apply
    return self.apply_standard()
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:957: in apply_standard
    results, res_index = self.apply_series_generator()
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:973: in apply_series_generator
    results[i] = self.func(v, *self.args, **self.kwargs)
region_grower/synthesize_morphologies.py:182: in _parallel_wrapper
    new_cell = space_worker.synthesize()
region_grower/context.py:560: in synthesize
    return self._synthesize_once(rng)
region_grower/context.py:645: in _synthesize_once
    graft_axon(grower.neuron, axon_morph, rng=rng)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:158: in graft_axon
    position = grafting_position(neuron, axon_or_donor_neuron, rng)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:131: in grafting_position
    axon_direction = _random_direction(axis=_dendrites_mean_direction(neuron),
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:90: in _random_direction
    orthogonal = _rotate_vector(orthogonal, axis, rng.uniform(low=0., high=2. * np.pi))
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:80: in _rotate_vector
    return np.dot(_rotation_around_axis(axis, angle), vec)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:61: in _rotation_around_axis
    d = np.array(axis, dtype=np.float) / np.linalg.norm(axis)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   raise AttributeError(__former_attrs__[attr])
E   AttributeError: module 'numpy' has no attribute 'float'.
E   `np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
E   The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
E       https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

.tox/min_versions/lib/python3.9/site-packages/numpy/__init__.py:324: AttributeError

Check failure on line 293 in tests/test_synthesize_morphologies.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_synthesize_morphologies.test_synthesize_skip_write[1-0]

AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
Raw output
neuron = <morphio._morphio.mut.Morphology object at 0x7fa00df96470>
axon_or_donor_neuron = <morphio._morphio.mut.Morphology object at 0x7fa00dfa72f0>
rng = Generator(PCG64) at 0x7FA014A589E0

    def grafting_position(neuron, axon_or_donor_neuron, rng=np.random):
        '''Find out where to put the grafted axon
    
        If the neuron to be grafted already has a neuron reuse its starting point
    
        Otherwise try to mimic the position of the axon with respect to dendrites in
        the donor axon. The position is choosen in order to
        preserve the direction between the axon initial segment direction
        and all other dendrites initial segments directions
    
        Returns:
            The position where to graft the neuron
        '''
        try:
>           old_axon = find_axon(neuron)

.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:128: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

axon_or_donor_axon = <morphio._morphio.mut.Morphology object at 0x7fa00df96470>

    def find_axon(axon_or_donor_axon):
        """Find the root section which is an axon.
    
        If the number of axons found is greater than 1, then return the first axon.
        """
    
        if isinstance(axon_or_donor_axon, (ImmutSection, Section)):
            if axon_or_donor_axon.type == SectionType.axon:
                return axon_or_donor_axon
            else:
                raise MorphToolException('The section: {} is not an axon'.format(axon_or_donor_axon))
    
        axons = [root for root in axon_or_donor_axon.root_sections
                 if root.type == SectionType.axon]
    
        if not axons:
>           raise NoAxonException('No axon found!')
E           morph_tool.exceptions.NoAxonException: No axon found!

.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:33: NoAxonException

During handling of the above exception, another exception occurred:

tmpdir = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_skip_write_1_00')
small_O1_path = '/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/atlas_small_O10'
input_cells = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_skip_write_1_00/input_cells.mvd3')
axon_morph_tsv = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_skip_write_1_00/axon_morphs.tsv')
nb_processes = 0, chunksize = 1

    @pytest.mark.parametrize("nb_processes", [0, 2, None])
    @pytest.mark.parametrize("chunksize", [1, 5, 999])
    def test_synthesize_skip_write(
        tmpdir,
        small_O1_path,
        input_cells,
        axon_morph_tsv,
        nb_processes,
        chunksize,
    ):  # pylint: disable=unused-argument
        """Test morphology synthesis but skip write step."""
        with_axon = True
        with_NRN = True
        min_depth = 25
        tmp_folder = Path(tmpdir)
    
        args = create_args(
            False,
            tmp_folder,
            input_cells,
            small_O1_path,
            axon_morph_tsv if with_axon else None,
            "apical_NRN_sections.yaml" if with_NRN else None,
            min_depth,
            DATA / "region_structure.yaml",
        )
        args["skip_write"] = True
        args["nb_processes"] = nb_processes
        args["hide_progress_bar"] = True
        args["out_apical"] = None
        args["chunksize"] = chunksize
    
        print("Number of available CPUs", os.cpu_count())
    
        synthesizer = SynthesizeMorphologies(**args)
>       res = synthesizer.synthesize()

tests/test_synthesize_morphologies.py:293: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
region_grower/synthesize_morphologies.py:802: in synthesize
    res = self.compute()
region_grower/synthesize_morphologies.py:687: in compute
    computed = self.cells_data.apply(
.tox/min_versions/lib/python3.9/site-packages/pandas/core/frame.py:10037: in apply
    return op.apply().__finalize__(self, method="apply")
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:831: in apply
    return self.apply_standard()
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:957: in apply_standard
    results, res_index = self.apply_series_generator()
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:973: in apply_series_generator
    results[i] = self.func(v, *self.args, **self.kwargs)
region_grower/synthesize_morphologies.py:688: in <lambda>
    lambda row: _parallel_wrapper(row, **func_kwargs), axis=1
region_grower/synthesize_morphologies.py:182: in _parallel_wrapper
    new_cell = space_worker.synthesize()
region_grower/context.py:560: in synthesize
    return self._synthesize_once(rng)
region_grower/context.py:645: in _synthesize_once
    graft_axon(grower.neuron, axon_morph, rng=rng)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:158: in graft_axon
    position = grafting_position(neuron, axon_or_donor_neuron, rng)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:131: in grafting_position
    axon_direction = _random_direction(axis=_dendrites_mean_direction(neuron),
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:90: in _random_direction
    orthogonal = _rotate_vector(orthogonal, axis, rng.uniform(low=0., high=2. * np.pi))
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:80: in _rotate_vector
    return np.dot(_rotation_around_axis(axis, angle), vec)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:61: in _rotation_around_axis
    d = np.array(axis, dtype=np.float) / np.linalg.norm(axis)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

attr = 'float'

    def __getattr__(attr):
        # Warn for expired attributes, and return a dummy function
        # that always raises an exception.
        import warnings
        import math
        try:
            msg = __expired_functions__[attr]
        except KeyError:
            pass
        else:
            warnings.warn(msg, DeprecationWarning, stacklevel=2)
    
            def _expired(*args, **kwds):
                raise RuntimeError(msg)
    
            return _expired
    
        # Emit warnings for deprecated attributes
        try:
            val, msg = __deprecated_attrs__[attr]
        except KeyError:
            pass
        else:
            warnings.warn(msg, DeprecationWarning, stacklevel=2)
            return val
    
        if attr in __future_scalars__:
            # And future warnings for those that will change, but also give
            # the AttributeError
            warnings.warn(
                f"In the future `np.{attr}` will be defined as the "
                "corresponding NumPy scalar.", FutureWarning, stacklevel=2)
    
        if attr in __former_attrs__:
>           raise AttributeError(__former_attrs__[attr])
E           AttributeError: module 'numpy' has no attribute 'float'.
E           `np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
E           The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
E               https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

.tox/min_versions/lib/python3.9/site-packages/numpy/__init__.py:324: AttributeError

Check failure on line 293 in tests/test_synthesize_morphologies.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_synthesize_morphologies.test_synthesize_skip_write[1-2]

AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
Raw output
>   old_axon = find_axon(neuron)

.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:128: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   raise NoAxonException('No axon found!')
E   morph_tool.exceptions.NoAxonException: No axon found!

.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:33: NoAxonException

During handling of the above exception, another exception occurred:

tmpdir = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_skip_write_1_20')
small_O1_path = '/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/atlas_small_O10'
input_cells = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_skip_write_1_20/input_cells.mvd3')
axon_morph_tsv = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_skip_write_1_20/axon_morphs.tsv')
nb_processes = 2, chunksize = 1

    @pytest.mark.parametrize("nb_processes", [0, 2, None])
    @pytest.mark.parametrize("chunksize", [1, 5, 999])
    def test_synthesize_skip_write(
        tmpdir,
        small_O1_path,
        input_cells,
        axon_morph_tsv,
        nb_processes,
        chunksize,
    ):  # pylint: disable=unused-argument
        """Test morphology synthesis but skip write step."""
        with_axon = True
        with_NRN = True
        min_depth = 25
        tmp_folder = Path(tmpdir)
    
        args = create_args(
            False,
            tmp_folder,
            input_cells,
            small_O1_path,
            axon_morph_tsv if with_axon else None,
            "apical_NRN_sections.yaml" if with_NRN else None,
            min_depth,
            DATA / "region_structure.yaml",
        )
        args["skip_write"] = True
        args["nb_processes"] = nb_processes
        args["hide_progress_bar"] = True
        args["out_apical"] = None
        args["chunksize"] = chunksize
    
        print("Number of available CPUs", os.cpu_count())
    
        synthesizer = SynthesizeMorphologies(**args)
>       res = synthesizer.synthesize()

tests/test_synthesize_morphologies.py:293: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
region_grower/synthesize_morphologies.py:802: in synthesize
    res = self.compute()
region_grower/synthesize_morphologies.py:701: in compute
    computed = future.compute()
.tox/min_versions/lib/python3.9/site-packages/dask/base.py:314: in compute
    (result,) = compute(self, traverse=False, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/dask/base.py:599: in compute
    results = schedule(dsk, keys, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/distributed/client.py:3186: in get
    results = self.gather(packed, asynchronous=asynchronous, direct=direct)
.tox/min_versions/lib/python3.9/site-packages/distributed/client.py:2345: in gather
    return self.sync(
.tox/min_versions/lib/python3.9/site-packages/distributed/utils.py:349: in sync
    return sync(
.tox/min_versions/lib/python3.9/site-packages/distributed/utils.py:416: in sync
    raise exc.with_traceback(tb)
.tox/min_versions/lib/python3.9/site-packages/distributed/utils.py:389: in f
    result = yield future
.tox/min_versions/lib/python3.9/site-packages/tornado/gen.py:766: in run
    value = future.result()
.tox/min_versions/lib/python3.9/site-packages/distributed/client.py:2208: in _gather
    raise exception.with_traceback(traceback)
.tox/min_versions/lib/python3.9/site-packages/dask/optimization.py:990: in __call__
    return core.get(self.dsk, self.outkey, dict(zip(self.inkeys, args)))
.tox/min_versions/lib/python3.9/site-packages/dask/core.py:149: in get
    result = _execute_task(task, cache)
.tox/min_versions/lib/python3.9/site-packages/dask/core.py:119: in _execute_task
    return func(*(_execute_task(a, cache) for a in args))
.tox/min_versions/lib/python3.9/site-packages/dask/utils.py:73: in apply
    return func(*args, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/dask/dataframe/core.py:7006: in apply_and_enforce
    df = func(*args, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/dask/utils.py:1105: in __call__
    return getattr(__obj, self.method)(*args, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/pandas/core/frame.py:10037: in apply
    return op.apply().__finalize__(self, method="apply")
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:831: in apply
    return self.apply_standard()
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:957: in apply_standard
    results, res_index = self.apply_series_generator()
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:973: in apply_series_generator
    results[i] = self.func(v, *self.args, **self.kwargs)
region_grower/synthesize_morphologies.py:182: in _parallel_wrapper
    new_cell = space_worker.synthesize()
region_grower/context.py:560: in synthesize
    return self._synthesize_once(rng)
region_grower/context.py:645: in _synthesize_once
    graft_axon(grower.neuron, axon_morph, rng=rng)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:158: in graft_axon
    position = grafting_position(neuron, axon_or_donor_neuron, rng)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:131: in grafting_position
    axon_direction = _random_direction(axis=_dendrites_mean_direction(neuron),
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:90: in _random_direction
    orthogonal = _rotate_vector(orthogonal, axis, rng.uniform(low=0., high=2. * np.pi))
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:80: in _rotate_vector
    return np.dot(_rotation_around_axis(axis, angle), vec)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:61: in _rotation_around_axis
    d = np.array(axis, dtype=np.float) / np.linalg.norm(axis)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   raise AttributeError(__former_attrs__[attr])
E   AttributeError: module 'numpy' has no attribute 'float'.
E   `np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
E   The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
E       https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

.tox/min_versions/lib/python3.9/site-packages/numpy/__init__.py:324: AttributeError

Check failure on line 293 in tests/test_synthesize_morphologies.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_synthesize_morphologies.test_synthesize_skip_write[1-None]

AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
Raw output
>   old_axon = find_axon(neuron)

.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:128: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   raise NoAxonException('No axon found!')
E   morph_tool.exceptions.NoAxonException: No axon found!

.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:33: NoAxonException

During handling of the above exception, another exception occurred:

tmpdir = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_skip_write_1_N0')
small_O1_path = '/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/atlas_small_O10'
input_cells = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_skip_write_1_N0/input_cells.mvd3')
axon_morph_tsv = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_skip_write_1_N0/axon_morphs.tsv')
nb_processes = None, chunksize = 1

    @pytest.mark.parametrize("nb_processes", [0, 2, None])
    @pytest.mark.parametrize("chunksize", [1, 5, 999])
    def test_synthesize_skip_write(
        tmpdir,
        small_O1_path,
        input_cells,
        axon_morph_tsv,
        nb_processes,
        chunksize,
    ):  # pylint: disable=unused-argument
        """Test morphology synthesis but skip write step."""
        with_axon = True
        with_NRN = True
        min_depth = 25
        tmp_folder = Path(tmpdir)
    
        args = create_args(
            False,
            tmp_folder,
            input_cells,
            small_O1_path,
            axon_morph_tsv if with_axon else None,
            "apical_NRN_sections.yaml" if with_NRN else None,
            min_depth,
            DATA / "region_structure.yaml",
        )
        args["skip_write"] = True
        args["nb_processes"] = nb_processes
        args["hide_progress_bar"] = True
        args["out_apical"] = None
        args["chunksize"] = chunksize
    
        print("Number of available CPUs", os.cpu_count())
    
        synthesizer = SynthesizeMorphologies(**args)
>       res = synthesizer.synthesize()

tests/test_synthesize_morphologies.py:293: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
region_grower/synthesize_morphologies.py:802: in synthesize
    res = self.compute()
region_grower/synthesize_morphologies.py:701: in compute
    computed = future.compute()
.tox/min_versions/lib/python3.9/site-packages/dask/base.py:314: in compute
    (result,) = compute(self, traverse=False, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/dask/base.py:599: in compute
    results = schedule(dsk, keys, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/distributed/client.py:3186: in get
    results = self.gather(packed, asynchronous=asynchronous, direct=direct)
.tox/min_versions/lib/python3.9/site-packages/distributed/client.py:2345: in gather
    return self.sync(
.tox/min_versions/lib/python3.9/site-packages/distributed/utils.py:349: in sync
    return sync(
.tox/min_versions/lib/python3.9/site-packages/distributed/utils.py:416: in sync
    raise exc.with_traceback(tb)
.tox/min_versions/lib/python3.9/site-packages/distributed/utils.py:389: in f
    result = yield future
.tox/min_versions/lib/python3.9/site-packages/tornado/gen.py:766: in run
    value = future.result()
.tox/min_versions/lib/python3.9/site-packages/distributed/client.py:2208: in _gather
    raise exception.with_traceback(traceback)
.tox/min_versions/lib/python3.9/site-packages/dask/optimization.py:990: in __call__
    return core.get(self.dsk, self.outkey, dict(zip(self.inkeys, args)))
.tox/min_versions/lib/python3.9/site-packages/dask/core.py:149: in get
    result = _execute_task(task, cache)
.tox/min_versions/lib/python3.9/site-packages/dask/core.py:119: in _execute_task
    return func(*(_execute_task(a, cache) for a in args))
.tox/min_versions/lib/python3.9/site-packages/dask/utils.py:73: in apply
    return func(*args, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/dask/dataframe/core.py:7006: in apply_and_enforce
    df = func(*args, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/dask/utils.py:1105: in __call__
    return getattr(__obj, self.method)(*args, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/pandas/core/frame.py:10037: in apply
    return op.apply().__finalize__(self, method="apply")
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:831: in apply
    return self.apply_standard()
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:957: in apply_standard
    results, res_index = self.apply_series_generator()
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:973: in apply_series_generator
    results[i] = self.func(v, *self.args, **self.kwargs)
region_grower/synthesize_morphologies.py:182: in _parallel_wrapper
    new_cell = space_worker.synthesize()
region_grower/context.py:560: in synthesize
    return self._synthesize_once(rng)
region_grower/context.py:645: in _synthesize_once
    graft_axon(grower.neuron, axon_morph, rng=rng)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:158: in graft_axon
    position = grafting_position(neuron, axon_or_donor_neuron, rng)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:131: in grafting_position
    axon_direction = _random_direction(axis=_dendrites_mean_direction(neuron),
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:90: in _random_direction
    orthogonal = _rotate_vector(orthogonal, axis, rng.uniform(low=0., high=2. * np.pi))
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:80: in _rotate_vector
    return np.dot(_rotation_around_axis(axis, angle), vec)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:61: in _rotation_around_axis
    d = np.array(axis, dtype=np.float) / np.linalg.norm(axis)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   raise AttributeError(__former_attrs__[attr])
E   AttributeError: module 'numpy' has no attribute 'float'.
E   `np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
E   The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
E       https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

.tox/min_versions/lib/python3.9/site-packages/numpy/__init__.py:324: AttributeError

Check failure on line 293 in tests/test_synthesize_morphologies.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_synthesize_morphologies.test_synthesize_skip_write[5-0]

AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
Raw output
neuron = <morphio._morphio.mut.Morphology object at 0x7fa0243ecef0>
axon_or_donor_neuron = <morphio._morphio.mut.Morphology object at 0x7fa014e11870>
rng = Generator(PCG64) at 0x7FA0245D93C0

    def grafting_position(neuron, axon_or_donor_neuron, rng=np.random):
        '''Find out where to put the grafted axon
    
        If the neuron to be grafted already has a neuron reuse its starting point
    
        Otherwise try to mimic the position of the axon with respect to dendrites in
        the donor axon. The position is choosen in order to
        preserve the direction between the axon initial segment direction
        and all other dendrites initial segments directions
    
        Returns:
            The position where to graft the neuron
        '''
        try:
>           old_axon = find_axon(neuron)

.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:128: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

axon_or_donor_axon = <morphio._morphio.mut.Morphology object at 0x7fa0243ecef0>

    def find_axon(axon_or_donor_axon):
        """Find the root section which is an axon.
    
        If the number of axons found is greater than 1, then return the first axon.
        """
    
        if isinstance(axon_or_donor_axon, (ImmutSection, Section)):
            if axon_or_donor_axon.type == SectionType.axon:
                return axon_or_donor_axon
            else:
                raise MorphToolException('The section: {} is not an axon'.format(axon_or_donor_axon))
    
        axons = [root for root in axon_or_donor_axon.root_sections
                 if root.type == SectionType.axon]
    
        if not axons:
>           raise NoAxonException('No axon found!')
E           morph_tool.exceptions.NoAxonException: No axon found!

.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:33: NoAxonException

During handling of the above exception, another exception occurred:

tmpdir = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_skip_write_5_00')
small_O1_path = '/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/atlas_small_O10'
input_cells = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_skip_write_5_00/input_cells.mvd3')
axon_morph_tsv = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_skip_write_5_00/axon_morphs.tsv')
nb_processes = 0, chunksize = 5

    @pytest.mark.parametrize("nb_processes", [0, 2, None])
    @pytest.mark.parametrize("chunksize", [1, 5, 999])
    def test_synthesize_skip_write(
        tmpdir,
        small_O1_path,
        input_cells,
        axon_morph_tsv,
        nb_processes,
        chunksize,
    ):  # pylint: disable=unused-argument
        """Test morphology synthesis but skip write step."""
        with_axon = True
        with_NRN = True
        min_depth = 25
        tmp_folder = Path(tmpdir)
    
        args = create_args(
            False,
            tmp_folder,
            input_cells,
            small_O1_path,
            axon_morph_tsv if with_axon else None,
            "apical_NRN_sections.yaml" if with_NRN else None,
            min_depth,
            DATA / "region_structure.yaml",
        )
        args["skip_write"] = True
        args["nb_processes"] = nb_processes
        args["hide_progress_bar"] = True
        args["out_apical"] = None
        args["chunksize"] = chunksize
    
        print("Number of available CPUs", os.cpu_count())
    
        synthesizer = SynthesizeMorphologies(**args)
>       res = synthesizer.synthesize()

tests/test_synthesize_morphologies.py:293: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
region_grower/synthesize_morphologies.py:802: in synthesize
    res = self.compute()
region_grower/synthesize_morphologies.py:687: in compute
    computed = self.cells_data.apply(
.tox/min_versions/lib/python3.9/site-packages/pandas/core/frame.py:10037: in apply
    return op.apply().__finalize__(self, method="apply")
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:831: in apply
    return self.apply_standard()
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:957: in apply_standard
    results, res_index = self.apply_series_generator()
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:973: in apply_series_generator
    results[i] = self.func(v, *self.args, **self.kwargs)
region_grower/synthesize_morphologies.py:688: in <lambda>
    lambda row: _parallel_wrapper(row, **func_kwargs), axis=1
region_grower/synthesize_morphologies.py:182: in _parallel_wrapper
    new_cell = space_worker.synthesize()
region_grower/context.py:560: in synthesize
    return self._synthesize_once(rng)
region_grower/context.py:645: in _synthesize_once
    graft_axon(grower.neuron, axon_morph, rng=rng)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:158: in graft_axon
    position = grafting_position(neuron, axon_or_donor_neuron, rng)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:131: in grafting_position
    axon_direction = _random_direction(axis=_dendrites_mean_direction(neuron),
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:90: in _random_direction
    orthogonal = _rotate_vector(orthogonal, axis, rng.uniform(low=0., high=2. * np.pi))
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:80: in _rotate_vector
    return np.dot(_rotation_around_axis(axis, angle), vec)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:61: in _rotation_around_axis
    d = np.array(axis, dtype=np.float) / np.linalg.norm(axis)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

attr = 'float'

    def __getattr__(attr):
        # Warn for expired attributes, and return a dummy function
        # that always raises an exception.
        import warnings
        import math
        try:
            msg = __expired_functions__[attr]
        except KeyError:
            pass
        else:
            warnings.warn(msg, DeprecationWarning, stacklevel=2)
    
            def _expired(*args, **kwds):
                raise RuntimeError(msg)
    
            return _expired
    
        # Emit warnings for deprecated attributes
        try:
            val, msg = __deprecated_attrs__[attr]
        except KeyError:
            pass
        else:
            warnings.warn(msg, DeprecationWarning, stacklevel=2)
            return val
    
        if attr in __future_scalars__:
            # And future warnings for those that will change, but also give
            # the AttributeError
            warnings.warn(
                f"In the future `np.{attr}` will be defined as the "
                "corresponding NumPy scalar.", FutureWarning, stacklevel=2)
    
        if attr in __former_attrs__:
>           raise AttributeError(__former_attrs__[attr])
E           AttributeError: module 'numpy' has no attribute 'float'.
E           `np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
E           The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
E               https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

.tox/min_versions/lib/python3.9/site-packages/numpy/__init__.py:324: AttributeError

Check failure on line 293 in tests/test_synthesize_morphologies.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_synthesize_morphologies.test_synthesize_skip_write[5-2]

AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
Raw output
>   old_axon = find_axon(neuron)

.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:128: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   raise NoAxonException('No axon found!')
E   morph_tool.exceptions.NoAxonException: No axon found!

.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:33: NoAxonException

During handling of the above exception, another exception occurred:

tmpdir = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_skip_write_5_20')
small_O1_path = '/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/atlas_small_O10'
input_cells = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_skip_write_5_20/input_cells.mvd3')
axon_morph_tsv = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_skip_write_5_20/axon_morphs.tsv')
nb_processes = 2, chunksize = 5

    @pytest.mark.parametrize("nb_processes", [0, 2, None])
    @pytest.mark.parametrize("chunksize", [1, 5, 999])
    def test_synthesize_skip_write(
        tmpdir,
        small_O1_path,
        input_cells,
        axon_morph_tsv,
        nb_processes,
        chunksize,
    ):  # pylint: disable=unused-argument
        """Test morphology synthesis but skip write step."""
        with_axon = True
        with_NRN = True
        min_depth = 25
        tmp_folder = Path(tmpdir)
    
        args = create_args(
            False,
            tmp_folder,
            input_cells,
            small_O1_path,
            axon_morph_tsv if with_axon else None,
            "apical_NRN_sections.yaml" if with_NRN else None,
            min_depth,
            DATA / "region_structure.yaml",
        )
        args["skip_write"] = True
        args["nb_processes"] = nb_processes
        args["hide_progress_bar"] = True
        args["out_apical"] = None
        args["chunksize"] = chunksize
    
        print("Number of available CPUs", os.cpu_count())
    
        synthesizer = SynthesizeMorphologies(**args)
>       res = synthesizer.synthesize()

tests/test_synthesize_morphologies.py:293: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
region_grower/synthesize_morphologies.py:802: in synthesize
    res = self.compute()
region_grower/synthesize_morphologies.py:701: in compute
    computed = future.compute()
.tox/min_versions/lib/python3.9/site-packages/dask/base.py:314: in compute
    (result,) = compute(self, traverse=False, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/dask/base.py:599: in compute
    results = schedule(dsk, keys, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/distributed/client.py:3186: in get
    results = self.gather(packed, asynchronous=asynchronous, direct=direct)
.tox/min_versions/lib/python3.9/site-packages/distributed/client.py:2345: in gather
    return self.sync(
.tox/min_versions/lib/python3.9/site-packages/distributed/utils.py:349: in sync
    return sync(
.tox/min_versions/lib/python3.9/site-packages/distributed/utils.py:416: in sync
    raise exc.with_traceback(tb)
.tox/min_versions/lib/python3.9/site-packages/distributed/utils.py:389: in f
    result = yield future
.tox/min_versions/lib/python3.9/site-packages/tornado/gen.py:766: in run
    value = future.result()
.tox/min_versions/lib/python3.9/site-packages/distributed/client.py:2208: in _gather
    raise exception.with_traceback(traceback)
.tox/min_versions/lib/python3.9/site-packages/dask/optimization.py:990: in __call__
    return core.get(self.dsk, self.outkey, dict(zip(self.inkeys, args)))
.tox/min_versions/lib/python3.9/site-packages/dask/core.py:149: in get
    result = _execute_task(task, cache)
.tox/min_versions/lib/python3.9/site-packages/dask/core.py:119: in _execute_task
    return func(*(_execute_task(a, cache) for a in args))
.tox/min_versions/lib/python3.9/site-packages/dask/utils.py:73: in apply
    return func(*args, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/dask/dataframe/core.py:7006: in apply_and_enforce
    df = func(*args, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/dask/utils.py:1105: in __call__
    return getattr(__obj, self.method)(*args, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/pandas/core/frame.py:10037: in apply
    return op.apply().__finalize__(self, method="apply")
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:831: in apply
    return self.apply_standard()
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:957: in apply_standard
    results, res_index = self.apply_series_generator()
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:973: in apply_series_generator
    results[i] = self.func(v, *self.args, **self.kwargs)
region_grower/synthesize_morphologies.py:182: in _parallel_wrapper
    new_cell = space_worker.synthesize()
region_grower/context.py:560: in synthesize
    return self._synthesize_once(rng)
region_grower/context.py:645: in _synthesize_once
    graft_axon(grower.neuron, axon_morph, rng=rng)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:158: in graft_axon
    position = grafting_position(neuron, axon_or_donor_neuron, rng)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:131: in grafting_position
    axon_direction = _random_direction(axis=_dendrites_mean_direction(neuron),
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:90: in _random_direction
    orthogonal = _rotate_vector(orthogonal, axis, rng.uniform(low=0., high=2. * np.pi))
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:80: in _rotate_vector
    return np.dot(_rotation_around_axis(axis, angle), vec)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:61: in _rotation_around_axis
    d = np.array(axis, dtype=np.float) / np.linalg.norm(axis)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   raise AttributeError(__former_attrs__[attr])
E   AttributeError: module 'numpy' has no attribute 'float'.
E   `np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
E   The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
E       https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

.tox/min_versions/lib/python3.9/site-packages/numpy/__init__.py:324: AttributeError

Check failure on line 293 in tests/test_synthesize_morphologies.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_synthesize_morphologies.test_synthesize_skip_write[5-None]

AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
Raw output
>   old_axon = find_axon(neuron)

.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:128: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   raise NoAxonException('No axon found!')
E   morph_tool.exceptions.NoAxonException: No axon found!

.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:33: NoAxonException

During handling of the above exception, another exception occurred:

tmpdir = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_skip_write_5_N0')
small_O1_path = '/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/atlas_small_O10'
input_cells = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_skip_write_5_N0/input_cells.mvd3')
axon_morph_tsv = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_skip_write_5_N0/axon_morphs.tsv')
nb_processes = None, chunksize = 5

    @pytest.mark.parametrize("nb_processes", [0, 2, None])
    @pytest.mark.parametrize("chunksize", [1, 5, 999])
    def test_synthesize_skip_write(
        tmpdir,
        small_O1_path,
        input_cells,
        axon_morph_tsv,
        nb_processes,
        chunksize,
    ):  # pylint: disable=unused-argument
        """Test morphology synthesis but skip write step."""
        with_axon = True
        with_NRN = True
        min_depth = 25
        tmp_folder = Path(tmpdir)
    
        args = create_args(
            False,
            tmp_folder,
            input_cells,
            small_O1_path,
            axon_morph_tsv if with_axon else None,
            "apical_NRN_sections.yaml" if with_NRN else None,
            min_depth,
            DATA / "region_structure.yaml",
        )
        args["skip_write"] = True
        args["nb_processes"] = nb_processes
        args["hide_progress_bar"] = True
        args["out_apical"] = None
        args["chunksize"] = chunksize
    
        print("Number of available CPUs", os.cpu_count())
    
        synthesizer = SynthesizeMorphologies(**args)
>       res = synthesizer.synthesize()

tests/test_synthesize_morphologies.py:293: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
region_grower/synthesize_morphologies.py:802: in synthesize
    res = self.compute()
region_grower/synthesize_morphologies.py:701: in compute
    computed = future.compute()
.tox/min_versions/lib/python3.9/site-packages/dask/base.py:314: in compute
    (result,) = compute(self, traverse=False, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/dask/base.py:599: in compute
    results = schedule(dsk, keys, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/distributed/client.py:3186: in get
    results = self.gather(packed, asynchronous=asynchronous, direct=direct)
.tox/min_versions/lib/python3.9/site-packages/distributed/client.py:2345: in gather
    return self.sync(
.tox/min_versions/lib/python3.9/site-packages/distributed/utils.py:349: in sync
    return sync(
.tox/min_versions/lib/python3.9/site-packages/distributed/utils.py:416: in sync
    raise exc.with_traceback(tb)
.tox/min_versions/lib/python3.9/site-packages/distributed/utils.py:389: in f
    result = yield future
.tox/min_versions/lib/python3.9/site-packages/tornado/gen.py:766: in run
    value = future.result()
.tox/min_versions/lib/python3.9/site-packages/distributed/client.py:2208: in _gather
    raise exception.with_traceback(traceback)
.tox/min_versions/lib/python3.9/site-packages/dask/optimization.py:990: in __call__
    return core.get(self.dsk, self.outkey, dict(zip(self.inkeys, args)))
.tox/min_versions/lib/python3.9/site-packages/dask/core.py:149: in get
    result = _execute_task(task, cache)
.tox/min_versions/lib/python3.9/site-packages/dask/core.py:119: in _execute_task
    return func(*(_execute_task(a, cache) for a in args))
.tox/min_versions/lib/python3.9/site-packages/dask/utils.py:73: in apply
    return func(*args, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/dask/dataframe/core.py:7006: in apply_and_enforce
    df = func(*args, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/dask/utils.py:1105: in __call__
    return getattr(__obj, self.method)(*args, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/pandas/core/frame.py:10037: in apply
    return op.apply().__finalize__(self, method="apply")
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:831: in apply
    return self.apply_standard()
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:957: in apply_standard
    results, res_index = self.apply_series_generator()
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:973: in apply_series_generator
    results[i] = self.func(v, *self.args, **self.kwargs)
region_grower/synthesize_morphologies.py:182: in _parallel_wrapper
    new_cell = space_worker.synthesize()
region_grower/context.py:560: in synthesize
    return self._synthesize_once(rng)
region_grower/context.py:645: in _synthesize_once
    graft_axon(grower.neuron, axon_morph, rng=rng)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:158: in graft_axon
    position = grafting_position(neuron, axon_or_donor_neuron, rng)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:131: in grafting_position
    axon_direction = _random_direction(axis=_dendrites_mean_direction(neuron),
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:90: in _random_direction
    orthogonal = _rotate_vector(orthogonal, axis, rng.uniform(low=0., high=2. * np.pi))
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:80: in _rotate_vector
    return np.dot(_rotation_around_axis(axis, angle), vec)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:61: in _rotation_around_axis
    d = np.array(axis, dtype=np.float) / np.linalg.norm(axis)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   raise AttributeError(__former_attrs__[attr])
E   AttributeError: module 'numpy' has no attribute 'float'.
E   `np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
E   The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
E       https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

.tox/min_versions/lib/python3.9/site-packages/numpy/__init__.py:324: AttributeError

Check failure on line 293 in tests/test_synthesize_morphologies.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_synthesize_morphologies.test_synthesize_skip_write[999-0]

AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
Raw output
neuron = <morphio._morphio.mut.Morphology object at 0x7fa0147b75b0>
axon_or_donor_neuron = <morphio._morphio.mut.Morphology object at 0x7fa0149c66b0>
rng = Generator(PCG64) at 0x7FA00DAABE40

    def grafting_position(neuron, axon_or_donor_neuron, rng=np.random):
        '''Find out where to put the grafted axon
    
        If the neuron to be grafted already has a neuron reuse its starting point
    
        Otherwise try to mimic the position of the axon with respect to dendrites in
        the donor axon. The position is choosen in order to
        preserve the direction between the axon initial segment direction
        and all other dendrites initial segments directions
    
        Returns:
            The position where to graft the neuron
        '''
        try:
>           old_axon = find_axon(neuron)

.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:128: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

axon_or_donor_axon = <morphio._morphio.mut.Morphology object at 0x7fa0147b75b0>

    def find_axon(axon_or_donor_axon):
        """Find the root section which is an axon.
    
        If the number of axons found is greater than 1, then return the first axon.
        """
    
        if isinstance(axon_or_donor_axon, (ImmutSection, Section)):
            if axon_or_donor_axon.type == SectionType.axon:
                return axon_or_donor_axon
            else:
                raise MorphToolException('The section: {} is not an axon'.format(axon_or_donor_axon))
    
        axons = [root for root in axon_or_donor_axon.root_sections
                 if root.type == SectionType.axon]
    
        if not axons:
>           raise NoAxonException('No axon found!')
E           morph_tool.exceptions.NoAxonException: No axon found!

.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:33: NoAxonException

During handling of the above exception, another exception occurred:

tmpdir = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_skip_write_9990')
small_O1_path = '/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/atlas_small_O10'
input_cells = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_skip_write_9990/input_cells.mvd3')
axon_morph_tsv = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_skip_write_9990/axon_morphs.tsv')
nb_processes = 0, chunksize = 999

    @pytest.mark.parametrize("nb_processes", [0, 2, None])
    @pytest.mark.parametrize("chunksize", [1, 5, 999])
    def test_synthesize_skip_write(
        tmpdir,
        small_O1_path,
        input_cells,
        axon_morph_tsv,
        nb_processes,
        chunksize,
    ):  # pylint: disable=unused-argument
        """Test morphology synthesis but skip write step."""
        with_axon = True
        with_NRN = True
        min_depth = 25
        tmp_folder = Path(tmpdir)
    
        args = create_args(
            False,
            tmp_folder,
            input_cells,
            small_O1_path,
            axon_morph_tsv if with_axon else None,
            "apical_NRN_sections.yaml" if with_NRN else None,
            min_depth,
            DATA / "region_structure.yaml",
        )
        args["skip_write"] = True
        args["nb_processes"] = nb_processes
        args["hide_progress_bar"] = True
        args["out_apical"] = None
        args["chunksize"] = chunksize
    
        print("Number of available CPUs", os.cpu_count())
    
        synthesizer = SynthesizeMorphologies(**args)
>       res = synthesizer.synthesize()

tests/test_synthesize_morphologies.py:293: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
region_grower/synthesize_morphologies.py:802: in synthesize
    res = self.compute()
region_grower/synthesize_morphologies.py:687: in compute
    computed = self.cells_data.apply(
.tox/min_versions/lib/python3.9/site-packages/pandas/core/frame.py:10037: in apply
    return op.apply().__finalize__(self, method="apply")
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:831: in apply
    return self.apply_standard()
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:957: in apply_standard
    results, res_index = self.apply_series_generator()
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:973: in apply_series_generator
    results[i] = self.func(v, *self.args, **self.kwargs)
region_grower/synthesize_morphologies.py:688: in <lambda>
    lambda row: _parallel_wrapper(row, **func_kwargs), axis=1
region_grower/synthesize_morphologies.py:182: in _parallel_wrapper
    new_cell = space_worker.synthesize()
region_grower/context.py:560: in synthesize
    return self._synthesize_once(rng)
region_grower/context.py:645: in _synthesize_once
    graft_axon(grower.neuron, axon_morph, rng=rng)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:158: in graft_axon
    position = grafting_position(neuron, axon_or_donor_neuron, rng)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:131: in grafting_position
    axon_direction = _random_direction(axis=_dendrites_mean_direction(neuron),
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:90: in _random_direction
    orthogonal = _rotate_vector(orthogonal, axis, rng.uniform(low=0., high=2. * np.pi))
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:80: in _rotate_vector
    return np.dot(_rotation_around_axis(axis, angle), vec)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:61: in _rotation_around_axis
    d = np.array(axis, dtype=np.float) / np.linalg.norm(axis)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

attr = 'float'

    def __getattr__(attr):
        # Warn for expired attributes, and return a dummy function
        # that always raises an exception.
        import warnings
        import math
        try:
            msg = __expired_functions__[attr]
        except KeyError:
            pass
        else:
            warnings.warn(msg, DeprecationWarning, stacklevel=2)
    
            def _expired(*args, **kwds):
                raise RuntimeError(msg)
    
            return _expired
    
        # Emit warnings for deprecated attributes
        try:
            val, msg = __deprecated_attrs__[attr]
        except KeyError:
            pass
        else:
            warnings.warn(msg, DeprecationWarning, stacklevel=2)
            return val
    
        if attr in __future_scalars__:
            # And future warnings for those that will change, but also give
            # the AttributeError
            warnings.warn(
                f"In the future `np.{attr}` will be defined as the "
                "corresponding NumPy scalar.", FutureWarning, stacklevel=2)
    
        if attr in __former_attrs__:
>           raise AttributeError(__former_attrs__[attr])
E           AttributeError: module 'numpy' has no attribute 'float'.
E           `np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
E           The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
E               https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

.tox/min_versions/lib/python3.9/site-packages/numpy/__init__.py:324: AttributeError

Check failure on line 293 in tests/test_synthesize_morphologies.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_synthesize_morphologies.test_synthesize_skip_write[999-2]

AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
Raw output
>   old_axon = find_axon(neuron)

.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:128: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   raise NoAxonException('No axon found!')
E   morph_tool.exceptions.NoAxonException: No axon found!

.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:33: NoAxonException

During handling of the above exception, another exception occurred:

tmpdir = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_skip_write_9991')
small_O1_path = '/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/atlas_small_O10'
input_cells = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_skip_write_9991/input_cells.mvd3')
axon_morph_tsv = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_skip_write_9991/axon_morphs.tsv')
nb_processes = 2, chunksize = 999

    @pytest.mark.parametrize("nb_processes", [0, 2, None])
    @pytest.mark.parametrize("chunksize", [1, 5, 999])
    def test_synthesize_skip_write(
        tmpdir,
        small_O1_path,
        input_cells,
        axon_morph_tsv,
        nb_processes,
        chunksize,
    ):  # pylint: disable=unused-argument
        """Test morphology synthesis but skip write step."""
        with_axon = True
        with_NRN = True
        min_depth = 25
        tmp_folder = Path(tmpdir)
    
        args = create_args(
            False,
            tmp_folder,
            input_cells,
            small_O1_path,
            axon_morph_tsv if with_axon else None,
            "apical_NRN_sections.yaml" if with_NRN else None,
            min_depth,
            DATA / "region_structure.yaml",
        )
        args["skip_write"] = True
        args["nb_processes"] = nb_processes
        args["hide_progress_bar"] = True
        args["out_apical"] = None
        args["chunksize"] = chunksize
    
        print("Number of available CPUs", os.cpu_count())
    
        synthesizer = SynthesizeMorphologies(**args)
>       res = synthesizer.synthesize()

tests/test_synthesize_morphologies.py:293: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
region_grower/synthesize_morphologies.py:802: in synthesize
    res = self.compute()
region_grower/synthesize_morphologies.py:701: in compute
    computed = future.compute()
.tox/min_versions/lib/python3.9/site-packages/dask/base.py:314: in compute
    (result,) = compute(self, traverse=False, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/dask/base.py:599: in compute
    results = schedule(dsk, keys, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/distributed/client.py:3186: in get
    results = self.gather(packed, asynchronous=asynchronous, direct=direct)
.tox/min_versions/lib/python3.9/site-packages/distributed/client.py:2345: in gather
    return self.sync(
.tox/min_versions/lib/python3.9/site-packages/distributed/utils.py:349: in sync
    return sync(
.tox/min_versions/lib/python3.9/site-packages/distributed/utils.py:416: in sync
    raise exc.with_traceback(tb)
.tox/min_versions/lib/python3.9/site-packages/distributed/utils.py:389: in f
    result = yield future
.tox/min_versions/lib/python3.9/site-packages/tornado/gen.py:766: in run
    value = future.result()
.tox/min_versions/lib/python3.9/site-packages/distributed/client.py:2208: in _gather
    raise exception.with_traceback(traceback)
.tox/min_versions/lib/python3.9/site-packages/dask/optimization.py:990: in __call__
    return core.get(self.dsk, self.outkey, dict(zip(self.inkeys, args)))
.tox/min_versions/lib/python3.9/site-packages/dask/core.py:149: in get
    result = _execute_task(task, cache)
.tox/min_versions/lib/python3.9/site-packages/dask/core.py:119: in _execute_task
    return func(*(_execute_task(a, cache) for a in args))
.tox/min_versions/lib/python3.9/site-packages/dask/utils.py:73: in apply
    return func(*args, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/dask/dataframe/core.py:7006: in apply_and_enforce
    df = func(*args, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/dask/utils.py:1105: in __call__
    return getattr(__obj, self.method)(*args, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/pandas/core/frame.py:10037: in apply
    return op.apply().__finalize__(self, method="apply")
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:831: in apply
    return self.apply_standard()
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:957: in apply_standard
    results, res_index = self.apply_series_generator()
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:973: in apply_series_generator
    results[i] = self.func(v, *self.args, **self.kwargs)
region_grower/synthesize_morphologies.py:182: in _parallel_wrapper
    new_cell = space_worker.synthesize()
region_grower/context.py:560: in synthesize
    return self._synthesize_once(rng)
region_grower/context.py:645: in _synthesize_once
    graft_axon(grower.neuron, axon_morph, rng=rng)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:158: in graft_axon
    position = grafting_position(neuron, axon_or_donor_neuron, rng)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:131: in grafting_position
    axon_direction = _random_direction(axis=_dendrites_mean_direction(neuron),
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:90: in _random_direction
    orthogonal = _rotate_vector(orthogonal, axis, rng.uniform(low=0., high=2. * np.pi))
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:80: in _rotate_vector
    return np.dot(_rotation_around_axis(axis, angle), vec)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:61: in _rotation_around_axis
    d = np.array(axis, dtype=np.float) / np.linalg.norm(axis)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   raise AttributeError(__former_attrs__[attr])
E   AttributeError: module 'numpy' has no attribute 'float'.
E   `np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
E   The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
E       https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

.tox/min_versions/lib/python3.9/site-packages/numpy/__init__.py:324: AttributeError

Check failure on line 293 in tests/test_synthesize_morphologies.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_synthesize_morphologies.test_synthesize_skip_write[999-None]

AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
Raw output
>   old_axon = find_axon(neuron)

.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:128: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   raise NoAxonException('No axon found!')
E   morph_tool.exceptions.NoAxonException: No axon found!

.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:33: NoAxonException

During handling of the above exception, another exception occurred:

tmpdir = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_skip_write_9992')
small_O1_path = '/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/atlas_small_O10'
input_cells = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_skip_write_9992/input_cells.mvd3')
axon_morph_tsv = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_skip_write_9992/axon_morphs.tsv')
nb_processes = None, chunksize = 999

    @pytest.mark.parametrize("nb_processes", [0, 2, None])
    @pytest.mark.parametrize("chunksize", [1, 5, 999])
    def test_synthesize_skip_write(
        tmpdir,
        small_O1_path,
        input_cells,
        axon_morph_tsv,
        nb_processes,
        chunksize,
    ):  # pylint: disable=unused-argument
        """Test morphology synthesis but skip write step."""
        with_axon = True
        with_NRN = True
        min_depth = 25
        tmp_folder = Path(tmpdir)
    
        args = create_args(
            False,
            tmp_folder,
            input_cells,
            small_O1_path,
            axon_morph_tsv if with_axon else None,
            "apical_NRN_sections.yaml" if with_NRN else None,
            min_depth,
            DATA / "region_structure.yaml",
        )
        args["skip_write"] = True
        args["nb_processes"] = nb_processes
        args["hide_progress_bar"] = True
        args["out_apical"] = None
        args["chunksize"] = chunksize
    
        print("Number of available CPUs", os.cpu_count())
    
        synthesizer = SynthesizeMorphologies(**args)
>       res = synthesizer.synthesize()

tests/test_synthesize_morphologies.py:293: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
region_grower/synthesize_morphologies.py:802: in synthesize
    res = self.compute()
region_grower/synthesize_morphologies.py:701: in compute
    computed = future.compute()
.tox/min_versions/lib/python3.9/site-packages/dask/base.py:314: in compute
    (result,) = compute(self, traverse=False, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/dask/base.py:599: in compute
    results = schedule(dsk, keys, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/distributed/client.py:3186: in get
    results = self.gather(packed, asynchronous=asynchronous, direct=direct)
.tox/min_versions/lib/python3.9/site-packages/distributed/client.py:2345: in gather
    return self.sync(
.tox/min_versions/lib/python3.9/site-packages/distributed/utils.py:349: in sync
    return sync(
.tox/min_versions/lib/python3.9/site-packages/distributed/utils.py:416: in sync
    raise exc.with_traceback(tb)
.tox/min_versions/lib/python3.9/site-packages/distributed/utils.py:389: in f
    result = yield future
.tox/min_versions/lib/python3.9/site-packages/tornado/gen.py:766: in run
    value = future.result()
.tox/min_versions/lib/python3.9/site-packages/distributed/client.py:2208: in _gather
    raise exception.with_traceback(traceback)
.tox/min_versions/lib/python3.9/site-packages/dask/optimization.py:990: in __call__
    return core.get(self.dsk, self.outkey, dict(zip(self.inkeys, args)))
.tox/min_versions/lib/python3.9/site-packages/dask/core.py:149: in get
    result = _execute_task(task, cache)
.tox/min_versions/lib/python3.9/site-packages/dask/core.py:119: in _execute_task
    return func(*(_execute_task(a, cache) for a in args))
.tox/min_versions/lib/python3.9/site-packages/dask/utils.py:73: in apply
    return func(*args, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/dask/dataframe/core.py:7006: in apply_and_enforce
    df = func(*args, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/dask/utils.py:1105: in __call__
    return getattr(__obj, self.method)(*args, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/pandas/core/frame.py:10037: in apply
    return op.apply().__finalize__(self, method="apply")
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:831: in apply
    return self.apply_standard()
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:957: in apply_standard
    results, res_index = self.apply_series_generator()
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:973: in apply_series_generator
    results[i] = self.func(v, *self.args, **self.kwargs)
region_grower/synthesize_morphologies.py:182: in _parallel_wrapper
    new_cell = space_worker.synthesize()
region_grower/context.py:560: in synthesize
    return self._synthesize_once(rng)
region_grower/context.py:645: in _synthesize_once
    graft_axon(grower.neuron, axon_morph, rng=rng)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:158: in graft_axon
    position = grafting_position(neuron, axon_or_donor_neuron, rng)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:131: in grafting_position
    axon_direction = _random_direction(axis=_dendrites_mean_direction(neuron),
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:90: in _random_direction
    orthogonal = _rotate_vector(orthogonal, axis, rng.uniform(low=0., high=2. * np.pi))
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:80: in _rotate_vector
    return np.dot(_rotation_around_axis(axis, angle), vec)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:61: in _rotation_around_axis
    d = np.array(axis, dtype=np.float) / np.linalg.norm(axis)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   raise AttributeError(__former_attrs__[attr])
E   AttributeError: module 'numpy' has no attribute 'float'.
E   `np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
E   The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
E       https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

.tox/min_versions/lib/python3.9/site-packages/numpy/__init__.py:324: AttributeError

Check failure on line 368 in tests/test_synthesize_morphologies.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_synthesize_morphologies.test_synthesize_boundary

AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
Raw output
>   old_axon = find_axon(neuron)

.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:128: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   raise NoAxonException('No axon found!')
E   morph_tool.exceptions.NoAxonException: No axon found!

.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:33: NoAxonException

During handling of the above exception, another exception occurred:

tmpdir = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_boundary0')
small_O1_path = '/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/atlas_small_O10'
input_cells = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_boundary0/input_cells.mvd3')
axon_morph_tsv = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_synthesize_boundary0/axon_morphs.tsv')
mesh = '/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/mesh0/mesh.obj'

    def test_synthesize_boundary(
        tmpdir,
        small_O1_path,
        input_cells,
        axon_morph_tsv,
        mesh,
    ):  # pylint: disable=unused-argument,too-many-locals
        """Test morphology synthesis but skip write step."""
        with_axon = True
        with_NRN = True
        min_depth = 25
        tmp_folder = Path(tmpdir)
    
        # pylint: disable=import-outside-toplevel
        from .data_factories import generate_region_structure_boundary
    
        region_structure = "region_structure.yaml"
        generate_region_structure_boundary(
            DATA / "region_structure.yaml", region_structure, mesh, with_sections=True, with_trunks=True
        )
        args = create_args(
            False,
            tmp_folder,
            input_cells,
            small_O1_path,
            axon_morph_tsv if with_axon else None,
            "apical_NRN_sections.yaml" if with_NRN else None,
            min_depth,
            region_structure,
        )
        args["skip_write"] = True
    
        synthesizer = SynthesizeMorphologies(**args)
>       res = synthesizer.synthesize()

tests/test_synthesize_morphologies.py:368: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
region_grower/synthesize_morphologies.py:802: in synthesize
    res = self.compute()
region_grower/synthesize_morphologies.py:701: in compute
    computed = future.compute()
.tox/min_versions/lib/python3.9/site-packages/dask/base.py:314: in compute
    (result,) = compute(self, traverse=False, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/dask/base.py:599: in compute
    results = schedule(dsk, keys, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/distributed/client.py:3186: in get
    results = self.gather(packed, asynchronous=asynchronous, direct=direct)
.tox/min_versions/lib/python3.9/site-packages/distributed/client.py:2345: in gather
    return self.sync(
.tox/min_versions/lib/python3.9/site-packages/distributed/utils.py:349: in sync
    return sync(
.tox/min_versions/lib/python3.9/site-packages/distributed/utils.py:416: in sync
    raise exc.with_traceback(tb)
.tox/min_versions/lib/python3.9/site-packages/distributed/utils.py:389: in f
    result = yield future
.tox/min_versions/lib/python3.9/site-packages/tornado/gen.py:766: in run
    value = future.result()
.tox/min_versions/lib/python3.9/site-packages/distributed/client.py:2208: in _gather
    raise exception.with_traceback(traceback)
.tox/min_versions/lib/python3.9/site-packages/dask/optimization.py:990: in __call__
    return core.get(self.dsk, self.outkey, dict(zip(self.inkeys, args)))
.tox/min_versions/lib/python3.9/site-packages/dask/core.py:149: in get
    result = _execute_task(task, cache)
.tox/min_versions/lib/python3.9/site-packages/dask/core.py:119: in _execute_task
    return func(*(_execute_task(a, cache) for a in args))
.tox/min_versions/lib/python3.9/site-packages/dask/utils.py:73: in apply
    return func(*args, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/dask/dataframe/core.py:7006: in apply_and_enforce
    df = func(*args, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/dask/utils.py:1105: in __call__
    return getattr(__obj, self.method)(*args, **kwargs)
.tox/min_versions/lib/python3.9/site-packages/pandas/core/frame.py:10037: in apply
    return op.apply().__finalize__(self, method="apply")
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:831: in apply
    return self.apply_standard()
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:957: in apply_standard
    results, res_index = self.apply_series_generator()
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:973: in apply_series_generator
    results[i] = self.func(v, *self.args, **self.kwargs)
region_grower/synthesize_morphologies.py:182: in _parallel_wrapper
    new_cell = space_worker.synthesize()
region_grower/context.py:560: in synthesize
    return self._synthesize_once(rng)
region_grower/context.py:645: in _synthesize_once
    graft_axon(grower.neuron, axon_morph, rng=rng)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:158: in graft_axon
    position = grafting_position(neuron, axon_or_donor_neuron, rng)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:131: in grafting_position
    axon_direction = _random_direction(axis=_dendrites_mean_direction(neuron),
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:90: in _random_direction
    orthogonal = _rotate_vector(orthogonal, axis, rng.uniform(low=0., high=2. * np.pi))
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:80: in _rotate_vector
    return np.dot(_rotation_around_axis(axis, angle), vec)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:61: in _rotation_around_axis
    d = np.array(axis, dtype=np.float) / np.linalg.norm(axis)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   raise AttributeError(__former_attrs__[attr])
E   AttributeError: module 'numpy' has no attribute 'float'.
E   `np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
E   The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
E       https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

.tox/min_versions/lib/python3.9/site-packages/numpy/__init__.py:324: AttributeError

Check failure on line 791 in tests/test_synthesize_morphologies.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_synthesize_morphologies.test_inconsistent_context

AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
Raw output
neuron = <morphio._morphio.mut.Morphology object at 0x7fa025f1d7f0>
axon_or_donor_neuron = <morphio._morphio.mut.Morphology object at 0x7fa0261670f0>
rng = Generator(PCG64) at 0x7FA025F2DBA0

    def grafting_position(neuron, axon_or_donor_neuron, rng=np.random):
        '''Find out where to put the grafted axon
    
        If the neuron to be grafted already has a neuron reuse its starting point
    
        Otherwise try to mimic the position of the axon with respect to dendrites in
        the donor axon. The position is choosen in order to
        preserve the direction between the axon initial segment direction
        and all other dendrites initial segments directions
    
        Returns:
            The position where to graft the neuron
        '''
        try:
>           old_axon = find_axon(neuron)

.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:128: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

axon_or_donor_axon = <morphio._morphio.mut.Morphology object at 0x7fa025f1d7f0>

    def find_axon(axon_or_donor_axon):
        """Find the root section which is an axon.
    
        If the number of axons found is greater than 1, then return the first axon.
        """
    
        if isinstance(axon_or_donor_axon, (ImmutSection, Section)):
            if axon_or_donor_axon.type == SectionType.axon:
                return axon_or_donor_axon
            else:
                raise MorphToolException('The section: {} is not an axon'.format(axon_or_donor_axon))
    
        axons = [root for root in axon_or_donor_axon.root_sections
                 if root.type == SectionType.axon]
    
        if not axons:
>           raise NoAxonException('No axon found!')
E           morph_tool.exceptions.NoAxonException: No axon found!

.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:33: NoAxonException

During handling of the above exception, another exception occurred:

tmpdir = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_inconsistent_context0')
small_O1_path = '/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/atlas_small_O10'
input_cells = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_inconsistent_context0/input_cells.mvd3')
axon_morph_tsv = local('/home/runner/work/region-grower/region-grower/.tox/min_versions/tmp/test_inconsistent_context0/axon_morphs.tsv')
caplog = <_pytest.logging.LogCaptureFixture object at 0x7fa026813a60>

    def test_inconsistent_context(
        tmpdir,
        small_O1_path,
        input_cells,
        axon_morph_tsv,
        caplog,
    ):  # pylint: disable=unused-argument
        """Test morphology synthesis with inconsistent context constraints."""
        min_depth = 25
        tmp_folder = Path(tmpdir)
    
        args = create_args(
            False,
            tmp_folder,
            input_cells,
            small_O1_path,
            axon_morph_tsv,
            "apical_NRN_sections.yaml",
            min_depth,
            DATA / "region_structure.yaml",
        )
        args["nb_processes"] = 0
    
        with args["tmd_parameters"].open("r", encoding="utf-8") as f:
            tmd_parameters = json.load(f)
    
        tmd_parameters["default"]["L2_TPC:A"]["context_constraints"] = {
            "apical_dendrite": {
                "extent_to_target": {
                    "slope": 0.5,
                    "intercept": 1,
                    "layer": 1,
                    "fraction": 0.5,
                }
            }
        }
    
        args["tmd_parameters"] = tmp_folder / "tmd_parameters.json"
        with args["tmd_parameters"].open("w", encoding="utf-8") as f:
            json.dump(tmd_parameters, f)
    
        synthesizer = SynthesizeMorphologies(**args)
        caplog.set_level(logging.WARNING)
        caplog.clear()
>       synthesizer.synthesize()

tests/test_synthesize_morphologies.py:791: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
region_grower/synthesize_morphologies.py:802: in synthesize
    res = self.compute()
region_grower/synthesize_morphologies.py:687: in compute
    computed = self.cells_data.apply(
.tox/min_versions/lib/python3.9/site-packages/pandas/core/frame.py:10037: in apply
    return op.apply().__finalize__(self, method="apply")
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:831: in apply
    return self.apply_standard()
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:957: in apply_standard
    results, res_index = self.apply_series_generator()
.tox/min_versions/lib/python3.9/site-packages/pandas/core/apply.py:973: in apply_series_generator
    results[i] = self.func(v, *self.args, **self.kwargs)
region_grower/synthesize_morphologies.py:688: in <lambda>
    lambda row: _parallel_wrapper(row, **func_kwargs), axis=1
region_grower/synthesize_morphologies.py:182: in _parallel_wrapper
    new_cell = space_worker.synthesize()
region_grower/context.py:560: in synthesize
    return self._synthesize_once(rng)
region_grower/context.py:645: in _synthesize_once
    graft_axon(grower.neuron, axon_morph, rng=rng)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:158: in graft_axon
    position = grafting_position(neuron, axon_or_donor_neuron, rng)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:131: in grafting_position
    axon_direction = _random_direction(axis=_dendrites_mean_direction(neuron),
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:90: in _random_direction
    orthogonal = _rotate_vector(orthogonal, axis, rng.uniform(low=0., high=2. * np.pi))
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:80: in _rotate_vector
    return np.dot(_rotation_around_axis(axis, angle), vec)
.tox/min_versions/lib/python3.9/site-packages/morph_tool/graft.py:61: in _rotation_around_axis
    d = np.array(axis, dtype=np.float) / np.linalg.norm(axis)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

attr = 'float'

    def __getattr__(attr):
        # Warn for expired attributes, and return a dummy function
        # that always raises an exception.
        import warnings
        import math
        try:
            msg = __expired_functions__[attr]
        except KeyError:
            pass
        else:
            warnings.warn(msg, DeprecationWarning, stacklevel=2)
    
            def _expired(*args, **kwds):
                raise RuntimeError(msg)
    
            return _expired
    
        # Emit warnings for deprecated attributes
        try:
            val, msg = __deprecated_attrs__[attr]
        except KeyError:
            pass
        else:
            warnings.warn(msg, DeprecationWarning, stacklevel=2)
            return val
    
        if attr in __future_scalars__:
            # And future warnings for those that will change, but also give
            # the AttributeError
            warnings.warn(
                f"In the future `np.{attr}` will be defined as the "
                "corresponding NumPy scalar.", FutureWarning, stacklevel=2)
    
        if attr in __former_attrs__:
>           raise AttributeError(__former_attrs__[attr])
E           AttributeError: module 'numpy' has no attribute 'float'.
E           `np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
E           The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
E               https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

.tox/min_versions/lib/python3.9/site-packages/numpy/__init__.py:324: AttributeError