bayesline.api.rekey_by_identity#
- bayesline.api.rekey_by_identity(by_key: Mapping[str, _T]) dict[str, _T]#
Rekey a mapping by the canonical identity of each key.
Parameters#
- by_keyMapping[str, _T]
Values stated against identities, in any case.
Returns#
- dict[str, _T]
The same values, keyed canonically.
Raises#
- ValueError
If a key is not an identity, or if two name the same feature, in which case one of the two values stated for it would be discarded.