Skip to content

Deprecation warning from cachetools v7 #8106

@ricardoV94

Description

@ricardoV94

Description

Started failing in the CI, I pinned it #8105 (c32715a)

================================== FAILURES ===================================
__________________________ test_fit_with_nans[True] ___________________________

score = True

    @pytest.mark.parametrize("score", [True, False])
    def test_fit_with_nans(score):
        X_mean = pm.floatX(np.linspace(0, 10, 10))
        y = pm.floatX(np.random.normal(X_mean * 4, 0.05))
        with pm.Model():
            inp = pm.Normal("X", X_mean, size=X_mean.shape)
            coef = pm.Normal("b", 4.0)
            mean = inp * coef
            pm.Normal("y", mean, 0.1, observed=y)
            with pytest.raises(FloatingPointError) as e:
>               advi = pm.fit(100, score=score, obj_optimizer=pm.adam(learning_rate=float("nan")))
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests\variational\test_inference.py:44: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pymc\variational\inference.py:775: in fit
    return inference.fit(n, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
pymc\variational\inference.py:158: in fit
    step_func = self.objective.step_function(score=score, **kwargs)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
C:\Users\runneradmin\micromamba\envs\pymc-test\Lib\site-packages\pytensor\configparser.py:44: in res
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
pymc\variational\opvi.py:393: in step_function
    updates = self.updates(
pymc\variational\opvi.py:268: in updates
    self.add_obj_updates(
pymc\variational\opvi.py:313: in add_obj_updates
    obj_target = self(
C:\Users\runneradmin\micromamba\envs\pymc-test\Lib\site-packages\pytensor\configparser.py:44: in res
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
pymc\variational\opvi.py:458: in __call__
    a = self.op.apply(self.tf)
        ^^^^^^^^^^^^^^^^^^^^^^
pymc\variational\operators.py:63: in apply
    return -self.datalogp_norm + self.beta * (self.logq_norm - self.varlogp_norm)
            ^^^^^^^^^^^^^^^^^^
pymc\variational\opvi.py:498: in <lambda>
    datalogp_norm = property(lambda self: self.approx.datalogp_norm)
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^
C:\Users\runneradmin\micromamba\envs\pymc-test\Lib\site-packages\cachetools\_cachedmethod.py:124: in __call__
    _warn_classmethod(stacklevel=3)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

stacklevel = 3

    def _warn_classmethod(stacklevel):
>       warnings.warn(
            "decorating class methods with @cachedmethod is deprecated",
            DeprecationWarning,
            stacklevel=stacklevel,
        )
E       DeprecationWarning: decorating class methods with @cachedmethod is deprecated

C:\Users\runneradmin\micromamba\envs\pymc-test\Lib\site-packages\cachetools\_cachedmethod.py:11: DeprecationWarning
__________________________ test_fit_with_nans[False] __________________________

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions