Hotfix/error handling
Added in error handling for cases where image.image_type
(e.g. image.data, image.mask) is missing
Two main additions: nanfull_stack
and _status_image*
nanfull_stack
wraps stack_detector_data
in try/catch on KeyError
or ValueError
, it returns a tuple of has_image
(bool) and stacked_data
(numpy array). If the train didn't have an image then has_image
is False
and stacked_data
is just NaN's.
Three widgets were added to make it easy for users to deal with missing images, these widgets are handled by a group of functions called _status_image*
which update a text field to say if the image is missing or not, and if it is missing then it finds the next train ID with an image (if there is one), then updates another text field to show this train, and updates a button which can be clicked to skip to this train.
Other changes:
- only cache if image exists
- catch and suppress numpy warnings on
nanmax
/nanmin
calls - added --user flag to
pip install .
in setup.sh
@bergeman @kamile @dallanto could one of you give this a look? Thanks