|
lsst.daf.base g5c4744a4d9+9e5e24d318
|
Public Member Functions | |
| def | from_mapping (cls, metadata) |
| def | get (self, name, default=None) |
| def | getArray (self, name) |
| def | getScalar (self, name) |
| def | set (self, name, value) |
| def | add (self, name, value) |
| def | update (self, addition) |
| def | toDict (self) |
| def | __eq__ (self, other) |
| def | __copy__ (self) |
| def | __deepcopy__ (self, memo) |
| def | __contains__ (self, name) |
| def | __setitem__ (self, name, value) |
| def | __getitem__ (self, name) |
| def | __delitem__ (self, name) |
| def | __str__ (self) |
| def | __len__ (self) |
| def | __iter__ (self) |
| def | keys (self) |
| def | items (self) |
| def | values (self) |
| def | pop (self, name, default=None) |
| def | __reduce__ (self) |
Definition at line 440 of file propertyContainerContinued.py.
| def lsst.daf.base.propertyContainer.propertyContainerContinued.PropertySet.__contains__ | ( | self, | |
| name | |||
| ) |
Determines if the name is found at the top level hierarchy of the container. Notes ------ Does not use `PropertySet.exists()`` because that includes support for "."-delimited names. This method is consistent with the items returned from ``__iter__``.
Definition at line 683 of file propertyContainerContinued.py.
| def lsst.daf.base.propertyContainer.propertyContainerContinued.PropertySet.__copy__ | ( | self | ) |
Definition at line 671 of file propertyContainerContinued.py.
| def lsst.daf.base.propertyContainer.propertyContainerContinued.PropertySet.__deepcopy__ | ( | self, | |
| memo | |||
| ) |
Definition at line 678 of file propertyContainerContinued.py.
| def lsst.daf.base.propertyContainer.propertyContainerContinued.PropertySet.__delitem__ | ( | self, | |
| name | |||
| ) |
Definition at line 729 of file propertyContainerContinued.py.
| def lsst.daf.base.propertyContainer.propertyContainerContinued.PropertySet.__eq__ | ( | self, | |
| other | |||
| ) |
Definition at line 647 of file propertyContainerContinued.py.
| def lsst.daf.base.propertyContainer.propertyContainerContinued.PropertySet.__getitem__ | ( | self, | |
| name | |||
| ) |
Returns a scalar item from the container. Notes ----- Uses `PropertySet.getScalar` to guarantee that a single value will be returned.
Definition at line 719 of file propertyContainerContinued.py.
| def lsst.daf.base.propertyContainer.propertyContainerContinued.PropertySet.__iter__ | ( | self | ) |
Definition at line 742 of file propertyContainerContinued.py.
| def lsst.daf.base.propertyContainer.propertyContainerContinued.PropertySet.__len__ | ( | self | ) |
Definition at line 739 of file propertyContainerContinued.py.
| def lsst.daf.base.propertyContainer.propertyContainerContinued.PropertySet.__reduce__ | ( | self | ) |
Definition at line 784 of file propertyContainerContinued.py.
| def lsst.daf.base.propertyContainer.propertyContainerContinued.PropertySet.__setitem__ | ( | self, | |
| name, | |||
| value | |||
| ) |
Assigns the supplied value to the container.
Parameters
----------
name : `str`
Name of item to update.
value : Value to assign
Can be any value supported by the container's ``set()``
method. `~collections.abc.Mapping` are converted to
`PropertySet` before assignment.
Notes
-----
Uses `PropertySet.set`, overwriting any previous value.
Definition at line 695 of file propertyContainerContinued.py.
| def lsst.daf.base.propertyContainer.propertyContainerContinued.PropertySet.__str__ | ( | self | ) |
Definition at line 736 of file propertyContainerContinued.py.
| def lsst.daf.base.propertyContainer.propertyContainerContinued.PropertySet.add | ( | self, | |
| name, | |||
| value | |||
| ) |
Append one or more values to a given item, which need not exist
If the item exists then the new value(s) are appended;
otherwise it is like calling `set`
Parameters
----------
name : `str`
Name of item
value : any supported type
Value of item; may be a scalar or array
Notes
-----
If ``value`` is an `lsst.daf.base.PropertySet` or
`lsst.daf.base.PropertyList` then ``value`` replaces
the existing value. Also the item is added as a live
reference, so updating ``value`` will update this container
and vice-versa.
Raises
------
lsst::pex::exceptions::TypeError
Raised if the type of `value` is incompatible with the existing
value of the item.
Definition at line 575 of file propertyContainerContinued.py.
| def lsst.daf.base.propertyContainer.propertyContainerContinued.PropertySet.from_mapping | ( | cls, | |
| metadata | |||
| ) |
Create a `PropertySet` from a mapping or dict-like object.
Parameters
----------
metadata : `collections.abc.Mapping`
Metadata from which to create the `PropertySet`.
Can be a mapping, a `~dataclasses.dataclass` or anything that
supports ``toDict()``, ``to_dict()`` or ``dict()`` method.
It is assumed that the dictionary is expanded recursively by these
methods or that the Python type can be understood by `PropertySet`.
Returns
-------
ps : `PropertySet`
The new `PropertySet`.
Definition at line 453 of file propertyContainerContinued.py.
| def lsst.daf.base.propertyContainer.propertyContainerContinued.PropertySet.get | ( | self, | |
| name, | |||
default = None |
|||
| ) |
Return an item as a scalar, else default.
Identical to `getScalar` except that a default value is returned
if the requested key is not present. If an array item is requested
the final value in the array will be returned.
Parameters
----------
name : `str`
Name of item
default : `object`, optional
Default value to use if the named item is not present.
Returns
-------
value : any type supported by container
Single value of any type supported by the container, else the
default value if the requested item is not present in the
container. For array items the most recently added value is
returned.
Definition at line 487 of file propertyContainerContinued.py.
| def lsst.daf.base.propertyContainer.propertyContainerContinued.PropertySet.getArray | ( | self, | |
| name | |||
| ) |
Return an item as an array if the item is numeric or string
If the item is a `PropertySet`, `PropertyList` or
`lsst.daf.base.PersistablePtr` then return the item as a scalar.
Parameters
----------
name : `str`
Name of item
Returns
-------
values : `list` of any type supported by container
The contents of the item, guaranteed to be returned as a `list.`
Raises
------
KeyError
Raised if the item does not exist.
Definition at line 514 of file propertyContainerContinued.py.
| def lsst.daf.base.propertyContainer.propertyContainerContinued.PropertySet.getScalar | ( | self, | |
| name | |||
| ) |
Return an item as a scalar
If the item has more than one value then the last value is returned.
Parameters
----------
name : `str`
Name of item
Returns
-------
value : scalar item
Value stored in the item. If the item refers to an array the
most recently added value is returned.
Raises
------
KeyError
Raised if the item does not exist.
Definition at line 537 of file propertyContainerContinued.py.
| def lsst.daf.base.propertyContainer.propertyContainerContinued.PropertySet.items | ( | self | ) |
Definition at line 749 of file propertyContainerContinued.py.
| def lsst.daf.base.propertyContainer.propertyContainerContinued.PropertySet.keys | ( | self | ) |
Definition at line 746 of file propertyContainerContinued.py.
| def lsst.daf.base.propertyContainer.propertyContainerContinued.PropertySet.pop | ( | self, | |
| name, | |||
default = None |
|||
| ) |
Remove the named key and return its value.
Parameters
----------
name : `str`
Name of the key to remove. Can be hierarchical.
default : Any, optional
Value to return if the key is not present.
Returns
-------
value : Any
The value of the item as would be returned using `getScalar()`.
Raises
------
KeyError
Raised if no default is given and the key is missing.
Definition at line 755 of file propertyContainerContinued.py.
| def lsst.daf.base.propertyContainer.propertyContainerContinued.PropertySet.set | ( | self, | |
| name, | |||
| value | |||
| ) |
Set the value of an item
If the item already exists it is silently replaced; the types
need not match.
Parameters
----------
name : `str`
Name of item
value : any supported type
Value of item; may be a scalar or array
Definition at line 560 of file propertyContainerContinued.py.
| def lsst.daf.base.propertyContainer.propertyContainerContinued.PropertySet.toDict | ( | self | ) |
Returns a (possibly nested) dictionary with all properties.
Returns
-------
d : `dict`
Dictionary with all names and values (no comments).
Definition at line 628 of file propertyContainerContinued.py.
| def lsst.daf.base.propertyContainer.propertyContainerContinued.PropertySet.update | ( | self, | |
| addition | |||
| ) |
Update the current container with the supplied additions.
Parameters
----------
addition : `collections.abc.Mapping` or `PropertySet`
The content to merge into the current container.
Notes
-----
This is not the same as calling `PropertySet.combine` since the
behavior differs when both mappings contain the same key. This
method updates by overwriting existing values completely with
the new value.
Definition at line 604 of file propertyContainerContinued.py.
| def lsst.daf.base.propertyContainer.propertyContainerContinued.PropertySet.values | ( | self | ) |
Definition at line 752 of file propertyContainerContinued.py.