Skip to content

Commit 77c2acb

Browse files
committed
Fix ruff formatting, imports, and dev requirements
1 parent 7ccf981 commit 77c2acb

File tree

3 files changed

+8
-13
lines changed

3 files changed

+8
-13
lines changed

pymc/backends/arviz.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,11 @@
2121
TYPE_CHECKING,
2222
Any,
2323
Optional,
24+
TypeAlias,
2425
Union,
2526
cast,
26-
TypeAlias,
2727
)
2828

29-
from pymc.distributions.shape_utils import StrongCoords
30-
31-
3229
import numpy as np
3330
import xarray
3431

@@ -42,6 +39,7 @@
4239

4340
import pymc
4441

42+
from pymc.distributions.shape_utils import StrongCoords
4543
from pymc.model import Model, modelcontext
4644
from pymc.progress_bar import CustomProgress, default_progress_theme
4745
from pymc.pytensorf import PointFunc, extract_obs_data
@@ -128,8 +126,9 @@ def find_constants(model: "Model") -> dict[str, Var]:
128126
return constant_data
129127

130128

131-
def coords_and_dims_for_inferencedata(model: Model,) -> tuple[StrongCoords, DimsDict]:
132-
129+
def coords_and_dims_for_inferencedata(
130+
model: Model,
131+
) -> tuple[StrongCoords, DimsDict]:
133132
"""Parse PyMC model coords and dims format to one accepted by InferenceData."""
134133
coords = {
135134
cname: np.array(cvals) if isinstance(cvals, tuple) else cvals

pymc/distributions/shape_utils.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import warnings
1818

19-
from collections.abc import Sequence
19+
from collections.abc import Hashable, Mapping, Sequence
2020
from functools import singledispatch
2121
from types import EllipsisType
2222
from typing import Any, TypeAlias, cast
@@ -97,9 +97,6 @@ def _check_shape_type(shape):
9797
StrongDimsWithEllipsis: TypeAlias = Sequence[str | EllipsisType]
9898
StrongSize: TypeAlias = TensorVariable | tuple[int | Variable, ...]
9999

100-
from collections.abc import Mapping
101-
from typing import Hashable
102-
103100
CoordValue: TypeAlias = Sequence[Hashable] | np.ndarray | None
104101
Coords: TypeAlias = Mapping[str, CoordValue]
105102

pymc/model/core.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
import warnings
2121

2222
from collections.abc import Iterable, Sequence
23-
from pymc.distributions.shape_utils import Coords, StrongCoords, CoordValue
24-
2523
from typing import (
2624
Literal,
2725
cast,
@@ -46,6 +44,7 @@
4644

4745
from pymc.blocking import DictToArrayBijection, RaveledVars
4846
from pymc.data import MinibatchOp, is_valid_observed
47+
from pymc.distributions.shape_utils import Coords, CoordValue, StrongCoords
4948
from pymc.exceptions import (
5049
BlockModelAccessError,
5150
ImputationWarning,
@@ -911,7 +910,7 @@ def unobserved_RVs(self):
911910
@property
912911
def coords(self) -> StrongCoords:
913912
"""Coordinate values for model dimensions."""
914-
return self._coords
913+
return self._coords
915914

916915
@property
917916
def dim_lengths(self) -> dict[str, TensorVariable]:

0 commit comments

Comments
 (0)