|
| from_mapping (cls, metadata) |
|
| get (self, name, default=None) |
|
| getArray (self, name) |
|
| getScalar (self, name) |
|
| set (self, name, value) |
|
| add (self, name, value) |
|
| update (self, addition) |
|
| toDict (self) |
|
| __eq__ (self, other) |
|
| __copy__ (self) |
|
| __deepcopy__ (self, memo) |
|
| __contains__ (self, name) |
|
| __setitem__ (self, name, value) |
|
| __getitem__ (self, name) |
|
| __delitem__ (self, name) |
|
| __str__ (self) |
|
| __len__ (self) |
|
| __iter__ (self) |
|
| keys (self) |
|
| items (self) |
|
| values (self) |
|
| pop (self, name, default=None) |
|
| __reduce__ (self) |
|
◆ __contains__()
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 682 of file propertyContainerContinued.py.
◆ __copy__()
lsst.daf.base.propertyContainer.propertyContainerContinued.PropertySet.__copy__ |
( |
| self | ) |
|
◆ __deepcopy__()
lsst.daf.base.propertyContainer.propertyContainerContinued.PropertySet.__deepcopy__ |
( |
| self, |
|
|
| memo ) |
◆ __delitem__()
lsst.daf.base.propertyContainer.propertyContainerContinued.PropertySet.__delitem__ |
( |
| self, |
|
|
| name ) |
◆ __eq__()
lsst.daf.base.propertyContainer.propertyContainerContinued.PropertySet.__eq__ |
( |
| self, |
|
|
| other ) |
◆ __getitem__()
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 718 of file propertyContainerContinued.py.
◆ __iter__()
lsst.daf.base.propertyContainer.propertyContainerContinued.PropertySet.__iter__ |
( |
| self | ) |
|
◆ __len__()
lsst.daf.base.propertyContainer.propertyContainerContinued.PropertySet.__len__ |
( |
| self | ) |
|
◆ __reduce__()
lsst.daf.base.propertyContainer.propertyContainerContinued.PropertySet.__reduce__ |
( |
| self | ) |
|
◆ __setitem__()
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 694 of file propertyContainerContinued.py.
◆ __str__()
lsst.daf.base.propertyContainer.propertyContainerContinued.PropertySet.__str__ |
( |
| self | ) |
|
◆ add()
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 574 of file propertyContainerContinued.py.
◆ from_mapping()
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 452 of file propertyContainerContinued.py.
◆ get()
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 486 of file propertyContainerContinued.py.
◆ getArray()
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 513 of file propertyContainerContinued.py.
◆ getScalar()
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 536 of file propertyContainerContinued.py.
◆ items()
lsst.daf.base.propertyContainer.propertyContainerContinued.PropertySet.items |
( |
| self | ) |
|
◆ keys()
lsst.daf.base.propertyContainer.propertyContainerContinued.PropertySet.keys |
( |
| self | ) |
|
◆ pop()
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 754 of file propertyContainerContinued.py.
◆ set()
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 559 of file propertyContainerContinued.py.
◆ toDict()
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 627 of file propertyContainerContinued.py.
◆ update()
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 603 of file propertyContainerContinued.py.
◆ values()
lsst.daf.base.propertyContainer.propertyContainerContinued.PropertySet.values |
( |
| self | ) |
|
◆ _typeMenu [1/2]
dict lsst.daf.base.propertyContainer.propertyContainerContinued.PropertySet._typeMenu |
|
staticprotected |
Initial value:= {bool: "Bool",
float: "Double",
str: "String",
DateTime: "DateTime",
PropertySet: "PropertySet",
PropertyList: "PropertySet",
None: "Undef",
}
Definition at line 442 of file propertyContainerContinued.py.
◆ _typeMenu [2/2]
lsst.daf.base.propertyContainer.propertyContainerContinued.PropertySet._typeMenu |
|
protected |
The documentation for this class was generated from the following file: