Skip to content

Remove some dev envs for older python versions. #5842

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

twiecki
Copy link
Member

@twiecki twiecki commented Jun 3, 2022

…ove pandas from envs.

Thank your for opening a PR!

Before you proceed, please make sure that the pre-commit linting/style checks pass.

Depending on what your PR does, here are a few things you might want to address in the description:

  • what are the (breaking) changes that this PR makes?
  • important background, or details about the implementation
  • are the changes—especially new features—covered by tests and docstrings?
  • consider adding/updating relevant example notebooks
  • right before it's ready to merge, mention the PR in the RELEASE-NOTES.md

@twiecki twiecki requested a review from ricardoV94 June 3, 2022 13:26
@codecov
Copy link

codecov bot commented Jun 3, 2022

Codecov Report

Merging #5842 (d11aad2) into main (3bf95ce) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #5842   +/-   ##
=======================================
  Coverage   89.50%   89.50%           
=======================================
  Files          73       73           
  Lines       13267    13267           
=======================================
  Hits        11874    11874           
  Misses       1393     1393           

@twiecki
Copy link
Member Author

twiecki commented Jun 3, 2022

Weird windows error:

C:\Miniconda3\envs\pymc-test-py38\lib\site-packages\aesara\graph\basic.py:1169: TypeError
---------------------------- Captured stdout call -----------------------------
\u2588\r\u2588\r\u2588\r\u2588\r
---------------------------- Captured stderr call -----------------------------
Auto-assigning NUTS sampler...
Initializing NUTS using jitter+adapt_diag...
Sequential sampling (2 chains in 1 job)
NUTS: [a]
Sampling 2 chains for 1_000 tune and 1_000 draw iterations (2_000 + 2_000 draws total) took 3 seconds.
Auto-assigning NUTS sampler...
Initializing NUTS using jitter+adapt_diag...
Sequential sampling (2 chains in 1 job)
NUTS: [a]
Sampling 2 chains for 1_000 tune and 1_000 draw iterations (2_000 + 2_000 draws total) took 3 seconds.
------------------------------ Captured log call ------------------------------
INFO     pymc:sampling.py:532 Auto-assigning NUTS sampler...
INFO     pymc:sampling.py:2480 Initializing NUTS using jitter+adapt_diag...
INFO     pymc:sampling.py:647 Sequential sampling (2 chains in 1 job)
INFO     pymc:sampling.py:244 NUTS: [a]
INFO     pymc:sampling.py:676 Sampling 2 chains for 1_000 tune and 1_000 draw iterations (2_000 + 2_000 draws total) took 3 seconds.
INFO     pymc:sampling.py:532 Auto-assigning NUTS sampler...
INFO     pymc:sampling.py:2480 Initializing NUTS using jitter+adapt_diag...
INFO     pymc:sampling.py:647 Sequential sampling (2 chains in 1 job)
INFO     pymc:sampling.py:244 NUTS: [a]
INFO     pymc:sampling.py:676 Sampling 2 chains for 1_000 tune and 1_000 draw iterations (2_000 + 2_000 draws total) took 3 seconds.
_________________________ test_no_init_nuts_compound __________________________

caplog = <_pytest.logging.LogCaptureFixture object at 0x0000014D8A9ED1F0>

    def test_no_init_nuts_compound(caplog):
        with pm.Model() as model:
            a = pm.Normal("a")
            b = pm.Poisson("b", 1)
>           pm.sample(10, tune=10)

pymc\tests\test_sampling.py:1488: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pymc\sampling.py:524: in sample
    step = assign_step_methods(model, step, methods=pm.STEP_METHODS, step_kwargs=kwargs)
pymc\sampling.py:229: in assign_step_methods
    return instantiate_steppers(model, steps, selected_steps, step_kwargs)
pymc\sampling.py:147: in instantiate_steppers
    step = step_class(vars=vars, model=model, **args)
pymc\step_methods\metropolis.py:229: in __init__
    self.delta_logp = delta_logp(initial_values, model.logpt(), vars, shared)
pymc\step_methods\metropolis.py:1049: in delta_logp
    [logp0], inarray0 = pm.join_nonshared_inputs(point, [logp], vars, shared)
pymc\aesaraf.py:668: in join_nonshared_inputs
    xs_special = [aesara.clone_replace(x, replace, strict=False) for x in xs]
pymc\aesaraf.py:668: in <listcomp>
    xs_special = [aesara.clone_replace(x, replace, strict=False) for x in xs]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

output = __logp, replace = {b: Subtensor{int64}.0, a: a_shared}
rebuild_kwds = {'strict': False}
rebuild_collect_shared = <function rebuild_collect_shared at 0x0000014DFAF24820>
items = [(b, Subtensor{int64}.0), (a, a_shared)]
tmp_replace = [(b, <TensorType(int64, ())>), (a, <TensorType(float32, ())>)]
new_replace = [(<TensorType(int64, ())>, Subtensor{int64}.0), (<TensorType(float32, ())>, a_shared)]

    def clone_replace(
        output: Collection[Variable],
        replace: Optional[
            Union[Iterable[Tuple[Variable, Variable]], Dict[Variable, Variable]]
        ] = None,
        **rebuild_kwds,
    ) -> List[Variable]:
        """Clone a graph and replace subgraphs within it.
    
        It returns a copy of the initial subgraph with the corresponding
        substitutions.
    
        Parameters
        ----------
        output
            Aesara expression that represents the computational graph.
        replace
            Dictionary describing which subgraphs should be replaced by what.
        rebuild_kwds
            Keywords to `rebuild_collect_shared`.
    
        """
        from aesara.compile.function.pfunc import rebuild_collect_shared
    
        items: Union[List[Tuple[Variable, Variable]], Tuple[Tuple[Variable, Variable], ...]]
        if isinstance(replace, dict):
            items = list(replace.items())
        elif isinstance(replace, (list, tuple)):
            items = replace
        elif replace is None:
            items = []
        else:
            raise ValueError(
                (
                    "replace is neither a dictionary, list, "
                    f"tuple or None ! The value provided is {replace},"
                    f"of type {type(replace)}"
                )
            )
        tmp_replace = [(x, x.type()) for x, y in items]
        new_replace = [(x, y) for ((_, x), (_, y)) in zip(tmp_replace, items)]
>       _, _outs, _ = rebuild_collect_shared(output, [], tmp_replace, [], **rebuild_kwds)
E       TypeError: rebuild_collect_shared() got an unexpected keyword argument 'strict'

@twiecki
Copy link
Member Author

twiecki commented Jun 3, 2022

@brandonwillard Could this be an aesara bug that got introduced in 2.7.0?

@brandonwillard
Copy link
Contributor

brandonwillard commented Jun 3, 2022

@brandonwillard Could this be an aesara bug that got introduced in 2.7.0?

No, that's a change in the clone_replace API.

@brandonwillard
Copy link
Contributor

#5849 should fix that issue.

@danhphan danhphan mentioned this pull request Jun 4, 2022
4 tasks
@twiecki
Copy link
Member Author

twiecki commented Jun 6, 2022

That looks like a legit error:

__________________________ test_empirical_from_trace __________________________
another_simple_model = <pymc.model.Model object at 0x00000210ABB23CA0>
    def test_empirical_from_trace(another_simple_model):
        with another_simple_model:
>           step = pm.Metropolis()
pymc\tests\test_variational_inference.py:785: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pymc\step_methods\metropolis.py:229: in __init__
    self.delta_logp = delta_logp(initial_values, model.logpt(), vars, shared)
pymc\step_methods\metropolis.py:1049: in delta_logp
    [logp0], inarray0 = pm.join_nonshared_inputs(point, [logp], vars, shared)
pymc\aesaraf.py:668: in join_nonshared_inputs
    xs_special = [aesara.clone_replace(x, replace, strict=False) for x in xs]
pymc\aesaraf.py:668: in <listcomp>
    xs_special = [aesara.clone_replace(x, replace, strict=False) for x in xs]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
output = __logp, replace = {x: Reshape{1}.0}, rebuild_kwds = {'strict': False}
rebuild_collect_shared = <function rebuild_collect_shared at 0x000002109D7A4820>
items = [(x, Reshape{1}.0)], tmp_replace = [(x, <TensorType(float64, (None,))>)]
new_replace = [(<TensorType(float64, (None,))>, Reshape{1}.0)]
    def clone_replace(
        output: Collection[Variable],
        replace: Optional[
            Union[Iterable[Tuple[Variable, Variable]], Dict[Variable, Variable]]
        ] = None,
        **rebuild_kwds,
    ) -> List[Variable]:
        """Clone a graph and replace subgraphs within it.
        It returns a copy of the initial subgraph with the corresponding
        substitutions.
        Parameters
        ----------
        output
            Aesara expression that represents the computational graph.
        replace
            Dictionary describing which subgraphs should be replaced by what.
        rebuild_kwds
            Keywords to `rebuild_collect_shared`.
        """
        from aesara.compile.function.pfunc import rebuild_collect_shared
        items: Union[List[Tuple[Variable, Variable]], Tuple[Tuple[Variable, Variable], ...]]
        if isinstance(replace, dict):
            items = list(replace.items())
        elif isinstance(replace, (list, tuple)):
            items = replace
        elif replace is None:
            items = []
        else:
            raise ValueError(
                (
                    "replace is neither a dictionary, list, "
                    f"tuple or None ! The value provided is {replace},"
                    f"of type {type(replace)}"
                )
            )
        tmp_replace = [(x, x.type()) for x, y in items]
        new_replace = [(x, y) for ((_, x), (_, y)) in zip(tmp_replace, items)]
>       _, _outs, _ = rebuild_collect_shared(output, [], tmp_replace, [], **rebuild_kwds)
E       TypeError: rebuild_collect_shared() got an unexpected keyword argument 'strict'

@ricardoV94
Copy link
Member

ricardoV94 commented Jun 7, 2022

The kwarg changed, #5849

@ricardoV94 ricardoV94 marked this pull request as draft June 17, 2022 10:36
@ricardoV94 ricardoV94 changed the title Pin aesara 2.7.0. Remove some dev envs for older python versions. Rem… Remove some dev envs for older python versions. Jun 17, 2022
@twiecki twiecki force-pushed the upgrade_aesara_rm_envs branch from c5eb9c3 to 5d00d32 Compare June 17, 2022 11:03
@@ -17,7 +17,6 @@ dependencies:
- libblas=*=*mkl
- mkl-service
- numpy>=1.15.0
- pandas>=0.24.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we have tests that cover pandas functionality? We would still want to test even if it's a user optional dependency

@ricardoV94
Copy link
Member

Closing this in favor of #5911

@ricardoV94 ricardoV94 closed this Jun 20, 2022
@twiecki twiecki deleted the upgrade_aesara_rm_envs branch June 20, 2022 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants