Skip to content

Commit

Permalink
Include np.ndarray as possible type for coord values
Browse files Browse the repository at this point in the history
I originally tried numpy's ArrayLike, replacing Sequence entirely, but then I realized
that ArrayLike also allows non-sequences like integers and floats.

I am not certain if `values="a string"` should be legal. With the type hint sequence, it is.
Might be more accurate, but verbose to use `list | tuple | set | np.ndarray | None`.
  • Loading branch information
thomasaarholt committed Sep 6, 2024
1 parent 383d08e commit 7e1243e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pymc/model/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ def shape_from_dims(self, dims):
def add_coord(
self,
name: str,
values: Sequence | None = None,
values: Sequence | np.ndarray | None = None,
mutable: bool | None = None,
*,
length: int | Variable | None = None,
Expand Down

0 comments on commit 7e1243e

Please sign in to comment.