Fix: Make bifurcation angles globally invariant #535
GitHub Actions / JUnit Test Report
failed
Nov 19, 2024 in 0s
224 tests run, 222 passed, 0 skipped, 2 failed.
Annotations
github-actions / JUnit Test Report
test_grower.test_grow__run[Use global numpy random seed]
TypeError: argument of type 'SpaceColonizationContext' is not iterable
Raw output
rng_type = 'global'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7feb52fc3670>
@pytest.mark.parametrize(
"rng_type",
[
pytest.param("global", id="Use global numpy random seed"),
pytest.param("legacy", id="Use RNG instance with legacy constructor"),
],
)
def test_grow__run(rng_type, monkeypatch):
"""Test the astrocyte grower."""
parameters = _parameters()
distributions = _distributions()
context = _context()
if rng_type == "global":
rng = _global_rng()
elif rng_type == "legacy":
rng = _legacy_rng()
else:
raise ValueError("Bad rng_type")
# In this test all the cos and arccos values are rounded because np.cos and np.arccos
# functions can return different value, depending on the system libraries used to actually
# compute these values.
monkeypatch.setattr(np, "cos", _rounded_cos)
monkeypatch.setattr(np, "arccos", _rounded_arccos)
> astro_grower = AstrocyteGrower(
input_distributions=distributions,
input_parameters=parameters,
context=context,
rng_or_seed=rng,
)
tests/astrocyte/test_grower.py:265:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
neurots/astrocyte/grower.py:94: in __init__
super().__init__(
neurots/generate/grower.py:96: in __init__
self.context = self._process_context(context)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <neurots.astrocyte.grower.AstrocyteGrower object at 0x7feb535b4e50>
context = <neurots.astrocyte.context.SpaceColonizationContext object at 0x7feb535b4f40>
def _process_context(self, context):
"""Apply some required processing to the context dictionary."""
if context is None:
context = {}
# we ofen need to use the y_direction as a rotation, so we save to it once here
> if "y_direction" in context:
E TypeError: argument of type 'SpaceColonizationContext' is not iterable
neurots/generate/grower.py:146: TypeError
github-actions / JUnit Test Report
test_grower.test_grow__run[Use RNG instance with legacy constructor]
TypeError: argument of type 'SpaceColonizationContext' is not iterable
Raw output
rng_type = 'legacy'
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7feb535f0d00>
@pytest.mark.parametrize(
"rng_type",
[
pytest.param("global", id="Use global numpy random seed"),
pytest.param("legacy", id="Use RNG instance with legacy constructor"),
],
)
def test_grow__run(rng_type, monkeypatch):
"""Test the astrocyte grower."""
parameters = _parameters()
distributions = _distributions()
context = _context()
if rng_type == "global":
rng = _global_rng()
elif rng_type == "legacy":
rng = _legacy_rng()
else:
raise ValueError("Bad rng_type")
# In this test all the cos and arccos values are rounded because np.cos and np.arccos
# functions can return different value, depending on the system libraries used to actually
# compute these values.
monkeypatch.setattr(np, "cos", _rounded_cos)
monkeypatch.setattr(np, "arccos", _rounded_arccos)
> astro_grower = AstrocyteGrower(
input_distributions=distributions,
input_parameters=parameters,
context=context,
rng_or_seed=rng,
)
tests/astrocyte/test_grower.py:265:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
neurots/astrocyte/grower.py:94: in __init__
super().__init__(
neurots/generate/grower.py:96: in __init__
self.context = self._process_context(context)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <neurots.astrocyte.grower.AstrocyteGrower object at 0x7feb535f02e0>
context = <neurots.astrocyte.context.SpaceColonizationContext object at 0x7feb535f0760>
def _process_context(self, context):
"""Apply some required processing to the context dictionary."""
if context is None:
context = {}
# we ofen need to use the y_direction as a rotation, so we save to it once here
> if "y_direction" in context:
E TypeError: argument of type 'SpaceColonizationContext' is not iterable
neurots/generate/grower.py:146: TypeError
Loading