Public Member Functions | |
def | __init__ (self, *args, **kwargs) |
def | insert_contexts (self, *contexts) |
def | remove_contexts (self, n) |
def | defaults (self) |
def | graph (self) |
def | transform (self, src, dst, registry, value) |
Public Member Functions inherited from SUAVE.Plugins.pint.compat.ChainMap | |
def | __init__ (self, *maps) |
def | __missing__ (self, key) |
def | __getitem__ (self, key) |
def | get (self, key, default=None) |
def | __len__ (self) |
def | __iter__ (self) |
def | __contains__ (self, key) |
def | __bool__ (self) |
def | __repr__ (self) |
def | fromkeys (cls, iterable, *args) |
def | copy (self) |
def | new_child (self, m=None) |
def | parents (self) |
def | __setitem__ (self, key, value) |
def | __delitem__ (self, key) |
def | popitem (self) |
def | pop (self, key, *args) |
def | clear (self) |
Public Attributes | |
maps | |
Public Attributes inherited from SUAVE.Plugins.pint.compat.ChainMap | |
maps | |
A specialized ChainMap for contexts that simplifies finding rules to transform from one dimension to another.
def SUAVE.Plugins.pint.context.ContextChain.graph | ( | self | ) |
The graph relating
def SUAVE.Plugins.pint.context.ContextChain.insert_contexts | ( | self, | |
* | contexts | ||
) |
Insert one or more contexts in reversed order the chained map. (A rule in last context will take precedence) To facilitate the identification of the context with the matching rule, the *relation_to_context* dictionary of the context is used.
def SUAVE.Plugins.pint.context.ContextChain.remove_contexts | ( | self, | |
n | |||
) |
Remove the last n inserted contexts from the chain.
def SUAVE.Plugins.pint.context.ContextChain.transform | ( | self, | |
src, | |||
dst, | |||
registry, | |||
value | |||
) |
Transform the value, finding the rule in the chained context. (A rule in last context will take precedence) :raises: KeyError if the rule is not found.