class heparchy.write.MapWriter(Generic[heparchy.write.hdf.MapGeneric], collections.abc.MutableMapping[str, heparchy.write.hdf.MapGeneric])[source]

Provides a dictionary-like interface for writing user-named datasets or metadata.

Parameters
writer : HdfProcessWriter | HdfEventWriter

The writer instance to which the MapWriter will be attached.

setter_func : callable

The strategy used to write the user-named data with the writer.

Raises

WriteOnlyError – Dictionary-like behaviour which requires read-access for datasets, as access to the data is strictly write-only.

Notes

This is a concrete subclass of collections.abc.MutableMapping, and thus includes all functionality expected of a dictionary, including iteration over keys, subscriptable setters and deleters of datasets, etc.

Public members

MapWriter(writer: HdfEventWriter | HdfProcessWriter, setter_func)[source]

Initialize self. See help(type(self)) for accurate signature.

__repr__() str[source]

Return repr(self).

__getitem__(name: str) MapGeneric[source]
__setitem__(name: str, data: MapGeneric)[source]
MapWriter[params][source]
classmethod __init_subclass__(*args, **kwargs)[source]

This method is called when a class is subclassed.

pop(...) v, remove specified key and return the corresponding value.[source]

If key is not found, d is returned if given, otherwise KeyError is raised.

popitem() (k, v), remove and return some (key, value) pair[source]

as a 2-tuple; but raise KeyError if D is empty.

clear() None.  Remove all items from D.[source]
update([E, ]**F) None.  Update D from mapping/iterable E and F.[source]

If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v

setdefault(k[, d]) D.get(k,d), also set D[k]=d if k not in D[source]
get(k[, d]) D[k] if k in D, else d.  d defaults to None.[source]
keys() a set-like object providing a view on D's keys[source]
items() a set-like object providing a view on D's items[source]
values() an object providing a view on D's values[source]
__eq__(other)[source]

Return self==value.

classmethod __subclasshook__(C)[source]

Abstract classes can override this to customize issubclass().


Last update: Nov 16, 2022