Skip to content

Commit c5e4497

Browse files
pymc-botmichaelosthege
authored andcommitted
⬆️ UPGRADE: Autoupdate pre-commit config
1 parent 9eaf1f2 commit c5e4497

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+8
-94
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ repos:
3434
- id: pyupgrade
3535
args: [--py37-plus]
3636
- repo: https://github.com/psf/black
37-
rev: 22.12.0
37+
rev: 23.1.0
3838
hooks:
3939
- id: black
4040
- id: black-jupyter
4141
- repo: https://github.com/PyCQA/pylint
42-
rev: v2.16.0b1
42+
rev: v2.16.1
4343
hooks:
4444
- id: pylint
4545
args: [--rcfile=.pylintrc]

docs/source/learn/core_notebooks/dimensionality.ipynb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1661,7 +1661,6 @@
16611661
" \"year\": [2020, 2021, 2022],\n",
16621662
" }\n",
16631663
") as pmodel:\n",
1664-
"\n",
16651664
" pm.Normal(\"profit\", dims=\"year\")\n",
16661665
"\n",
16671666
"pm.model_to_graphviz(pmodel)"

docs/source/learn/core_notebooks/model_comparison.ipynb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@
135135
],
136136
"source": [
137137
"with pm.Model() as pooled:\n",
138-
"\n",
139138
" # Latent pooled effect size\n",
140139
" mu = pm.Normal(\"mu\", 0, sigma=1e6)\n",
141140
"\n",
@@ -242,7 +241,6 @@
242241
],
243242
"source": [
244243
"with pm.Model() as hierarchical:\n",
245-
"\n",
246244
" eta = pm.Normal(\"eta\", 0, 1, shape=J)\n",
247245
" # Hierarchical mean and SD\n",
248246
" mu = pm.Normal(\"mu\", 0, sigma=10)\n",

docs/source/learn/core_notebooks/pymc_overview.ipynb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@
205205
"basic_model = pm.Model()\n",
206206
"\n",
207207
"with basic_model:\n",
208-
"\n",
209208
" # Priors for unknown model parameters\n",
210209
" alpha = pm.Normal(\"alpha\", mu=0, sigma=10)\n",
211210
" beta = pm.Normal(\"beta\", mu=0, sigma=10, shape=2)\n",
@@ -3417,7 +3416,6 @@
34173416
"import pytensor.tensor as at\n",
34183417
"\n",
34193418
"with pm.Model(coords={\"predictors\": X.columns.values}) as test_score_model:\n",
3420-
"\n",
34213419
" # Prior on error SD\n",
34223420
" sigma = pm.HalfNormal(\"sigma\", 25)\n",
34233421
"\n",
@@ -3752,7 +3750,6 @@
37523750
],
37533751
"source": [
37543752
"with test_score_model:\n",
3755-
"\n",
37563753
" idata = pm.sample(1000, tune=2000, random_seed=42)"
37573754
]
37583755
},
@@ -3832,7 +3829,6 @@
38323829
],
38333830
"source": [
38343831
"with test_score_model:\n",
3835-
"\n",
38363832
" idata = pm.sample(1000, tune=2000, random_seed=42, target_accept=0.99)"
38373833
]
38383834
},
@@ -4048,7 +4044,6 @@
40484044
],
40494045
"source": [
40504046
"with pm.Model() as disaster_model:\n",
4051-
"\n",
40524047
" switchpoint = pm.DiscreteUniform(\"switchpoint\", lower=years.min(), upper=years.max())\n",
40534048
"\n",
40544049
" # Priors for pre- and post-switch rates number of disasters\n",
@@ -4356,7 +4351,6 @@
43564351
"outputs": [],
43574352
"source": [
43584353
"class Beta(pm.Continuous):\n",
4359-
"\n",
43604354
" rv_op = beta\n",
43614355
"\n",
43624356
" @classmethod\n",

pymc/backends/arviz.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ def find_observations(model: "Model") -> Dict[str, Var]:
7171

7272
def find_constants(model: "Model") -> Dict[str, Var]:
7373
"""If there are constants available, return them as a dictionary."""
74+
7475
# The constant data vars must be either pm.Data or TensorConstant or SharedVariable
7576
def is_data(name, var, model) -> bool:
7677
observations = find_observations(model)
@@ -174,7 +175,6 @@ def __init__(
174175
save_warmup: Optional[bool] = None,
175176
include_transformed: bool = False,
176177
):
177-
178178
self.save_warmup = rcParams["data.save_warmup"] if save_warmup is None else save_warmup
179179
self.include_transformed = include_transformed
180180
self.trace = trace

pymc/backends/ndarray.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ def point_list_to_multitrace(
219219
with _model:
220220
chain = NDArray(model=_model, vars=[_model[vn] for vn in varnames])
221221
chain.setup(draws=len(point_list), chain=0)
222+
222223
# since we are simply loading a trace by hand, we need only a vacuous function for
223224
# chain.record() to use. This crushes the default.
224225
def point_fun(point):

pymc/blocking.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
StatsDict: TypeAlias = Dict[str, Any]
3535
StatsType: TypeAlias = List[StatsDict]
3636

37+
3738
# `point_map_info` is a tuple of tuples containing `(name, shape, dtype)` for
3839
# each of the raveled variables.
3940
class RaveledVars(NamedTuple):

pymc/distributions/bound.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ def __new__(
182182
dims=None,
183183
**kwargs,
184184
):
185-
186185
warnings.warn(
187186
"Bound has been deprecated in favor of Truncated, and will be removed in a "
188187
"future release. If Truncated is not an option, Bound can be implemented by"
@@ -234,7 +233,6 @@ def dist(
234233
shape=None,
235234
**kwargs,
236235
):
237-
238236
cls._argument_checks(dist, **kwargs)
239237
lower, upper, initval = cls._set_values(lower, upper, size, shape, initval=None)
240238
dist = ignore_logprob(dist)

pymc/distributions/censored.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ def dist(cls, dist, lower, upper, **kwargs):
101101

102102
@classmethod
103103
def rv_op(cls, dist, lower=None, upper=None, size=None):
104-
105104
lower = at.constant(-np.inf) if lower is None else at.as_tensor_variable(lower)
106105
upper = at.constant(np.inf) if upper is None else at.as_tensor_variable(upper)
107106

pymc/distributions/continuous.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ def bounded_cont_transform(op, rv, bound_args_indices=None):
171171
raise ValueError(f"Must specify bound_args_indices for {op} bounded distribution")
172172

173173
def transform_params(*args):
174-
175174
lower, upper = None, None
176175
if bound_args_indices[0] is not None:
177176
lower = args[bound_args_indices[0]]
@@ -3474,7 +3473,6 @@ class Interpolated(BoundedContinuous):
34743473

34753474
@classmethod
34763475
def dist(cls, x_points, pdf_points, *args, **kwargs):
3477-
34783476
interp = InterpolatedUnivariateSpline(x_points, pdf_points, k=1, ext="zeros")
34793477

34803478
Z = interp.integral(x_points[0], x_points[-1])

0 commit comments

Comments
 (0)