Skip to content

Commit c7e53c5

Browse files
committed
Update Black formatting
1 parent aef6bec commit c7e53c5

File tree

6 files changed

+19
-17
lines changed

6 files changed

+19
-17
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[flake8]
2-
ignore = E127,E201,E202,E203,E231,E252,E266,E402,E999,F841,W503,W605
2+
ignore = E127,E201,E202,E203,E231,E252,E266,E402,E999,F841,W503,W605,E704
33
max-line-length = 80
44
exclude = .git,docs,docsrc,scripts,cmdstanpy_tutorial.py,rtd_change_default_version.py

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@ exclude: 'docsrc'
22
fail_fast: true
33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v3.2.0
5+
rev: v6.0.0
66
hooks:
77
- id: check-yaml
88
# isort should run before black as black sometimes tweaks the isort output
99
- repo: https://github.com/PyCQA/isort
10-
rev: 5.12.0
10+
rev: 7.0.0
1111
hooks:
1212
- id: isort
1313
# https://github.com/python/black#version-control-integration
1414
- repo: https://github.com/psf/black
15-
rev: 23.7.0
15+
rev: 25.9.0
1616
hooks:
1717
- id: black
1818
- repo: https://github.com/pycqa/flake8
19-
rev: 3.9.2
19+
rev: 7.3.0
2020
hooks:
2121
- id: flake8
2222
- repo: https://github.com/pre-commit/mirrors-mypy
23-
rev: v1.5.0
23+
rev: v1.18.2
2424
hooks:
2525
- id: mypy
2626
additional_dependencies: [ numpy >= 1.22]

cmdstanpy/install_cmdstan.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,9 +475,9 @@ def retrieve_version(version: str, progress: bool = True) -> None:
475475
for i in range(6): # always retry to allow for transient URLErrors
476476
try:
477477
if progress and progbar.allow_show_progress():
478-
progress_hook: Callable[
479-
[int, int, int], None
480-
] | None = wrap_url_progress_hook()
478+
progress_hook: Callable[[int, int, int], None] | None = (
479+
wrap_url_progress_hook()
480+
)
481481
else:
482482
progress_hook = None
483483
file_tmp, _ = urllib.request.urlretrieve(

cmdstanpy/stanfit/gq.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Container for the result of running the
33
generate quantities (GQ) method
44
"""
5+
56
from __future__ import annotations
67

78
from collections import Counter
@@ -404,17 +405,15 @@ def draws_xr(
404405
vars: str | list[str] | None = None,
405406
inc_warmup: bool = False,
406407
inc_sample: bool = False,
407-
) -> NoReturn:
408-
...
408+
) -> NoReturn: ...
409409

410410
@overload
411411
def draws_xr(
412412
self: "CmdStanGQ[CmdStanMCMC]",
413413
vars: str | list[str] | None = None,
414414
inc_warmup: bool = False,
415415
inc_sample: bool = False,
416-
) -> "xr.Dataset":
417-
...
416+
) -> "xr.Dataset": ...
418417

419418
def draws_xr(
420419
self,

cmdstanpy/utils/stancsv.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -634,10 +634,12 @@ def parse_rdump_value(rhs: str) -> int | float | np.ndarray:
634634

635635

636636
def try_deduce_metric_type(
637-
inv_metric: str
638-
| np.ndarray
639-
| Mapping[str, Any]
640-
| Sequence[str | np.ndarray | Mapping[str, Any]],
637+
inv_metric: (
638+
str
639+
| np.ndarray
640+
| Mapping[str, Any]
641+
| Sequence[str | np.ndarray | Mapping[str, Any]]
642+
),
641643
) -> str | None:
642644
"""Given a user-supplied metric, try to infer the correct metric type."""
643645
if isinstance(inv_metric, Sequence) and not isinstance(

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ docs = [
6767
[tool.black]
6868
line-length = 80
6969
skip-string-normalization = true
70+
target-version = ['py310', 'py311', 'py312', 'py313', 'py314']
7071

7172
[tool.isort]
7273
multi_line_output = 3

0 commit comments

Comments
 (0)