Skip to content

CI autoupdate pre-commit #4181

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
Closed
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
33 changes: 33 additions & 0 deletions .github/workflows/autoupdate-pre-commit-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: "Update pre-commit config"

on:
schedule:
- cron: "0 7 * * 1" # At 07:00 on each Monday.
workflow_dispatch:

jobs:
update-pre-commit:
if: github.repository_owner == 'pymc-devs'
name: Autoupdate pre-commit config
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v2
- name: Cache multiple paths
uses: actions/cache@v2
with:
path: |
~/.cache/pre-commit
~/.cache/pip
key: pre-commit-autoupdate-${{ runner.os }}-build
- name: Update pre-commit config packages
uses: technote-space/create-pr-action@v2
with:
GITHUB_TOKEN: ${{ secrets.ACTION_TRIGGER_TOKEN }}
EXECUTE_COMMANDS: |
pip install pre-commit
pre-commit autoupdate || (exit 0);
pre-commit run -a || (exit 0);
COMMIT_MESSAGE: "⬆️ UPGRADE: Autoupdate pre-commit config"
PR_BRANCH_NAME: "pre-commit-config-update-${PR_ID}"
PR_TITLE: "⬆️ UPGRADE: Autoupdate pre-commit config"
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
rev: v3.3.0
hooks:
- id: end-of-file-fixer
- id: check-toml
- repo: https://github.com/nbQA-dev/nbQA
rev: 0.3.2
rev: 0.3.5
hooks:
- id: nbqa-black
- id: nbqa-isort
- id: nbqa-pyupgrade
- repo: https://github.com/asottile/pyupgrade
rev: v2.7.2
rev: v2.7.3
hooks:
- id: pyupgrade
args: [--py36-plus]
Expand Down
10 changes: 5 additions & 5 deletions docs/source/notebooks/blackbox_external_likelihood.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"import theano\n",
"import theano.tensor as tt\n",
"\n",
"print(\"Running on PyMC3 v{}\".format(pm.__version__))"
"print(f\"Running on PyMC3 v{pm.__version__}\")"
]
},
{
Expand Down Expand Up @@ -697,7 +697,7 @@
" color=colors[i],\n",
" hist_kwargs={\"density\": True},\n",
" **hist2dkwargs,\n",
" truths=[mtrue, ctrue]\n",
" truths=[mtrue, ctrue],\n",
" )\n",
" else:\n",
" corner.corner(\n",
Expand Down Expand Up @@ -729,15 +729,15 @@
"test_grad_op_func = theano.function([var], test_grad_op(var))\n",
"grad_vals = test_grad_op_func([mtrue, ctrue])\n",
"\n",
"print('Gradient returned by \"LogLikeGrad\": {}'.format(grad_vals))\n",
"print(f'Gradient returned by \"LogLikeGrad\": {grad_vals}')\n",
"\n",
"# test the gradient called through LogLikeWithGrad\n",
"test_gradded_op = LogLikeWithGrad(my_loglike, data, x, sigma)\n",
"test_gradded_op_grad = tt.grad(test_gradded_op(var), var)\n",
"test_gradded_op_grad_func = theano.function([var], test_gradded_op_grad)\n",
"grad_vals_2 = test_gradded_op_grad_func([mtrue, ctrue])\n",
"\n",
"print('Gradient returned by \"LogLikeWithGrad\": {}'.format(grad_vals_2))\n",
"print(f'Gradient returned by \"LogLikeWithGrad\": {grad_vals_2}')\n",
"\n",
"# test the gradient that PyMC3 uses for the Normal log likelihood\n",
"test_model = pm.Model()\n",
Expand All @@ -751,7 +751,7 @@
" gradfunc.set_extra_values({\"m_interval__\": mtrue, \"c_interval__\": ctrue})\n",
" grad_vals_pymc3 = gradfunc(np.array([mtrue, ctrue]))[1] # get dlogp values\n",
"\n",
"print('Gradient returned by PyMC3 \"Normal\" distribution: {}'.format(grad_vals_pymc3))"
"print(f'Gradient returned by PyMC3 \"Normal\" distribution: {grad_vals_pymc3}')"
]
},
{
Expand Down
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,3 @@ pyupgrade = 1
[tool.nbqa.addopts]
isort = ["--treat-comment-as-code", "# %%"]
pyupgrade = ["--py36-plus"]

[tool.nbqa.ignore_cells]
black = "%%cython"