summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-02-05 08:09:45 +0100
committerDaniel Friesel <derf@finalrewind.org>2019-02-05 08:09:45 +0100
commitdca12474ab70843e4fc77c9e9cd3db57ad2ce364 (patch)
tree88868752fea01e35766ba5b3d0deef59d953458d /lib
parent5be7d04a725d3416acba6b11478d7075ada860ea (diff)
doku
Diffstat (limited to 'lib')
-rwxr-xr-xlib/plotter.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/plotter.py b/lib/plotter.py
index 9ba4786..e4d9926 100755
--- a/lib/plotter.py
+++ b/lib/plotter.py
@@ -15,9 +15,15 @@ def float_or_nan(n):
return np.nan
def flatten(somelist):
+ """
+ Flatten a list.
+
+ Example: flatten([[1, 2], [3], [4, 5]]) -> [1, 2, 3, 4, 5]
+ """
return [item for sublist in somelist for item in sublist]
def is_state(aggregate, name):
+ """Return true if name is a state and not UNINITIALIZED."""
return aggregate[name]['isa'] == 'state' and name != 'UNINITIALIZED'
def plot_states(model, aggregate):