lsst.afw gf03f0b42f3+b1047159b2
Loading...
Searching...
No Matches
lsst.afw.typehandling._SimpleGenericMap.SimpleGenericMap Class Reference
Inheritance diagram for lsst.afw.typehandling._SimpleGenericMap.SimpleGenericMap:
lsst.afw.typehandling._GenericMap.MutableGenericMap lsst.afw.typehandling._GenericMap.AutoKeyMeta lsst.afw.typehandling._GenericMap.GenericMap

Public Member Functions

 fromkeys (cls, iterable, value=None)
 
 pop (self, key, default=None)
 
 __repr__ (self)
 
 __eq__ (self, other)
 
 __call__ (cls, *args, **kwargs)
 

Public Attributes

 TEMPLATE_PARAMS
 

Static Public Attributes

 setdefault = MutableMapping.setdefault
 
 update = MutableMapping.update
 
 keys = Mapping.keys
 
 values = Mapping.values
 
 items = Mapping.items
 

Protected Member Functions

 _guessKeyType (cls, inputData)
 

Detailed Description

A `dict`-like `~collections.abc.MutableMapping` for use when sharing a
map between C++ and Python.

For compatibility with C++, ``SimpleGenericMap`` has the following
restrictions:

    - all keys must be of the same type
    - values must be built-in types or subclasses of
      `lsst.afw.typehandling.Storable`. Almost any user-defined class in
      C++ or Python can have `~lsst.afw.typehandling.Storable` as a mixin.

As a safety precaution, `~lsst.afw.typehandling.Storable` objects that are
added from C++ may be copied when you retrieve them from Python, making it
impossible to modify them in-place. This issue does not affect objects that
are added from Python, or objects that are always passed by
:cpp:class:`shared_ptr` in C++.

Parameters
----------
mapping : `collections.abc.Mapping`, optional
iterable : iterable, optional
dtype : `type`, optional
    The type of key the map accepts. Not required if ``mapping`` or
    ``iterable`` is provided.
**kwargs
    Aside from the ``dtype`` keyword, a ``SimpleGenericMap`` takes the same
    input arguments as `dict`.

Definition at line 29 of file _SimpleGenericMap.py.

Member Function Documentation

◆ __call__()

lsst.afw.typehandling._GenericMap.AutoKeyMeta.__call__ ( cls,
* args,
** kwargs )
inherited

Definition at line 135 of file _GenericMap.py.

◆ __eq__()

lsst.afw.typehandling._GenericMap.GenericMap.__eq__ ( self,
other )
inherited

Definition at line 55 of file _GenericMap.py.

◆ __repr__()

lsst.afw.typehandling._GenericMap.GenericMap.__repr__ ( self)
inherited

Definition at line 49 of file _GenericMap.py.

◆ _guessKeyType()

lsst.afw.typehandling._GenericMap.AutoKeyMeta._guessKeyType ( cls,
inputData )
protectedinherited
Try to infer the key type of a map from its input.

Parameters
----------
inputData : `~collections.abc.Mapping` or iterable of pairs
    Any object that can be passed to a `dict`-like constructor. Keys
    are assumed homogeneous (if not, a
    `~lsst.afw.typehandling.GenericMap` constructor will raise
    `TypeError` no matter what key type, if any, is provided).

Returns
-------
keyType : `type`
    The type of the keys in ``inputData``, or `None` if the type could
    not be inferred.

Definition at line 149 of file _GenericMap.py.

◆ fromkeys()

lsst.afw.typehandling._SimpleGenericMap.SimpleGenericMap.fromkeys ( cls,
iterable,
value = None )

Definition at line 59 of file _SimpleGenericMap.py.

◆ pop()

lsst.afw.typehandling._GenericMap.MutableGenericMap.pop ( self,
key,
default = None )
inherited

Definition at line 106 of file _GenericMap.py.

Member Data Documentation

◆ items

lsst.afw.typehandling._GenericMap.GenericMap.items = Mapping.items
staticinherited

Definition at line 70 of file _GenericMap.py.

◆ keys

lsst.afw.typehandling._GenericMap.GenericMap.keys = Mapping.keys
staticinherited

Definition at line 68 of file _GenericMap.py.

◆ setdefault

lsst.afw.typehandling._GenericMap.MutableGenericMap.setdefault = MutableMapping.setdefault
staticinherited

Definition at line 102 of file _GenericMap.py.

◆ TEMPLATE_PARAMS

lsst.afw.typehandling._GenericMap.AutoKeyMeta.TEMPLATE_PARAMS
inherited

Definition at line 136 of file _GenericMap.py.

◆ update

lsst.afw.typehandling._GenericMap.MutableGenericMap.update = MutableMapping.update
staticinherited

Definition at line 103 of file _GenericMap.py.

◆ values

lsst.afw.typehandling._GenericMap.GenericMap.values = Mapping.values
staticinherited

Definition at line 69 of file _GenericMap.py.


The documentation for this class was generated from the following file: