diff options
author | Daniel Friesel <derf@finalrewind.org> | 2019-02-05 08:09:45 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2019-02-05 08:09:45 +0100 |
commit | dca12474ab70843e4fc77c9e9cd3db57ad2ce364 (patch) | |
tree | 88868752fea01e35766ba5b3d0deef59d953458d /lib | |
parent | 5be7d04a725d3416acba6b11478d7075ada860ea (diff) |
doku
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/plotter.py | 6 |
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): |