Detailed per-node plotting of pub/callback timings, datastructure fixes

This commit is contained in:
Maximilian Schmeller 2022-05-24 20:35:30 +02:00
parent 5c8086e796
commit 062e641ee7
4 changed files with 694 additions and 218 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
fig*/ fig*/
.ipynb_checkpoints/ .ipynb_checkpoints/
__pycache_/
*.html *.html

4
requirements.txt Normal file
View file

@ -0,0 +1,4 @@
numpy
pandas
matplotlib
ipycache

File diff suppressed because one or more lines are too long

16
utils.py Normal file
View file

@ -0,0 +1,16 @@
from typing import Callable, Iterable, Optional, TypeVar
T = TypeVar("T")
def filter_none(ls: Iterable[Optional[T]]) -> filter[T]:
return filter(lambda x: x is not None, ls)
S = TypeVar("S")
def safe_map(func: Callable[[T], S], ls: Iterable[T]) -> map[Optional[S]]:
def safe_func(arg):
try:
return func(arg)
except:
return None
return map(safe_func, ls)