Skip to content

Deprecate those kwargs in v3 that will break in v4 #5226

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 5 commits into from
Dec 12, 2021
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
27 changes: 13 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
exclude: ^(docs/logos|pymc3/tests/data)/
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
rev: v4.0.1
hooks:
- id: check-merge-conflict
- id: check-toml
Expand All @@ -14,44 +14,43 @@ repos:
exclude: ^requirements-dev\.txt$
- id: trailing-whitespace
- repo: https://github.com/PyCQA/isort
rev: 5.7.0
rev: 5.10.1
hooks:
- id: isort
name: isort
- repo: https://github.com/asottile/pyupgrade
rev: v2.10.0
rev: v2.29.1
hooks:
- id: pyupgrade
args: [--py37-plus]
- repo: https://github.com/psf/black
rev: 20.8b1
rev: 21.12b0
hooks:
- id: black
- repo: https://github.com/PyCQA/pylint
rev: pylint-2.6.0
rev: v2.12.2
hooks:
- id: pylint
args: [--rcfile=.pylintrc]
files: ^pymc3/
files: ^pymc/
- repo: https://github.com/MarcoGorelli/madforhooks
rev: 0.2.1
hooks:
- id: conda-env-sorter
files: ^conda-envs/environment-dev-py.+\.yml$
- repo: local
hooks:
- id: check-no-tests-are-ignored
additional_dependencies: [pandas,pyyaml]
entry: python scripts/check_all_tests_are_covered.py
files: ^\.github/workflows/pytest\.yml$
language: python
name: Check no tests are ignored
pass_filenames: false
- id: conda-env-sort
additional_dependencies: [pyyaml]
entry: python scripts/sort_conda_envs.py
files: ^conda-envs/environment-dev-py37\.yml$
language: python
name: Sort dependencies in conda envs
types: [yaml]
- id: pip-from-conda
additional_dependencies: [pyyaml]
entry: python scripts/generate_pip_deps_from_conda.py
files: ^conda-envs/
files: ^conda-envs/environment-dev-py.+.yml$
language: python
name: Generate pip dependency from conda
- id: no-relative-imports
Expand Down
2 changes: 2 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
## PyMC 3.11.5 (TBD)
### Backports
+ The `pm.logp(rv, x)` syntax is now available and recommended to make your model code `v4`-ready. Note that this backport is just an alias and much less capable than what's available with `pymc >=4` (see [#5083](https://github.com/pymc-devs/pymc/pulls/5083)).
+ The `pm.Distribution(testval=...)` kwarg was deprecated and will be replaced by `pm.Distribution(initval=...)`in `pymc >=4` (see [#5226](https://github.com/pymc-devs/pymc/pulls/5226)).
+ The `pm.sample(start=...)` kwarg was deprecated and will be replaced by `pm.sample(initvals=...)`in `pymc >=4` (see [#5226](https://github.com/pymc-devs/pymc/pulls/5226)).

## PyMC3 3.11.4 (20 August 2021)

Expand Down
3 changes: 3 additions & 0 deletions conda-envs/environment-dev-py37.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ dependencies:
- numpy=1.15
- numpydoc>=0.9
- pandas=0.24
- pip
- pre-commit>=2.8.0
- pytest-cov>=2.5
- pytest>=3.0
Expand All @@ -21,3 +22,5 @@ dependencies:
- sphinx-autobuild>=0.7
- sphinx>=1.5
- watermark
- pip:
- deprecat
3 changes: 3 additions & 0 deletions conda-envs/environment-dev-py38.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ dependencies:
- mkl-service
- nbsphinx>=0.4
- numpydoc>=0.9
- pip
- pre-commit>=2.8.0
- pytest-cov>=2.5
- pytest>=3.0
Expand All @@ -18,3 +19,5 @@ dependencies:
- sphinx-autobuild>=0.7
- sphinx>=1.5
- watermark
- pip:
- deprecat
3 changes: 3 additions & 0 deletions conda-envs/environment-dev-py39.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ dependencies:
- mkl-service
- nbsphinx>=0.4
- numpydoc>=0.9
- pip
- pre-commit>=2.8.0
- pytest-cov>=2.5
- pytest>=3.0
Expand All @@ -18,3 +19,5 @@ dependencies:
- sphinx-autobuild>=0.7
- sphinx>=1.5
- watermark
- pip:
- deprecat
2 changes: 2 additions & 0 deletions conda-envs/windows-environment-dev-py38.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ dependencies:
- sphinx-autobuild>=0.7
- sphinx>=1.5
- watermark
- pip:
- deprecat
127 changes: 127 additions & 0 deletions docs/source/_static/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,130 @@
margin: 0.5em;
content: ":";
}

:root {
--pst-color-primary: 19, 6, 84;
--pst-color-success: 40, 167, 69;
--pst-color-info: 0, 123, 255; /*23, 162, 184;*/
--pst-color-warning: 255, 193, 7;
--pst-color-danger: 220, 53, 69;
--pst-color-text-base: 51, 51, 51;

--pst-color-admonition-default: var(--pst-color-info);
--pst-color-admonition-note: var(--pst-color-info);
--pst-color-admonition-attention: var(--pst-color-warning);
--pst-color-admonition-caution: var(--pst-color-warning);
--pst-color-admonition-warning: var(--pst-color-warning);
--pst-color-admonition-danger: var(--pst-color-danger);
--pst-color-admonition-error: var(--pst-color-danger);
--pst-color-admonition-hint: var(--pst-color-success);
--pst-color-admonition-tip: var(--pst-color-success);
--pst-color-admonition-important: var(--pst-color-success);
}

.admonition,
div.admonition {
margin:1.5625em auto;
padding:0 .6rem .8rem;
overflow:hidden;
page-break-inside:avoid;
border-left:.2rem solid;
border-left-color:rgba(var(--pst-color-admonition-default),1);
border-bottom-color:rgba(var(--pst-color-admonition-default),1);
border-right-color:rgba(var(--pst-color-admonition-default),1);
border-top-color:rgba(var(--pst-color-admonition-default),1);
border-radius:.2rem;
box-shadow:0 .2rem .5rem rgba(0,0,0,.05),0 0 .0625rem rgba(0,0,0,.1);
transition:color .25s,background-color .25s,border-color .25s
}
.admonition :last-child,
div.admonition :last-child {
margin-bottom:0
}
.admonition p.admonition-title~*,
div.admonition p.admonition-title~* {
padding:0 1.4rem
}
.admonition>ol,
.admonition>ul,
div.admonition>ol,
div.admonition>ul {
margin-left:1em
}
.admonition>.admonition-title,
div.admonition>.admonition-title {
position:relative;
margin:0 -.6rem;
padding:.4rem .6rem .4rem 2rem;
font-weight:700;
background-color:rgba(var(--pst-color-admonition-default),.1)
}
.admonition>.admonition-title+*,
div.admonition>.admonition-title+* {
margin-top:.4em
}
.admonition.attention,
div.admonition.attention {
border-color:rgba(var(--pst-color-admonition-attention),1)
}
.admonition.attention>.admonition-title,
div.admonition.attention>.admonition-title {
background-color:rgba(var(--pst-color-admonition-attention),.1)
}
.admonition.caution,
div.admonition.caution {
border-color:rgba(var(--pst-color-admonition-caution),1)
}
.admonition.caution>.admonition-title,
div.admonition.caution>.admonition-title {
background-color:rgba(var(--pst-color-admonition-caution),.1)
}
div.admonition.warning {
border-color:rgba(var(--pst-color-admonition-warning),1)
}
.admonition.warning>.admonition-title,
div.admonition.warning>.admonition-title {
background-color:rgba(var(--pst-color-admonition-warning),.1)
}
div.admonition.danger {
border-color:rgba(var(--pst-color-admonition-danger),1)
}
.admonition.danger>.admonition-title,
div.admonition.danger>.admonition-title {
background-color:rgba(var(--pst-color-admonition-danger),.1)
}
div.admonition.error {
border-color:rgba(var(--pst-color-admonition-error),1)
}
.admonition.error>.admonition-title,
div.admonition.error>.admonition-title {
background-color:rgba(var(--pst-color-admonition-error),.1)
}
div.admonition.hint {
border-color:rgba(var(--pst-color-admonition-hint),1)
}
.admonition.hint>.admonition-title,
div.admonition.hint>.admonition-title {
background-color:rgba(var(--pst-color-admonition-hint),.1)
}
div.admonition.tip {
border-color:rgba(var(--pst-color-admonition-tip),1)
}
.admonition.tip>.admonition-title,
div.admonition.tip>.admonition-title {
background-color:rgba(var(--pst-color-admonition-tip),.1)
}
div.admonition.important {
border-color:rgba(var(--pst-color-admonition-important),1)
}
.admonition.important>.admonition-title,
div.admonition.important>.admonition-title {
background-color:rgba(var(--pst-color-admonition-important),.1)
}
div.admonition.note {
border-color:rgba(var(--pst-color-admonition-note),1)
}
.admonition.note>.admonition-title,
div.admonition.note>.admonition-title {
background-color:rgba(var(--pst-color-admonition-note),.1)
}
2 changes: 1 addition & 1 deletion docs/source/sphinxext/gallery_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def build_gallery(srcdir, gallery):
with open(table_of_contents_file) as toc:
table_of_contents = toc.read()

js_contents = "Gallery.examples = {}\n{}".format(json.dumps(data), table_of_contents)
js_contents = f"Gallery.examples = {json.dumps(data)}\n{table_of_contents}"

with open(js_file, "w") as js:
js.write(js_contents)
Expand Down
2 changes: 1 addition & 1 deletion pymc3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def __set_compiler_flags():


def _hotfix_theano_printing():
""" This is a workaround for https://github.com/pymc-devs/aesara/issues/309 """
"""This is a workaround for https://github.com/pymc-devs/aesara/issues/309"""
try:
import pydot
import theano.printing
Expand Down
2 changes: 1 addition & 1 deletion pymc3/backends/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ def __getattr__(self, name):
return self.get_values(name)
if name in self.stat_names:
return self.get_sampler_stats(name)
raise AttributeError("'{}' object has no attribute '{}'".format(type(self).__name__, name))
raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'")

def __len__(self):
chain = self.chains[-1]
Expand Down
Loading