ilastik / lazyflow

lazy parallel ondemand zero copy numpy array data flows with caching and dirty propagation
Other
77 stars 59 forks source link

Sane tracebacks #305

Closed m-novikov closed 5 years ago

m-novikov commented 5 years ago

Added Operator Stack section to exceptions see examples here The section includes full operator class name + method and pointer to file:lineno

emilmelnikov commented 5 years ago

Marvelous!

Can we somehow attach the new, filtered operator traceback as a cause to the original one, to be consistent with the usual exception chaining concept?

m-novikov commented 5 years ago

Can we somehow attach the new, filtered operator traceback as a cause to the original one, to be consistent with the usual exception chaining concept?

Do you mean raise e from <smth>? In this case, I would like to avoid this, because it requires reraising exception which is inconvenient, to say the least in chained operators (basically one must only raise a custom exception at the end of the operator chain) and doesn't provide nice output I tried

k-dominik commented 5 years ago

:+1: LGTM

m-novikov commented 5 years ago

Added context manager and install/uninstall functions. Changed implementation a bit. Now I inspect a self object to guess the Operator class, instead of looking it up within a module. Seems like there is no sane way to get function __qualname__ from frame or code object. https://bugs.python.org/issue13672 https://bugs.python.org/issue12857

k-dominik commented 5 years ago

:+1: