Skip to content

Remove SGMCMC and fix flaky mypy results #5631

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

Merged
merged 3 commits into from
Mar 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ repos:
- types-filelock
- types-setuptools
- arviz
- aesara==2.4.0
- aeppl==0.0.26
Copy link
Member

Choose a reason for hiding this comment

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

Oh great, even more places for the dependencies xD

Copy link
Member Author

Choose a reason for hiding this comment

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

You can't imagine how delighted I was to learn that the greatness of YAML required me to add the dependencies in yet another place! </sarcasm>

- aesara==2.5.1
- aeppl==0.0.27
always_run: true
require_serial: true
pass_filenames: false
Expand Down
2 changes: 1 addition & 1 deletion RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ We plan to get these working again, but at this point their inner workings have
- Timeseries distributions (see [#4642](https://github.com/pymc-devs/pymc/issues/4642))
- Nested Mixture distributions (see [#5533](https://github.com/pymc-devs/pymc/issues/5533))
- Elliptical slice sampling (see [#5137](https://github.com/pymc-devs/pymc/issues/5137))
- `BaseStochasticGradient` (see [#5138](https://github.com/pymc-devs/pymc/issues/5138))
- `pm.sample_posterior_predictive_w` (see [#4807](https://github.com/pymc-devs/pymc/issues/4807))
- Partially observed Multivariate distributions (see [#5260](https://github.com/pymc-devs/pymc/issues/5260))

Expand All @@ -28,6 +27,7 @@ Also check out the [milestones](https://github.com/pymc-devs/pymc/milestones) fo
All of the above apply to:

- BART was removed [#5566](https://github.com/pymc-devs/pymc/pull/5566). It is now available from [pymc-experimental](https://github.com/pymc-devs/pymc-experimental)
- `BaseStochasticGradient` was removed (see [#5630](https://github.com/pymc-devs/pymc/pull/5630))
- ⚠ The library is now named, installed and imported as "pymc". For example: `pip install pymc`.
- ⚠ Theano-PyMC has been replaced with Aesara, so all external references to `theano`, `tt`, and `pymc3.theanof` need to be replaced with `aesara`, `at`, and `pymc.aesaraf` (see [4471](https://github.com/pymc-devs/pymc/pull/4471)).
- `pm.Distribution(...).logp(x)` is now `pm.logp(pm.Distribution(...), x)`.
Expand Down
2 changes: 1 addition & 1 deletion pymc/distributions/shape_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,4 +618,4 @@ def find_size(

def rv_size_is_none(size: Variable) -> bool:
"""Check wether an rv size is None (ie., at.Constant([]))"""
return size.type.shape == (0,)
return size.type.shape == (0,) # type: ignore [attr-defined]
3 changes: 3 additions & 0 deletions pymc/sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@

from aesara.compile.mode import Mode
from aesara.graph.basic import Constant, Variable
from aesara.tensor import TensorVariable
from aesara.tensor.sharedvar import SharedVariable
from arviz import InferenceData
from fastprogress.fastprogress import progress_bar
Expand Down Expand Up @@ -1690,6 +1691,8 @@ def sample_posterior_predictive(
return trace
return {}

inputs: Sequence[TensorVariable]
input_names: Sequence[str]
if not hasattr(_trace, "varnames"):
inputs_and_names = [
(rv, rv.name)
Expand Down
226 changes: 0 additions & 226 deletions pymc/step_methods/sgmcmc.py

This file was deleted.

6 changes: 5 additions & 1 deletion scripts/run_mypy.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,11 @@ def check_no_unexpected_results(mypy_lines: Iterator[str]):
print("\n".join(sorted(map(str, unexpected_failing))))
sys.exit(1)

if unexpected_passing:
if unexpected_passing == {"pymc/sampling_jax.py"}:
print("Letting you know that 'pymc/sampling_jax.py' unexpectedly passed.")
print("But this file is known to sometimes pass and sometimes not.")
print("Unless tried to resolve problems in sampling_jax.py just ignore this message.")
elif unexpected_passing:
print(f"{len(unexpected_passing)} files unexpectedly passed the type checks:")
print("\n".join(sorted(map(str, unexpected_passing))))
print("This is good news! Go to scripts/run-mypy.py and add them to the list.")
Expand Down