Conversation
3f6f564 to
980e9b6
Compare
KrisThielemans
left a comment
There was a problem hiding this comment.
ok, but now might be a good time to add a little bit of documentation on the Handle class (and indeed the new HANDLE. It is an implementation detail (should we call it _Handle in Python tradition?), but developers do need to know how this works :-)
| def __init__(self, handle, check_stack: int | None = None): | ||
| if (check_stack is None or check_stack >= 0) and pyiutil.executionStatus(handle) != 0: | ||
| check_stack = inspect.stack()[1 if check_stack is None else check_stack] | ||
| check_stack = inspect.stack()[1 if check_stack is None else check_stack] # TODO: delete or print this? |
There was a problem hiding this comment.
There was a problem hiding this comment.
delete unused lines 40-43 please (not much help anyway as the error may be higher up the stack than level 1)
There was a problem hiding this comment.
Re the purpose of inspect.stack: what I wanted was to get closer to the line that throws monkey wrench.
For example: running PET demos I get
`Error opening file acf.hs\n' exception caught at line 427 of /home/sirfuser/devel/buildVM/sources/SIRF/src/xSTIR/cSTIR/cstir.cpp
but actual failure happens in STIR function ProjData::read_from_file called either at line 694 or line 852 of SIRF's stir_data_containers.h depending on the storage scheme (file or memory).
HANDLEconvenience singleton (can't doHandle.newsince classproperties are deprecated)functools.wrapsbackend functions inHandle.c*check_stack/inspect.stack()?Follow-up to #1388