11has_all_sample_dims (dims) = all (Dimensions. hasdim (dims, DEFAULT_SAMPLE_DIMS))
22
3- # Like Dimensions.key2dim but doesn't allow users to inject their own dimensions using
3+ # Like Dimensions.name2dim but doesn't allow users to inject their own dimensions using
44# Dimensions.@dim. See https://github.com/arviz-devs/InferenceObjects.jl/issues/37
5- _key2dim (d:: Symbol ) = Dimensions. Dim {d} (LookupArrays. NoLookup ())
6- _key2dim (d:: Tuple ) = map (_key2dim , d)
7- _key2dim (d) = d
5+ _name2dim (d:: Symbol ) = Dimensions. Dim {d} (LookupArrays. NoLookup ())
6+ _name2dim (d:: Tuple ) = map (_name2dim , d)
7+ _name2dim (d) = d
88
99# make sure dim has a lookup value accessible with `val`
1010_valdim (d) = d
@@ -30,7 +30,7 @@ Convert `dim`, `coords`, and `axis` to a `Dimension` object.
3030 - `axis`: A default axis to be used if `coords` and `dim` indices are not provided.
3131"""
3232function as_dimension (dim, coords, axis)
33- cdim = _valdim (_key2dim (dim))
33+ cdim = _valdim (_name2dim (dim))
3434 val = LookupArrays. val (cdim)
3535 inds = val isa Union{Colon,LookupArrays. NoLookup} ? axis : val
3636 coords_inds = get (coords, Dimensions. name (cdim), inds)
@@ -64,7 +64,7 @@ Generate `DimensionsionalData.Dimension` objects for each dimension of `array`.
6464function generate_dims (array, name; dims= (), coords= (;), default_dims= ())
6565 num_default_dims = length (default_dims)
6666 if length (dims) + num_default_dims > ndims (array)
67- dim_names = Dimensions. name (_key2dim ((default_dims... , dims... )))
67+ dim_names = Dimensions. name (_name2dim ((default_dims... , dims... )))
6868 throw (
6969 DimensionMismatch (
7070 " Provided dimensions $dim_names more than dimensions of array: $(ndims (array)) " ,
0 commit comments