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

Method __len__

src/pymgrid/microgrid/microgrid.py:1058–1069  ·  view source on GitHub ↗

Length of available underlying data.

(self)

Source from the content-addressed store, hash-verified

1056 return (self.modules.to_tuples(), )
1057
1058 def __len__(self):
1059 """
1060 Length of available underlying data.
1061 """
1062 l = []
1063 for module in self.modules.iterlist():
1064 try:
1065 l.append(len(module))
1066 except TypeError:
1067 pass
1068
1069 return min(l)
1070
1071 def __eq__(self, other):
1072 if type(self) != type(other):

Callers

nothing calls this directly

Calls 2

iterlistMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected