schrodinger.application.matsci.qexsd.qespresso.utils.mapping module¶
Useful classes for building mapping structures.
-
class
schrodinger.application.matsci.qexsd.qespresso.utils.mapping.
BiunivocalMap
(*args, **kwargs)¶ Bases:
collections.abc.MutableMapping
A dictionary that implements a bijective correspondence, namely with constraints of uniqueness both on keys that on values.
-
__init__
(*args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
__getitem__
(key)¶
-
__setitem__
(key, item)¶
-
__delitem__
(key)¶
-
__iter__
()¶
-
__len__
()¶
-
__contains__
(key)¶
-
__repr__
()¶ Return repr(self).
-
copy
()¶
-
classmethod
fromkeys
(iterable, value=None)¶
-
getkey
(value, default=None)¶ If value is in dictionary’s values, return the key correspondent to the value, else return None.
Parameters: - value – Value to map
- default – Default to return if the value is not in the map values
-
inverse
()¶ Return a copy of the inverse dictionary.
-
__abstractmethods__
= frozenset()¶
-
__class__
¶ alias of
abc.ABCMeta
-
__delattr__
¶ Implement delattr(self, name).
-
__dict__
= mappingproxy({'__module__': 'schrodinger.application.matsci.qexsd.qespresso.utils.mapping', '__doc__': '\n A dictionary that implements a bijective correspondence, namely with constraints\n of uniqueness both on keys that on values.\n ', '__init__': <function BiunivocalMap.__init__>, '__getitem__': <function BiunivocalMap.__getitem__>, '__setitem__': <function BiunivocalMap.__setitem__>, '__delitem__': <function BiunivocalMap.__delitem__>, '__iter__': <function BiunivocalMap.__iter__>, '__len__': <function BiunivocalMap.__len__>, '__contains__': <function BiunivocalMap.__contains__>, '__repr__': <function BiunivocalMap.__repr__>, 'copy': <function BiunivocalMap.copy>, 'fromkeys': <classmethod object>, 'getkey': <function BiunivocalMap.getkey>, 'inverse': <function BiunivocalMap.inverse>, '__dict__': <attribute '__dict__' of 'BiunivocalMap' objects>, '__weakref__': <attribute '__weakref__' of 'BiunivocalMap' objects>, '__abstractmethods__': frozenset(), '_abc_registry': <_weakrefset.WeakSet object>, '_abc_cache': <_weakrefset.WeakSet object>, '_abc_negative_cache': <_weakrefset.WeakSet object>, '_abc_negative_cache_version': 49})¶
-
__dir__
() → list¶ default dir() implementation
-
__eq__
(other)¶ Return self==value.
-
__format__
()¶ default object formatter
-
__ge__
¶ Return self>=value.
-
__getattribute__
¶ Return getattr(self, name).
-
__gt__
¶ Return self>value.
-
__hash__
= None¶
-
__init_subclass__
()¶ This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
-
__le__
¶ Return self<=value.
-
__lt__
¶ Return self<value.
-
__module__
= 'schrodinger.application.matsci.qexsd.qespresso.utils.mapping'¶
-
__ne__
¶ Return self!=value.
-
__new__
()¶ Create and return a new object. See help(type) for accurate signature.
-
__reduce__
()¶ helper for pickle
-
__reduce_ex__
()¶ helper for pickle
-
__reversed__
= None¶
-
__setattr__
¶ Implement setattr(self, name, value).
-
__sizeof__
() → int¶ size of object in memory, in bytes
-
__slots__
= ()¶
-
__str__
¶ Return str(self).
-
classmethod
__subclasshook__
(C)¶ Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
-
__weakref__
¶ list of weak references to the object (if defined)
-
clear
() → None. Remove all items from D.¶
-
get
(k[, d]) → D[k] if k in D, else d. d defaults to None.¶
-
items
() → a set-like object providing a view on D's items¶
-
keys
() → a set-like object providing a view on D's keys¶
-
pop
(k[, d]) → v, remove specified key and return the corresponding value.¶ If key is not found, d is returned if given, otherwise KeyError is raised.
-
popitem
() → (k, v), remove and return some (key, value) pair¶ as a 2-tuple; but raise KeyError if D is empty.
-
setdefault
(k[, d]) → D.get(k,d), also set D[k]=d if k not in D¶
-
update
([E, ]**F) → None. Update D from mapping/iterable E and F.¶ If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
-
values
() → an object providing a view on D's values¶
-