colour.plotting.LABELS_PLANCKIAN_LOCUS_DEFAULT#
- colour.plotting.LABELS_PLANCKIAN_LOCUS_DEFAULT = CanonicalMapping({'Default': ..., 'Mireds': ...})#
Represent a delimiter and case-insensitive
dict-like object supporting both slug keys (SEO-friendly, human-readable versions with delimiters) and canonical keys (slugified keys without delimiters).This class extends
MutableMappingto provide flexible key matching that accepts various transformations of the original key while maintaining the original key structure for storage. Item keys must bestr-like objects supporting thestr.lower()method. Set items using the specified original keys. Retrieve, delete, or test item existence by transforming the query key through the following sequence:Original Key
Lowercase Key
Slugified Key
Canonical Key
For example, using the
McCamy 1992key:Original Key :
McCamy 1992Lowercase Key :
mccamy 1992Slugified Key :
mccamy-1992Canonical Key :
mccamy1992
- Parameters:
data – Data to store into the delimiter and case-insensitive
dict-like object at initialisation.kwargs – Key / value pairs to store into the mapping at initialisation.
Attributes
Methods
Examples
>>> methods = CanonicalMapping({"McCamy 1992": 1, "Hernandez 1999": 2}) >>> methods["mccamy 1992"] 1 >>> methods["MCCAMY 1992"] 1 >>> methods["mccamy-1992"] 1 >>> methods["mccamy1992"] 1