lsst.afw gb3a676b8dc+b4feba26a1
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
lsst.afw.typehandling._GenericMap.AutoKeyMeta Class Reference
Inheritance diagram for lsst.afw.typehandling._GenericMap.AutoKeyMeta:
lsst.afw.typehandling._SimpleGenericMap.SimpleGenericMap

Public Member Functions

 __call__ (cls, *args, **kwargs)
 

Public Attributes

 TEMPLATE_PARAMS
 

Protected Member Functions

 _guessKeyType (cls, inputData)
 

Detailed Description

A metaclass for abstract mappings whose key type is implied by their
constructor arguments.

This metaclass requires that the mapping have a `dict`-like constructor,
i.e., it takes a mapping or an iterable of key-value pairs as its first
positional parameter.

This class differs from `~lsst.utils.TemplateMeta` only in that the dtype
(or equivalent) constructor keyword is optional. If it is omitted, the
class will attempt to infer it from the first argument.

Definition at line 122 of file _GenericMap.py.

Member Function Documentation

◆ __call__()

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

Definition at line 135 of file _GenericMap.py.

◆ _guessKeyType()

lsst.afw.typehandling._GenericMap.AutoKeyMeta._guessKeyType ( cls,
inputData )
protected
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.

Member Data Documentation

◆ TEMPLATE_PARAMS

lsst.afw.typehandling._GenericMap.AutoKeyMeta.TEMPLATE_PARAMS

Definition at line 136 of file _GenericMap.py.


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