Skip to content

Fix: Make bifurcation angles globally invariant #535

Fix: Make bifurcation angles globally invariant

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

Check failure on line 265 in .tox/docs/lib/python3.11/site-packages/sklearn/ensemble/_hist_gradient_boosting/tests/test_grower.py

See this annotation in the file changed.

@github-actions 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 0x7ff294011250>

    @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 0x7ff2b7f9c310>
context = <neurots.astrocyte.context.SpaceColonizationContext object at 0x7ff294155b10>

    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

Check failure on line 265 in .tox/docs/lib/python3.11/site-packages/sklearn/ensemble/_hist_gradient_boosting/tests/test_grower.py

See this annotation in the file changed.

@github-actions 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 0x7ff293f1a950>

    @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 0x7ff293f1a290>
context = <neurots.astrocyte.context.SpaceColonizationContext object at 0x7ff293f19650>

    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