@@ -959,17 +959,18 @@ def add_coord(
959
959
----------
960
960
name : str
961
961
Name of the dimension.
962
- Forbidden: {"chain", "draw"}
962
+ Forbidden: {"chain", "draw", "__sample__" }
963
963
values : optional, array-like
964
964
Coordinate values or ``None`` (for auto-numbering).
965
965
If ``None`` is passed, a ``length`` must be specified.
966
966
length : optional, scalar
967
967
A symbolic scalar of the dimensions length.
968
968
Defaults to ``aesara.shared(len(values))``.
969
969
"""
970
- if name in {"draw" , "chain" }:
970
+ if name in {"draw" , "chain" , "__sample__" }:
971
971
raise ValueError (
972
- "Dimensions can not be named `draw` or `chain`, as they are reserved for the sampler's outputs."
972
+ "Dimensions can not be named `draw`, `chain` or `__sample__`, "
973
+ "as those are reserved for use in `InferenceData`."
973
974
)
974
975
if values is None and length is None :
975
976
raise ValueError (
@@ -981,7 +982,7 @@ def add_coord(
981
982
)
982
983
if name in self .coords :
983
984
if not values .equals (self .coords [name ]):
984
- raise ValueError ("Duplicate and incompatiple coordinate: %s." % name )
985
+ raise ValueError (f "Duplicate and incompatiple coordinate: { name } ." )
985
986
else :
986
987
self ._coords [name ] = values
987
988
self ._dim_lengths [name ] = length or aesara .shared (len (values ))
0 commit comments