@@ -1000,17 +1000,18 @@ def add_coord(
1000
1000
----------
1001
1001
name : str
1002
1002
Name of the dimension.
1003
- Forbidden: {"chain", "draw"}
1003
+ Forbidden: {"chain", "draw", "__sample__" }
1004
1004
values : optional, array-like
1005
1005
Coordinate values or ``None`` (for auto-numbering).
1006
1006
If ``None`` is passed, a ``length`` must be specified.
1007
1007
length : optional, scalar
1008
1008
A symbolic scalar of the dimensions length.
1009
1009
Defaults to ``aesara.shared(len(values))``.
1010
1010
"""
1011
- if name in {"draw" , "chain" }:
1011
+ if name in {"draw" , "chain" , "__sample__" }:
1012
1012
raise ValueError (
1013
- "Dimensions can not be named `draw` or `chain`, as they are reserved for the sampler's outputs."
1013
+ "Dimensions can not be named `draw`, `chain` or `__sample__`, "
1014
+ "as those are reserved for use in `InferenceData`."
1014
1015
)
1015
1016
if values is None and length is None :
1016
1017
raise ValueError (
@@ -1022,7 +1023,7 @@ def add_coord(
1022
1023
)
1023
1024
if name in self .coords :
1024
1025
if not values .equals (self .coords [name ]):
1025
- raise ValueError ("Duplicate and incompatiple coordinate: %s." % name )
1026
+ raise ValueError (f "Duplicate and incompatible coordinate: { name } ." )
1026
1027
else :
1027
1028
self ._coords [name ] = values
1028
1029
self ._dim_lengths [name ] = length or aesara .shared (len (values ))
0 commit comments