pymgrid.modules.ModuleContainer#

class pymgrid.modules.ModuleContainer(modules, set_names=True)[source]#

Container of modules.

Allows for indexing and viewing of a microgrids module’s in various ways.

Methods

clear()

copy()

fromkeys(iterable[, value])

get(k[,d])

get_attrs(*attrs[, unique, as_pandas, ...])

Get module attributes as a dictionary or pandas object.

items()

iterdict()

Iterable of the container's modules as a dict.

iteritems()

iterlist()

Iterable of the container's modules as a list.

keys()

names()

pop(k[,d])

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

popitem()

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

set_attrs([attr_dict])

Set the value of an attribute in all modules containing that attribute.

setdefault(k[,d])

to_dict([orient])

Get the modules as a dictionary.

to_list()

Get the modules as a list.

to_tuples()

Get the modules in (name, module) pairs.

update([E, ]**F)

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

values()

Attributes

containers

View of this container's containers.