Repository: pymc-devs/pymc (branch: ruff_linter)
Commit date: 2024-01-08T14:13:57Z

Workflow file: .github/workflows/pre-commit.yml (pre-commit)
name: pre-commit

on:
  pull_request:
  push:
    branches: [main]

jobs:
  pre-commit:
    runs-on: ubuntu-latest
    services:
      pypi_wayback:
        image: ghcr.io/waleko/pypi-wayback
        ports:
          - 8629:8080
    env:
      SKIP: no-commit-to-branch
    steps:
    - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
    - uses: actions/setup-python@v5
      with:
        python-version: "3.9"  # Run pre-commit on oldest supported Python version
    - uses: pre-commit/action@v3.0.0
  mypy:
    runs-on: ubuntu-latest
    services:
      pypi_wayback:
        image: ghcr.io/waleko/pypi-wayback
        ports:
          - 8629:8080
    defaults:
      run:
        shell: bash -l {0}
    steps:
      - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
      - name: Cache conda
        uses: actions/cache@v3
        env:
          # Increase this value to reset cache if environment-test.yml has not changed
          CACHE_NUMBER: 0
        with:
          path: ~/conda_pkgs_dir
          key: ${{ runner.os }}-py39-conda-${{ env.CACHE_NUMBER }}-${{
            hashFiles('conda-envs/environment-test.yml') }}
      - name: Cache multiple paths
        uses: actions/cache@v3
        env:
          # Increase this value to reset cache if requirements.txt has not changed
          CACHE_NUMBER: 0
        with:
          path: |
            ~/.cache/pip
            $RUNNER_TOOL_CACHE/Python/*
            ~\AppData\Local\pip\Cache
          key: ${{ runner.os }}-build-${{ matrix.python-version }}-${{ env.CACHE_NUMBER }}-${{
            hashFiles('requirements.txt') }}
      - uses: conda-incubator/setup-miniconda@v2
        with:
          miniforge-variant: Mambaforge
          miniforge-version: latest
          mamba-version: "*"
          activate-environment: pymc-test
          channel-priority: strict
          environment-file: conda-envs/environment-test.yml
          python-version: "3.9"  # Run pre-commit on oldest supported Python version
          use-mamba: true
          use-only-tar-bz2: false # IMPORTANT: This may break caching of conda packages! See https://github.com/conda-incubator/setup-miniconda/issues/267
      - name: Install-pymc and mypy dependencies
        run: |
          conda activate pymc-test
          pip install -e .
          pip install --pre -U polyagamma
          python --version
      - name: Run mypy
        run: |
          conda activate pymc-test
          python ./scripts/run_mypy.py --verbose

env:
  PIP_INDEX_URL: http://localhost:8629/2024-01-08
  UV_INDEX_URL: http://localhost:8629/2024-01-08


Failed build logs:
step_name: pre-commit/4_Run pre-commitaction@v3.0.0.txt
log: ##[group]Run pre-commit/action@v3.0.0
with:
  extra_args: --all-files
env:
  SKIP: no-commit-to-branch
  pythonLocation: /opt/hostedtoolcache/Python/3.9.18/x64
  PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.9.18/x64/lib/pkgconfig
  Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64
  Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64
  Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64
  LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.9.18/x64/lib
##[endgroup]
##[group]Run python -m pip install pre-commit
[36;1mpython -m pip install pre-commit[0m
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  SKIP: no-commit-to-branch
  pythonLocation: /opt/hostedtoolcache/Python/3.9.18/x64
  PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.9.18/x64/lib/pkgconfig
  Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64
  Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64
  Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64
  LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.9.18/x64/lib
##[endgroup]
Collecting pre-commit
  Downloading pre_commit-3.6.0-py2.py3-none-any.whl.metadata (1.3 kB)
Collecting cfgv>=2.0.0 (from pre-commit)
  Downloading cfgv-3.4.0-py2.py3-none-any.whl.metadata (8.5 kB)
Collecting identify>=1.0.0 (from pre-commit)
  Downloading identify-2.5.33-py2.py3-none-any.whl.metadata (4.4 kB)
Collecting nodeenv>=0.11.1 (from pre-commit)
  Downloading nodeenv-1.8.0-py2.py3-none-any.whl.metadata (21 kB)
Collecting pyyaml>=5.1 (from pre-commit)
  Downloading PyYAML-6.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (2.1 kB)
Collecting virtualenv>=20.10.0 (from pre-commit)
  Downloading virtualenv-20.25.0-py3-none-any.whl.metadata (4.5 kB)
Requirement already satisfied: setuptools in /opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages (from nodeenv>=0.11.1->pre-commit) (58.1.0)
Collecting distlib<1,>=0.3.7 (from virtualenv>=20.10.0->pre-commit)
  Downloading distlib-0.3.8-py2.py3-none-any.whl.metadata (5.1 kB)
Collecting filelock<4,>=3.12.2 (from virtualenv>=20.10.0->pre-commit)
  Downloading filelock-3.13.1-py3-none-any.whl.metadata (2.8 kB)
Collecting platformdirs<5,>=3.9.1 (from virtualenv>=20.10.0->pre-commit)
  Downloading platformdirs-4.1.0-py3-none-any.whl.metadata (11 kB)
Downloading pre_commit-3.6.0-py2.py3-none-any.whl (204 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 204.0/204.0 kB 14.2 MB/s eta 0:00:00
Downloading cfgv-3.4.0-py2.py3-none-any.whl (7.2 kB)
Downloading identify-2.5.33-py2.py3-none-any.whl (98 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 98.9/98.9 kB 29.1 MB/s eta 0:00:00
Downloading nodeenv-1.8.0-py2.py3-none-any.whl (22 kB)
Downloading PyYAML-6.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (738 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 738.9/738.9 kB 67.7 MB/s eta 0:00:00
Downloading virtualenv-20.25.0-py3-none-any.whl (3.8 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.8/3.8 MB 93.7 MB/s eta 0:00:00
Downloading distlib-0.3.8-py2.py3-none-any.whl (468 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 468.9/468.9 kB 77.3 MB/s eta 0:00:00
Downloading filelock-3.13.1-py3-none-any.whl (11 kB)
Downloading platformdirs-4.1.0-py3-none-any.whl (17 kB)
Installing collected packages: distlib, pyyaml, platformdirs, nodeenv, identify, filelock, cfgv, virtualenv, pre-commit
Successfully installed cfgv-3.4.0 distlib-0.3.8 filelock-3.13.1 identify-2.5.33 nodeenv-1.8.0 platformdirs-4.1.0 pre-commit-3.6.0 pyyaml-6.0.1 virtualenv-20.25.0

[notice] A new release of pip is available: 23.0.1 -> 23.3.2
[notice] To update, run: pip install --upgrade pip
##[group]Run python -m pip freeze --local
[36;1mpython -m pip freeze --local[0m
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  SKIP: no-commit-to-branch
  pythonLocation: /opt/hostedtoolcache/Python/3.9.18/x64
  PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.9.18/x64/lib/pkgconfig
  Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64
  Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64
  Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64
  LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.9.18/x64/lib
##[endgroup]
cfgv==3.4.0
distlib==0.3.8
filelock==3.13.1
identify==2.5.33
nodeenv==1.8.0
platformdirs==4.1.0
pre-commit==3.6.0
PyYAML==6.0.1
virtualenv==20.25.0
##[group]Run actions/cache@v3
with:
  path: ~/.cache/pre-commit
  key: pre-commit-3|/opt/hostedtoolcache/Python/3.9.18/x64|8521b1deaccc96b7bf978113f6a9d2819d4547b59963b2c02ead71c093c77e29
  enableCrossOsArchive: false
  fail-on-cache-miss: false
  lookup-only: false
env:
  SKIP: no-commit-to-branch
  pythonLocation: /opt/hostedtoolcache/Python/3.9.18/x64
  PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.9.18/x64/lib/pkgconfig
  Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64
  Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64
  Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64
  LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.9.18/x64/lib
##[endgroup]
Cache not found for input keys: pre-commit-3|/opt/hostedtoolcache/Python/3.9.18/x64|8521b1deaccc96b7bf978113f6a9d2819d4547b59963b2c02ead71c093c77e29
##[group]Run pre-commit run --show-diff-on-failure --color=always --all-files
[36;1mpre-commit run --show-diff-on-failure --color=always --all-files[0m
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  SKIP: no-commit-to-branch
  pythonLocation: /opt/hostedtoolcache/Python/3.9.18/x64
  PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.9.18/x64/lib/pkgconfig
  Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64
  Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64
  Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64
  LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.9.18/x64/lib
##[endgroup]
[INFO][m Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO][m Initializing environment for https://github.com/lucianopaz/head_of_apache.
[INFO][m Initializing environment for https://github.com/asottile/pyupgrade.
[INFO][m Initializing environment for https://github.com/astral-sh/ruff-pre-commit.
[INFO][m Initializing environment for https://github.com/PyCQA/pydocstyle.
[INFO][m Initializing environment for https://github.com/MarcoGorelli/madforhooks.
[INFO][m Initializing environment for local:pandas,pyyaml.
[INFO][m Initializing environment for local:pyyaml.
[INFO][m Installing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO][m Once installed this environment will be reused.
[INFO][m This may take a few minutes...
[INFO][m Installing environment for https://github.com/lucianopaz/head_of_apache.
[INFO][m Once installed this environment will be reused.
[INFO][m This may take a few minutes...
[INFO][m Installing environment for https://github.com/asottile/pyupgrade.
[INFO][m Once installed this environment will be reused.
[INFO][m This may take a few minutes...
[INFO][m Installing environment for https://github.com/astral-sh/ruff-pre-commit.
[INFO][m Once installed this environment will be reused.
[INFO][m This may take a few minutes...
[INFO][m Installing environment for https://github.com/PyCQA/pydocstyle.
[INFO][m Once installed this environment will be reused.
[INFO][m This may take a few minutes...
[INFO][m Installing environment for https://github.com/MarcoGorelli/madforhooks.
[INFO][m Once installed this environment will be reused.
[INFO][m This may take a few minutes...
[INFO][m Installing environment for local.
[INFO][m Once installed this environment will be reused.
[INFO][m This may take a few minutes...
[INFO][m Installing environment for local.
[INFO][m Once installed this environment will be reused.
[INFO][m This may take a few minutes...
check for merge conflicts............................................................[42mPassed[m
check toml...........................................................................[42mPassed[m
check yaml...........................................................................[42mPassed[m
debug statements (python)............................................................[42mPassed[m
fix end of files.....................................................................[42mPassed[m
don't commit to branch..............................................................[43;30mSkipped[m
fix requirements.txt.................................................................[42mPassed[m
trim trailing whitespace.............................................................[42mPassed[m
Apply Apache 2.0 License.............................................................[42mPassed[m
pyupgrade............................................................................[42mPassed[m
ruff.................................................................................[42mPassed[m
ruff-format..........................................................................[41mFailed[m
[2m- hook id: ruff-format[m
[2m- files were modified by this hook[m

11 files reformatted, 197 files left unchanged

pydocstyle...........................................................................[42mPassed[m
Disallow print statements............................................................[42mPassed[m
Check no tests are ignored...........................................................[42mPassed[m
Generate pip dependency from conda...................................................[42mPassed[m
No relative imports..................................................................[42mPassed[m
Check no links that should be cross-references are in the docs.......................[42mPassed[m
pre-commit hook(s) made changes.
If you are seeing this message in CI, reproduce locally with: `pre-commit run --all-files`.
To run `pre-commit` as part of git workflow, use `pre-commit install`.
All changes made by hooks:
[1mdiff --git a/pymc/distributions/discrete.py b/pymc/distributions/discrete.py[m
[1mindex f95b437..8771193 100644[m
[1m--- a/pymc/distributions/discrete.py[m
[1m+++ b/pymc/distributions/discrete.py[m
[36m@@ -112,6 +112,7 @@[m [mclass Binomial(Discrete):[m
     logit_p : tensor_like of float[m
         Alternative log odds for the probability of success.[m
     """[m
[32m+[m
     rv_op = binomial[m
 [m
     @classmethod[m
[36m@@ -334,6 +335,7 @@[m [mclass Bernoulli(Discrete):[m
     logit_p : tensor_like of float[m
         Alternative log odds for the probability of success.[m
     """[m
[32m+[m
     rv_op = bernoulli[m
 [m
     @classmethod[m
[36m@@ -450,6 +452,7 @@[m [mclass DiscreteWeibull(Discrete):[m
         Shape parameter (beta > 0).[m
 [m
     """[m
[32m+[m
     rv_op = discrete_weibull[m
 [m
     @classmethod[m
[36m@@ -539,6 +542,7 @@[m [mclass Poisson(Discrete):[m
     The Poisson distribution can be derived as a limiting case of the[m
     binomial distribution.[m
     """[m
[32m+[m
     rv_op = poisson[m
 [m
     @classmethod[m
[36m@@ -662,6 +666,7 @@[m [mclass NegativeBinomial(Discrete):[m
     n : tensor_like of float[m
         Alternative number of target success trials (n > 0)[m
     """[m
[32m+[m
     rv_op = nbinom[m
 [m
     @classmethod[m
[36m@@ -1108,6 +1113,7 @@[m [mclass Categorical(Discrete):[m
     logit_p : float[m
         Alternative log odds for the probability of success.[m
     """[m
[32m+[m
     rv_op = categorical[m
 [m
     @classmethod[m
[36m@@ -1183,6 +1189,7 @@[m [mclass _OrderedLogistic(Categorical):[m
     Underlying class for ordered logistic distributions.[m
     See docs for the OrderedLogistic wrapper class for more details on how to use it in models.[m
     """[m
[32m+[m
     rv_op = categorical[m
 [m
     @classmethod[m
[36m@@ -1289,6 +1296,7 @@[m [mclass _OrderedProbit(Categorical):[m
     Underlying class for ordered probit distributions.[m
     See docs for the OrderedProbit wrapper class for more details on how to use it in models.[m
     """[m
[32m+[m
     rv_op = categorical[m
 [m
     @classmethod[m
[1mdiff --git a/pymc/distributions/multivariate.py b/pymc/distributions/multivariate.py[m
[1mindex 1e5a956..570c139 100644[m
[1m--- a/pymc/distributions/multivariate.py[m
[1m+++ b/pymc/distributions/multivariate.py[m
[36m@@ -235,6 +235,7 @@[m [mclass MvNormal(Continuous):[m
         vals_raw = pm.Normal('vals_raw', mu=0, sigma=1, shape=(5, 3))[m
         vals = pm.Deterministic('vals', pt.dot(chol, vals_raw.T).T)[m
     """[m
[32m+[m
     rv_op = multivariate_normal[m
 [m
     @classmethod[m
[36m@@ -355,6 +356,7 @@[m [mclass MvStudentT(Continuous):[m
     lower : bool, default=True[m
         Whether the cholesky fatcor is given as a lower triangular matrix.[m
     """[m
[32m+[m
     rv_op = mv_studentt[m
 [m
     @classmethod[m
[36m@@ -436,6 +438,7 @@[m [mclass Dirichlet(SimplexContinuous):[m
         Concentration parameters (a > 0). The number of categories is given by the[m
         length of the last axis.[m
     """[m
[32m+[m
     rv_op = dirichlet[m
 [m
     @classmethod[m
[36m@@ -515,6 +518,7 @@[m [mclass Multinomial(Discrete):[m
         categories is given by the length of the last axis. Elements are expected to sum[m
         to 1 along the last axis.[m
     """[m
[32m+[m
     rv_op = multinomial[m
 [m
     @classmethod[m
[36m@@ -662,6 +666,7 @@[m [mclass DirichletMultinomial(Discrete):[m
         Dirichlet concentration parameters (a > 0). The number of categories is given by[m
         the length of the last axis.[m
     """[m
[32m+[m
     rv_op = dirichlet_multinomial[m
 [m
     @classmethod[m
[36m@@ -716,6 +721,7 @@[m [mclass _OrderedMultinomial(Multinomial):[m
     Underlying class for ordered multinomial distributions.[m
     See docs for the OrderedMultinomial wrapper class for more details on how to use it in models.[m
     """[m
[32m+[m
     rv_op = multinomial[m
 [m
     @classmethod[m
[36m@@ -940,6 +946,7 @@[m [mclass Wishart(Continuous):[m
     This distribution is unusable in a PyMC model. You should instead[m
     use LKJCholeskyCov or LKJCorr.[m
     """[m
[32m+[m
     rv_op = wishart[m
 [m
     @classmethod[m
[36m@@ -1763,6 +1770,7 @@[m [mclass MatrixNormal(Continuous):[m
             vals = pm.MatrixNormal('vals', mu=mu, colchol=colchol, rowcov=rowcov,[m
                                    observed=data)[m
     """[m
[32m+[m
     rv_op = matrixnormal[m
 [m
     @classmethod[m
[36m@@ -1977,6 +1985,7 @@[m [mclass KroneckerNormal(Continuous):[m
     ----------[m
     .. [1] Saatchi, Y. (2011). "Scalable inference for structured Gaussian process models"[m
     """[m
[32m+[m
     rv_op = kroneckernormal[m
 [m
     @classmethod[m
[36m@@ -2183,6 +2192,7 @@[m [mclass CAR(Continuous):[m
         "Generalized Hierarchical Multivariate CAR Models for Areal Data"[m
         Biometrics, Vol. 61, No. 4 (Dec., 2005), pp. 950-961[m
     """[m
[32m+[m
     rv_op = car[m
 [m
     @classmethod[m
[36m@@ -2400,9 +2410,7 @@[m [mclass ICAR(Continuous):[m
         return pt.zeros(N)[m
 [m
     def logp(value, W, node1, node2, N, sigma, zero_sum_stdev):[m
[31m-        pairwise_difference = (-1 / (2 * sigma**2)) * pt.sum([m
[31m-            pt.square(value[node1] - value[node2])[m
[31m-        )[m
[32m+[m[32m        pairwise_difference = (-1 / (2 * sigma**2)) * pt.sum(pt.square(value[node1] - value[node2]))[m
         zero_sum = ([m
             -0.5 * pt.pow(pt.sum(value) / (zero_sum_stdev * N), 2)[m
             - pt.log(pt.sqrt(2.0 * np.pi))[m
[36m@@ -2498,6 +2506,7 @@[m [mclass StickBreakingWeights(SimplexContinuous):[m
     .. [2] Müller, P., Quintana, F. A., Jara, A., & Hanson, T. (2015). Bayesian nonparametric data[m
            analysis. New York: Springer.[m
     """[m
[32m+[m
     rv_op = stickbreakingweights[m
 [m
     @classmethod[m
[36m@@ -2641,6 +2650,7 @@[m [mclass ZeroSumNormal(Distribution):[m
             # the zero sum axes will be the last two[m
             v = pm.ZeroSumNormal("v", shape=(3, 4, 5), n_zerosum_axes=2)[m
     """[m
[32m+[m
     rv_type = ZeroSumNormalRV[m
 [m
     def __new__([m
[1mdiff --git a/pymc/model/core.py b/pymc/model/core.py[m
[1mindex c45f3f5..6ee6d49 100644[m
[1m--- a/pymc/model/core.py[m
[1m+++ b/pymc/model/core.py[m
[36m@@ -138,9 +138,7 @@[m [mclass ContextMeta(type):[m
 [m
     # FIXME: is there a more elegant way to automatically add methods to the class that[m
     # are instance methods instead of class methods?[m
[31m-    def __init__([m
[31m-        cls, name, bases, nmspc, context_class: Optional[Type] = None, **kwargs[m
[31m-    ):  # pylint: disable=unused-argument[m
[32m+[m[32m    def __init__(cls, name, bases, nmspc, context_class: Optional[Type] = None, **kwargs):  # pylint: disable=unused-argument[m
         """Add ``__enter__`` and ``__exit__`` methods to the new class automatically."""[m
         if context_class is not None:[m
             cls._context_class = context_class[m
[36m@@ -1740,7 +1738,7 @@[m [mclass Model(WithMemoization, metaclass=ContextMeta):[m
             done = {}[m
             used_ids = {}[m
             for i, out in enumerate(rv_inputs.maker.fgraph.outputs):[m
[31m-                print_(f"{i}: ", end=""),[m
[32m+[m[32m                (print_(f"{i}: ", end=""),)[m
                 # Don't print useless deepcopys[m
                 if out.owner and isinstance(out.owner.op, DeepCopyOp):[m
                     out = out.owner.inputs[0][m
[1mdiff --git a/pymc/ode/ode.py b/pymc/ode/ode.py[m
[1mindex a5e3741..600f306 100644[m
[1m--- a/pymc/ode/ode.py[m
[1m+++ b/pymc/ode/ode.py[m
[36m@@ -67,6 +67,7 @@[m [mclass DifferentialEquation(Op):[m
         ode_model = DifferentialEquation(func=odefunc, times=times, n_states=1, n_theta=1, t0=0)[m
 [m
     """[m
[32m+[m
     _itypes = [[m
         TensorType(floatX, (False,)),  # y0 as 1D floatX vector[m
         TensorType(floatX, (False,)),  # theta as 1D floatX vector[m
[1mdiff --git a/pymc/printing.py b/pymc/printing.py[m
[1mindex ffc943a..9fe7d05 100644[m
[1m--- a/pymc/printing.py[m
[1m+++ b/pymc/printing.py[m
[36m@@ -123,9 +123,7 @@[m [mdef str_for_model(model: Model, formatting: str = "plain", include_params: bool[m
             \begin{{array}}{{rcl}}[m
             {}[m
             \end{{array}}[m
[31m-            $$""".format([m
[31m-            "\\\\".join(var_reprs)[m
[31m-        )[m
[32m+[m[32m            $$""".format("\\\\".join(var_reprs))[m
     else:[m
         # align vars on their ~[m
         names = [s[: s.index("~") - 1] for s in var_reprs][m
[1mdiff --git a/pymc/step_methods/metropolis.py b/pymc/step_methods/metropolis.py[m
[1mindex 1adb462..e080cdd 100644[m
[1m--- a/pymc/step_methods/metropolis.py[m
[1m+++ b/pymc/step_methods/metropolis.py[m
[36m@@ -134,7 +134,7 @@[m [mclass Metropolis(ArrayStepShared):[m
         tune_interval=100,[m
         model=None,[m
         mode=None,[m
[31m-        **kwargs[m
[32m+[m[32m        **kwargs,[m
     ):[m
         """Create an instance of a Metropolis stepper[m
 [m
[36m@@ -771,7 +771,7 @@[m [mclass DEMetropolis(PopulationArrayStepShared):[m
         tune_interval=100,[m
         model=None,[m
         mode=None,[m
[31m-        **kwargs[m
[32m+[m[32m        **kwargs,[m
     ):[m
         model = pm.modelcontext(model)[m
         initial_values = model.initial_point()[m
[36m@@ -915,7 +915,7 @@[m [mclass DEMetropolisZ(ArrayStepShared):[m
         tune_drop_fraction: float = 0.9,[m
         model=None,[m
         mode=None,[m
[31m-        **kwargs[m
[32m+[m[32m        **kwargs,[m
     ):[m
         model = pm.modelcontext(model)[m
         initial_values = model.initial_point()[m
[1mdiff --git a/pymc/tuning/starting.py b/pymc/tuning/starting.py[m
[1mindex 6a4d338..ad5f554 100644[m
[1m--- a/pymc/tuning/starting.py[m
[1m+++ b/pymc/tuning/starting.py[m
[36m@@ -52,7 +52,7 @@[m [mdef find_MAP([m
     model=None,[m
     *args,[m
     seed: Optional[int] = None,[m
[31m-    **kwargs[m
[32m+[m[32m    **kwargs,[m
 ):[m
     """Finds the local maximum a posteriori point given a model.[m
 [m
[1mdiff --git a/pymc/variational/approximations.py b/pymc/variational/approximations.py[m
[1mindex 00df445..feb0a3a 100644[m
[1m--- a/pymc/variational/approximations.py[m
[1m+++ b/pymc/variational/approximations.py[m
[36m@@ -46,6 +46,7 @@[m [mclass MeanFieldGroup(Group):[m
     that latent space variables are uncorrelated that is the main drawback[m
     of the method[m
     """[m
[32m+[m
     __param_spec__ = dict(mu=("d",), rho=("d",))[m
     short_name = "mean_field"[m
     alias_names = frozenset(["mf"])[m
[36m@@ -350,27 +351,21 @@[m [mclass SingleGroupApproximation(Approximation):[m
 class MeanField(SingleGroupApproximation):[m
     __doc__ = """**Single Group Mean Field Approximation**[m
 [m
[31m-    """ + str([m
[31m-        MeanFieldGroup.__doc__[m
[31m-    )[m
[32m+[m[32m    """ + str(MeanFieldGroup.__doc__)[m
     _group_class = MeanFieldGroup[m
 [m
 [m
 class FullRank(SingleGroupApproximation):[m
     __doc__ = """**Single Group Full Rank Approximation**[m
 [m
[31m-    """ + str([m
[31m-        FullRankGroup.__doc__[m
[31m-    )[m
[32m+[m[32m    """ + str(FullRankGroup.__doc__)[m
     _group_class = FullRankGroup[m
 [m
 [m
 class Empirical(SingleGroupApproximation):[m
     __doc__ = """**Single Group Full Rank Approximation**[m
 [m
[31m-    """ + str([m
[31m-        EmpiricalGroup.__doc__[m
[31m-    )[m
[32m+[m[32m    """ + str(EmpiricalGroup.__doc__)[m
     _group_class = EmpiricalGroup[m
 [m
     def __init__(self, trace=None, size=None, **kwargs):[m
[1mdiff --git a/pymc/variational/operators.py b/pymc/variational/operators.py[m
[1mindex 1122a70..f6ef095 100644[m
[1m--- a/pymc/variational/operators.py[m
[1m+++ b/pymc/variational/operators.py[m
[36m@@ -130,6 +130,7 @@[m [mclass KSD(Operator):[m
         Stein Variational Gradient Descent: A General Purpose Bayesian Inference Algorithm[m
         arXiv:1608.04471[m
     """[m
[32m+[m
     has_test_function = True[m
     returns_loss = False[m
     require_logq = False[m
[1mdiff --git a/pymc/variational/opvi.py b/pymc/variational/opvi.py[m
[1mindex cf98c98..bd1874f 100644[m
[1m--- a/pymc/variational/opvi.py[m
[1m+++ b/pymc/variational/opvi.py[m
[36m@@ -663,6 +663,7 @@[m [mclass Group(WithMemoization):[m
     -   Kingma, D. P., & Welling, M. (2014).[m
         `Auto-Encoding Variational Bayes. stat, 1050, 1. <https://arxiv.org/abs/1312.6114>`_[m
     """[m
[32m+[m
     # needs to be defined in init[m
     shared_params = None[m
     symbolic_initial = None[m
[36m@@ -709,8 +710,9 @@[m [mclass Group(WithMemoization):[m
     def group_for_short_name(cls, name):[m
         if name.lower() not in cls.__name_registry:[m
             raise KeyError([m
[31m-                "No such group: {!r}, "[m
[31m-                "only the following are supported\n\n{}".format(name, cls.__name_registry)[m
[32m+[m[32m                "No such group: {!r}, " "only the following are supported\n\n{}".format([m
[32m+[m[32m                    name, cls.__name_registry[m
[32m+[m[32m                )[m
             )[m
         return cls.__name_registry[name.lower()][m
 [m
[1mdiff --git a/versioneer.py b/versioneer.py[m
[1mindex a560e68..c2b9d28 100644[m
[1m--- a/versioneer.py[m
[1m+++ b/versioneer.py[m
[36m@@ -432,9 +432,7 @@[m [mdef run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, env=[m
     return stdout, process.returncode[m
 [m
 [m
[31m-LONG_VERSION_PY[[m
[31m-    "git"[m
[31m-] = r'''[m
[32m+[m[32mLONG_VERSION_PY["git"] = r'''[m
 # This file helps to compute a version number in source trees obtained from[m
 # git-archive tarball (such as those provided by githubs download-from-tag[m
 # feature). Distribution tarballs (built by setup.py sdist) and build[m
##[error]Process completed with exit code 1.


Changed files:
pymc/distributions/discrete.py
pymc/distributions/multivariate.py
pymc/model/core.py
pymc/ode/ode.py
pymc/printing.py
pymc/step_methods/metropolis.py
pymc/tuning/starting.py
pymc/variational/approximations.py
pymc/variational/operators.py
pymc/variational/opvi.py
versioneer.py

Fix diff:
diff --git a/pymc/distributions/discrete.py b/pymc/distributions/discrete.py
index f95b4374d..877119350 100644
--- a/pymc/distributions/discrete.py
+++ b/pymc/distributions/discrete.py
@@ -112,6 +112,7 @@ class Binomial(Discrete):
     logit_p : tensor_like of float
         Alternative log odds for the probability of success.
     """
+
     rv_op = binomial
 
     @classmethod
@@ -334,6 +335,7 @@ class Bernoulli(Discrete):
     logit_p : tensor_like of float
         Alternative log odds for the probability of success.
     """
+
     rv_op = bernoulli
 
     @classmethod
@@ -450,6 +452,7 @@ class DiscreteWeibull(Discrete):
         Shape parameter (beta > 0).
 
     """
+
     rv_op = discrete_weibull
 
     @classmethod
@@ -539,6 +542,7 @@ class Poisson(Discrete):
     The Poisson distribution can be derived as a limiting case of the
     binomial distribution.
     """
+
     rv_op = poisson
 
     @classmethod
@@ -662,6 +666,7 @@ class NegativeBinomial(Discrete):
     n : tensor_like of float
         Alternative number of target success trials (n > 0)
     """
+
     rv_op = nbinom
 
     @classmethod
@@ -1108,6 +1113,7 @@ class Categorical(Discrete):
     logit_p : float
         Alternative log odds for the probability of success.
     """
+
     rv_op = categorical
 
     @classmethod
@@ -1183,6 +1189,7 @@ class _OrderedLogistic(Categorical):
     Underlying class for ordered logistic distributions.
     See docs for the OrderedLogistic wrapper class for more details on how to use it in models.
     """
+
     rv_op = categorical
 
     @classmethod
@@ -1289,6 +1296,7 @@ class _OrderedProbit(Categorical):
     Underlying class for ordered probit distributions.
     See docs for the OrderedProbit wrapper class for more details on how to use it in models.
     """
+
     rv_op = categorical
 
     @classmethod
diff --git a/pymc/distributions/multivariate.py b/pymc/distributions/multivariate.py
index 1e5a9567a..570c13988 100644
--- a/pymc/distributions/multivariate.py
+++ b/pymc/distributions/multivariate.py
@@ -235,6 +235,7 @@ class MvNormal(Continuous):
         vals_raw = pm.Normal('vals_raw', mu=0, sigma=1, shape=(5, 3))
         vals = pm.Deterministic('vals', pt.dot(chol, vals_raw.T).T)
     """
+
     rv_op = multivariate_normal
 
     @classmethod
@@ -355,6 +356,7 @@ class MvStudentT(Continuous):
     lower : bool, default=True
         Whether the cholesky fatcor is given as a lower triangular matrix.
     """
+
     rv_op = mv_studentt
 
     @classmethod
@@ -436,6 +438,7 @@ class Dirichlet(SimplexContinuous):
         Concentration parameters (a > 0). The number of categories is given by the
         length of the last axis.
     """
+
     rv_op = dirichlet
 
     @classmethod
@@ -515,6 +518,7 @@ class Multinomial(Discrete):
         categories is given by the length of the last axis. Elements are expected to sum
         to 1 along the last axis.
     """
+
     rv_op = multinomial
 
     @classmethod
@@ -662,6 +666,7 @@ class DirichletMultinomial(Discrete):
         Dirichlet concentration parameters (a > 0). The number of categories is given by
         the length of the last axis.
     """
+
     rv_op = dirichlet_multinomial
 
     @classmethod
@@ -716,6 +721,7 @@ class _OrderedMultinomial(Multinomial):
     Underlying class for ordered multinomial distributions.
     See docs for the OrderedMultinomial wrapper class for more details on how to use it in models.
     """
+
     rv_op = multinomial
 
     @classmethod
@@ -940,6 +946,7 @@ class Wishart(Continuous):
     This distribution is unusable in a PyMC model. You should instead
     use LKJCholeskyCov or LKJCorr.
     """
+
     rv_op = wishart
 
     @classmethod
@@ -1763,6 +1770,7 @@ class MatrixNormal(Continuous):
             vals = pm.MatrixNormal('vals', mu=mu, colchol=colchol, rowcov=rowcov,
                                    observed=data)
     """
+
     rv_op = matrixnormal
 
     @classmethod
@@ -1977,6 +1985,7 @@ class KroneckerNormal(Continuous):
     ----------
     .. [1] Saatchi, Y. (2011). "Scalable inference for structured Gaussian process models"
     """
+
     rv_op = kroneckernormal
 
     @classmethod
@@ -2183,6 +2192,7 @@ class CAR(Continuous):
         "Generalized Hierarchical Multivariate CAR Models for Areal Data"
         Biometrics, Vol. 61, No. 4 (Dec., 2005), pp. 950-961
     """
+
     rv_op = car
 
     @classmethod
@@ -2400,9 +2410,7 @@ class ICAR(Continuous):
         return pt.zeros(N)
 
     def logp(value, W, node1, node2, N, sigma, zero_sum_stdev):
-        pairwise_difference = (-1 / (2 * sigma**2)) * pt.sum(
-            pt.square(value[node1] - value[node2])
-        )
+        pairwise_difference = (-1 / (2 * sigma**2)) * pt.sum(pt.square(value[node1] - value[node2]))
         zero_sum = (
             -0.5 * pt.pow(pt.sum(value) / (zero_sum_stdev * N), 2)
             - pt.log(pt.sqrt(2.0 * np.pi))
@@ -2498,6 +2506,7 @@ class StickBreakingWeights(SimplexContinuous):
     .. [2] Müller, P., Quintana, F. A., Jara, A., & Hanson, T. (2015). Bayesian nonparametric data
            analysis. New York: Springer.
     """
+
     rv_op = stickbreakingweights
 
     @classmethod
@@ -2641,6 +2650,7 @@ class ZeroSumNormal(Distribution):
             # the zero sum axes will be the last two
             v = pm.ZeroSumNormal("v", shape=(3, 4, 5), n_zerosum_axes=2)
     """
+
     rv_type = ZeroSumNormalRV
 
     def __new__(
diff --git a/pymc/model/core.py b/pymc/model/core.py
index c45f3f550..6ee6d491a 100644
--- a/pymc/model/core.py
+++ b/pymc/model/core.py
@@ -138,9 +138,7 @@ class ContextMeta(type):
 
     # FIXME: is there a more elegant way to automatically add methods to the class that
     # are instance methods instead of class methods?
-    def __init__(
-        cls, name, bases, nmspc, context_class: Optional[Type] = None, **kwargs
-    ):  # pylint: disable=unused-argument
+    def __init__(cls, name, bases, nmspc, context_class: Optional[Type] = None, **kwargs):  # pylint: disable=unused-argument
         """Add ``__enter__`` and ``__exit__`` methods to the new class automatically."""
         if context_class is not None:
             cls._context_class = context_class
@@ -1740,7 +1738,7 @@ class Model(WithMemoization, metaclass=ContextMeta):
             done = {}
             used_ids = {}
             for i, out in enumerate(rv_inputs.maker.fgraph.outputs):
-                print_(f"{i}: ", end=""),
+                (print_(f"{i}: ", end=""),)
                 # Don't print useless deepcopys
                 if out.owner and isinstance(out.owner.op, DeepCopyOp):
                     out = out.owner.inputs[0]
diff --git a/pymc/ode/ode.py b/pymc/ode/ode.py
index a5e374130..600f30632 100644
--- a/pymc/ode/ode.py
+++ b/pymc/ode/ode.py
@@ -67,6 +67,7 @@ class DifferentialEquation(Op):
         ode_model = DifferentialEquation(func=odefunc, times=times, n_states=1, n_theta=1, t0=0)
 
     """
+
     _itypes = [
         TensorType(floatX, (False,)),  # y0 as 1D floatX vector
         TensorType(floatX, (False,)),  # theta as 1D floatX vector
diff --git a/pymc/printing.py b/pymc/printing.py
index ffc943aa1..9fe7d056c 100644
--- a/pymc/printing.py
+++ b/pymc/printing.py
@@ -123,9 +123,7 @@ def str_for_model(model: Model, formatting: str = "plain", include_params: bool
             \begin{{array}}{{rcl}}
             {}
             \end{{array}}
-            $$""".format(
-            "\\\\".join(var_reprs)
-        )
+            $$""".format("\\\\".join(var_reprs))
     else:
         # align vars on their ~
         names = [s[: s.index("~") - 1] for s in var_reprs]
diff --git a/pymc/step_methods/metropolis.py b/pymc/step_methods/metropolis.py
index 1adb462d9..e080cdd09 100644
--- a/pymc/step_methods/metropolis.py
+++ b/pymc/step_methods/metropolis.py
@@ -134,7 +134,7 @@ class Metropolis(ArrayStepShared):
         tune_interval=100,
         model=None,
         mode=None,
-        **kwargs
+        **kwargs,
     ):
         """Create an instance of a Metropolis stepper
 
@@ -771,7 +771,7 @@ class DEMetropolis(PopulationArrayStepShared):
         tune_interval=100,
         model=None,
         mode=None,
-        **kwargs
+        **kwargs,
     ):
         model = pm.modelcontext(model)
         initial_values = model.initial_point()
@@ -915,7 +915,7 @@ class DEMetropolisZ(ArrayStepShared):
         tune_drop_fraction: float = 0.9,
         model=None,
         mode=None,
-        **kwargs
+        **kwargs,
     ):
         model = pm.modelcontext(model)
         initial_values = model.initial_point()
diff --git a/pymc/tuning/starting.py b/pymc/tuning/starting.py
index 6a4d33894..ad5f554ae 100644
--- a/pymc/tuning/starting.py
+++ b/pymc/tuning/starting.py
@@ -52,7 +52,7 @@ def find_MAP(
     model=None,
     *args,
     seed: Optional[int] = None,
-    **kwargs
+    **kwargs,
 ):
     """Finds the local maximum a posteriori point given a model.
 
diff --git a/pymc/variational/approximations.py b/pymc/variational/approximations.py
index 00df44599..feb0a3a92 100644
--- a/pymc/variational/approximations.py
+++ b/pymc/variational/approximations.py
@@ -46,6 +46,7 @@ class MeanFieldGroup(Group):
     that latent space variables are uncorrelated that is the main drawback
     of the method
     """
+
     __param_spec__ = dict(mu=("d",), rho=("d",))
     short_name = "mean_field"
     alias_names = frozenset(["mf"])
@@ -350,27 +351,21 @@ class SingleGroupApproximation(Approximation):
 class MeanField(SingleGroupApproximation):
     __doc__ = """**Single Group Mean Field Approximation**
 
-    """ + str(
-        MeanFieldGroup.__doc__
-    )
+    """ + str(MeanFieldGroup.__doc__)
     _group_class = MeanFieldGroup
 
 
 class FullRank(SingleGroupApproximation):
     __doc__ = """**Single Group Full Rank Approximation**
 
-    """ + str(
-        FullRankGroup.__doc__
-    )
+    """ + str(FullRankGroup.__doc__)
     _group_class = FullRankGroup
 
 
 class Empirical(SingleGroupApproximation):
     __doc__ = """**Single Group Full Rank Approximation**
 
-    """ + str(
-        EmpiricalGroup.__doc__
-    )
+    """ + str(EmpiricalGroup.__doc__)
     _group_class = EmpiricalGroup
 
     def __init__(self, trace=None, size=None, **kwargs):
diff --git a/pymc/variational/operators.py b/pymc/variational/operators.py
index 1122a704b..f6ef09572 100644
--- a/pymc/variational/operators.py
+++ b/pymc/variational/operators.py
@@ -130,6 +130,7 @@ class KSD(Operator):
         Stein Variational Gradient Descent: A General Purpose Bayesian Inference Algorithm
         arXiv:1608.04471
     """
+
     has_test_function = True
     returns_loss = False
     require_logq = False
diff --git a/pymc/variational/opvi.py b/pymc/variational/opvi.py
index cf98c985a..bd1874ffe 100644
--- a/pymc/variational/opvi.py
+++ b/pymc/variational/opvi.py
@@ -663,6 +663,7 @@ class Group(WithMemoization):
     -   Kingma, D. P., & Welling, M. (2014).
         `Auto-Encoding Variational Bayes. stat, 1050, 1. <https://arxiv.org/abs/1312.6114>`_
     """
+
     # needs to be defined in init
     shared_params = None
     symbolic_initial = None
@@ -709,8 +710,9 @@ class Group(WithMemoization):
     def group_for_short_name(cls, name):
         if name.lower() not in cls.__name_registry:
             raise KeyError(
-                "No such group: {!r}, "
-                "only the following are supported\n\n{}".format(name, cls.__name_registry)
+                "No such group: {!r}, " "only the following are supported\n\n{}".format(
+                    name, cls.__name_registry
+                )
             )
         return cls.__name_registry[name.lower()]
 
diff --git a/versioneer.py b/versioneer.py
index a560e685f..c2b9d28bc 100644
--- a/versioneer.py
+++ b/versioneer.py
@@ -432,9 +432,7 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, env=
     return stdout, process.returncode
 
 
-LONG_VERSION_PY[
-    "git"
-] = r'''
+LONG_VERSION_PY["git"] = r'''
 # This file helps to compute a version number in source trees obtained from
 # git-archive tarball (such as those provided by githubs download-from-tag
 # feature). Distribution tarballs (built by setup.py sdist) and build