MCPcopy Create free account
hub / github.com/ahalev/python-microgrid / to_tuples

Method to_tuples

src/pymgrid/modules/module_container.py:79–93  ·  view source on GitHub ↗

Get the modules in (name, module) pairs. Returns ------- tups : list of tuples: (name, module) Module names and modules.

(self)

Source from the content-addressed store, hash-verified

77 return d
78
79 def to_tuples(self):
80 """
81 Get the modules in (name, module) pairs.
82
83 Returns
84 -------
85 tups : list of tuples: (name, module)
86 Module names and modules.
87
88 """
89 l = []
90 for name, modules in self.iterdict():
91 tups = list(zip([name] * len(modules), modules))
92 l.extend(tups)
93 return l
94
95 def iterlist(self):
96 """

Callers 8

from_microgridMethod · 0.80
_serialization_dataMethod · 0.80
__getnewargs__Method · 0.80
set_microgridMethod · 0.80

Calls 1

iterdictMethod · 0.95

Tested by 5

set_microgridMethod · 0.64