From dca12474ab70843e4fc77c9e9cd3db57ad2ce364 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 5 Feb 2019 08:09:45 +0100 Subject: doku --- lib/plotter.py | 6 ++++++ 1 file changed, 6 insertions(+) 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): -- cgit v1.2.3