File tree Expand file tree Collapse file tree 3 files changed +8
-13
lines changed
Expand file tree Collapse file tree 3 files changed +8
-13
lines changed Original file line number Diff line number Diff line change 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-
3229import numpy as np
3330import xarray
3431
4239
4340import pymc
4441
42+ from pymc .distributions .shape_utils import StrongCoords
4543from pymc .model import Model , modelcontext
4644from pymc .progress_bar import CustomProgress , default_progress_theme
4745from 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
Original file line number Diff line number Diff line change 1616
1717import warnings
1818
19- from collections .abc import Sequence
19+ from collections .abc import Hashable , Mapping , Sequence
2020from functools import singledispatch
2121from types import EllipsisType
2222from typing import Any , TypeAlias , cast
@@ -97,9 +97,6 @@ def _check_shape_type(shape):
9797StrongDimsWithEllipsis : TypeAlias = Sequence [str | EllipsisType ]
9898StrongSize : TypeAlias = TensorVariable | tuple [int | Variable , ...]
9999
100- from collections .abc import Mapping
101- from typing import Hashable
102-
103100CoordValue : TypeAlias = Sequence [Hashable ] | np .ndarray | None
104101Coords : TypeAlias = Mapping [str , CoordValue ]
105102
Original file line number Diff line number Diff line change 2020import warnings
2121
2222from collections .abc import Iterable , Sequence
23- from pymc .distributions .shape_utils import Coords , StrongCoords , CoordValue
24-
2523from typing import (
2624 Literal ,
2725 cast ,
4644
4745from pymc .blocking import DictToArrayBijection , RaveledVars
4846from pymc .data import MinibatchOp , is_valid_observed
47+ from pymc .distributions .shape_utils import Coords , CoordValue , StrongCoords
4948from 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 ]:
You can’t perform that action at this time.
0 commit comments