class
ObservationsDictionary containing sensor observations
Methods
- def clear(...)
- D.clear() -> None. Remove all items from D.
- def copy(...)
- D.copy() -> a shallow copy of D
- def fromkeys(iterable, value = None, /)
- Create a new dictionary with keys from iterable and values set to value.
- def get(self, key, default = None, /)
- Return the value for key if key is in the dictionary, else default.
- def items(...)
- D.items() -> a set-like object providing a view on D’s items
- def keys(...)
- D.keys() -> a set-like object providing a view on D’s keys
- def pop(...)
- D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
- def popitem(self, /)
- Remove and return a (key, value) pair as a 2-tuple.
- def setdefault(self, key, default = None, /)
- Insert key with a value of default if key is not in the dictionary.
- def update(...)
- D.update([E, ]**F) -> None. Update D from dict/iterable E and F. If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- def values(...)
- D.values() -> an object providing a view on D’s values
Special methods
- def __class_getitem__(...)
- See PEP 585
- def __contains__(self, key, /)
- True if the dictionary has the specified key, else False.
- def __delitem__(self, key, /)
- Delete self[key].
- def __getitem__(...)
- x.__getitem__(y) <==> x[y]
- def __init__(self, sensors: typing.Dict[str, Sensor], *args: typing.Any, should_time: bool = False, **kwargs: typing.Any) -> None
- def __ior__(self, value, /)
- Return self|=value.
- def __iter__(self, /)
- Implement iter(self).
- def __len__(self, /)
- Return len(self).
- def __or__(self, value, /)
- Return self|value.
- def __reversed__(self, /)
- Return a reverse iterator over the dict keys.
- def __ror__(self, value, /)
- Return value|self.
- def __setitem__(self, key, value, /)
- Set self[key] to value.
- def __sizeof__(...)
- D.__sizeof__() -> size of D in memory, in bytes
Method documentation
def habitat. core. simulator. Observations. pop(...)
D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
If key is not found, default is returned if given, otherwise KeyError is raised
def habitat. core. simulator. Observations. popitem(self, /)
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
def habitat. core. simulator. Observations. setdefault(self,
key,
default = None, /)
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
def habitat. core. simulator. Observations. __init__(self,
sensors: typing.Dict[str, Sensor],
*args: typing.Any,
should_time: bool = False,
**kwargs: typing.Any) -> None
Parameters | |
---|---|
sensors | list of sensors whose observations are fetched and packaged. |
args | |
should_time | Optionally log performance timing metrics. |
kwargs |