|
lsst.daf.base g9acbc9a64b+25ce2dec9e
|
Classes | |
| class | ReturnStyle |
| class | PropertySet |
| class | PropertyList |
Functions | |
| getPropertySetState (container, asLists=False) | |
| getPropertyListState (container, asLists=False) | |
| setPropertySetState (container, state) | |
| setPropertyListState (container, state) | |
| _propertyContainerElementTypeName (container, name) | |
| _propertyContainerGet (container, name, returnStyle) | |
| _iterable (a) | |
| _guessIntegerType (container, name, value) | |
| _propertyContainerSet (container, name, value, typeMenu, *args) | |
| _propertyContainerAdd (container, name, value, typeMenu, *args) | |
| _makePropertySet (state) | |
| _makePropertyList (state) | |
Variables | |
| TypeAlias | NestedMetadataDict = Mapping[str, Union[str, float, int, bool, "NestedMetadataDict"]] |
| dict | _TYPE_MAP = {} |
| type_obj = getattr(PropertySet, "TYPE_" + checkType) | |
|
protected |
Given an existing container and name, determine the type
that should be used for the supplied value. The supplied value
is assumed to be a scalar.
On Python 3 all ints are LongLong but we need to be able to store them
in Int containers if that is what is being used (testing for truncation).
Int is assumed to mean 32bit integer (2147483647 to -2147483648).
If there is no pre-existing value we have to decide what to do. For now
we pick Int if the value is less than maxsize.
Parameters
----------
container : `lsst.daf.base.PropertySet` or `lsst.daf.base.PropertyList`
Container from which to get the value
name : `str`
Name of item
value : `object`
Value to be assigned a type. Can be an iterable.
Returns
-------
useType : `str` or none
Type to use for the supplied value. `None` if the input is
`bool` or a non-integral value.
Definition at line 263 of file propertyContainerContinued.py.
|
protected |
Make input iterable. Takes whatever is given to it and yields it back one element at a time. If it is not an iterable or it is a string or PropertySet/List, yields itself.
Definition at line 247 of file propertyContainerContinued.py.
|
protected |
Make a `PropertyList` from the state returned by
`getPropertyListState`
Parameters
----------
state : `list`
The data returned by `getPropertySetState`.
Definition at line 434 of file propertyContainerContinued.py.
|
protected |
Make a `PropertySet` from the state returned by `getPropertySetState`
Parameters
----------
state : `list`
The data returned by `getPropertySetState`.
Definition at line 421 of file propertyContainerContinued.py.
|
protected |
Add a single Python value of unknown type
Definition at line 397 of file propertyContainerContinued.py.
|
protected |
Return name of the type of a particular element
Parameters
----------
container : `lsst.daf.base.PropertySet` or `lsst.daf.base.PropertyList`
Container including the element
name : `str`
Name of element
Definition at line 172 of file propertyContainerContinued.py.
|
protected |
Get a value of unknown type as a scalar or array
Parameters
----------
container : `lsst.daf.base.PropertySet` or `lsst.daf.base.PropertyList`
Container from which to get the value
name : `str`
Name of item
returnStyle : `ReturnStyle`
Control whether numeric or string data is returned as an array
or scalar (the other types, ``PropertyList``, ``PropertySet``
and ``PersistablePtr``, are always returned as a scalar):
- ReturnStyle.ARRAY: return numeric or string data types
as an array of values.
- ReturnStyle.SCALAR: return numeric or string data types
as a single value; if the item has multiple values then
return the last value.
- ReturnStyle.AUTO: (deprecated) return numeric or string data
as a scalar if there is just one item, or as an array
otherwise.
Raises
------
KeyError
Raised if the specified key does not exist in the container.
TypeError
Raised if the value retrieved is of an unexpected type.
ValueError
Raised if the value for ``returnStyle`` is not correct.
Definition at line 192 of file propertyContainerContinued.py.
|
protected |
Set a single Python value of unknown type
Definition at line 373 of file propertyContainerContinued.py.
| getPropertyListState | ( | container, | |
| asLists = False ) |
Get the state of a PropertyList in a form that can be pickled.
Parameters
----------
container : `PropertyList`
The property container.
asLists : `bool`, optional
If False, the default, `tuple` will be used for the contents. If true
a `list` will be used.
Returns
-------
state : `list` of `tuple` or `list` of `list`
The state, as a list of tuples (or lists), each of which contains
the following 4 items:
name (a `str`):
the name of the item
elementTypeName (a `str`):
the suffix of a ``setX`` method name
which is appropriate for the data type. For example integer
data has ``elementTypeName="Int"` which corresponds to
the ``setInt`` method.
value
the data for the item, in a form compatible
with the set method named by ``elementTypeName``
comment (a `str`): the comment. This item is only present
if ``container`` is a PropertyList.
Definition at line 96 of file propertyContainerContinued.py.
| getPropertySetState | ( | container, | |
| asLists = False ) |
Get the state of a PropertySet in a form that can be pickled.
Parameters
----------
container : `PropertySet`
The property container.
asLists : `bool`, optional
If False, the default, `tuple` will be used for the contents. If true
a `list` will be used.
Returns
-------
state : `list` of `tuple` or `list` of `list`
The state, as a list of tuples (or lists), each of which contains
the following 3 items:
name (a `str`)
the name of the item
elementTypeName (a `str`)
the suffix of a ``setX`` method name
which is appropriate for the data type. For example integer
data has ``elementTypeName="Int"` which corresponds to
the ``setInt`` method.
value
the data for the item, in a form compatible
with the set method named by ``elementTypeName``
Definition at line 61 of file propertyContainerContinued.py.
| setPropertyListState | ( | container, | |
| state ) |
Restore the state of a PropertyList, in place.
Parameters
----------
container : `PropertyList`
The property container whose state is to be restored.
It should be empty to start with and is updated in place.
state : `list`
The state, as returned by ``getPropertyListState``
Definition at line 151 of file propertyContainerContinued.py.
| setPropertySetState | ( | container, | |
| state ) |
Restore the state of a PropertySet, in place.
Parameters
----------
container : `PropertySet`
The property container whose state is to be restored.
It should be empty to start with and is updated in place.
state : `list`
The state, as returned by `getPropertySetState`
Definition at line 133 of file propertyContainerContinued.py.
|
protected |
Definition at line 51 of file propertyContainerContinued.py.
| TypeAlias lsst.daf.base.propertyContainer.propertyContainerContinued.NestedMetadataDict = Mapping[str, Union[str, float, int, bool, "NestedMetadataDict"]] |
Definition at line 47 of file propertyContainerContinued.py.
| lsst.daf.base.propertyContainer.propertyContainerContinued.type_obj = getattr(PropertySet, "TYPE_" + checkType) |
Definition at line 55 of file propertyContainerContinued.py.