ccp4/DUI

Mask tool prints many errors

Closed this issue · 6 comments

I've had a report that masking does not work on Macs (some errors printed to console). Could somebody with a Mac and the latest CCP4 please test this?

I have lots of this output when drawing shapes:

lst_par(MaskPage) [['generate_mask']]
activate_me(MaskPage)
cur_nod.ll_command_lst:
 [['generate_mask', 'untrusted.circle=803,862,350', 'untrusted.rectangle=1451,2131,969,1435']]
lst_par(MaskPage) [['generate_mask', 'untrusted.circle=803,862,350', 'untrusted.rectangle=1451,2131,969,1435']]
except(build_mask_item) ... TypeError
except(build_mask_item) ... TypeError
except(build_mask_item) ... TypeError
except(build_mask_item) ... TypeError
except(build_mask_item) ... TypeError
except(build_mask_item) ... TypeError
except(build_mask_item) ... TypeError
except(build_mask_item) ... TypeError
except(build_mask_item) ... TypeError
except(build_mask_item) ... TypeError
except(build_mask_item) ... TypeError
except(build_mask_item) ... TypeError
except(build_mask_item) ... TypeError

However it does appear to have generated a mask after clicking "Run":

image

Thanks, maybe these errors don't actually stop the masking then. Not very pretty having all that junk written out though :-(

It seems the printing of errors is not specific to Macs. I also got this

Runner(run) ... cmd_lst = ['clean']
except(build_mask_item) ... TypeError
except(build_mask_item) ... TypeError
activate_me(MaskPage)
cur_nod.ll_command_lst:
 [['generate_mask']]
lst_par(MaskPage) [['generate_mask']]
except(build_mask_item) ... TypeError
except(build_mask_item) ... TypeError
set_par(MaskPage) [['generate_mask', 'untrusted.rectangle=618,747,671,704'], ['apply_mask ...']]
lst_par(MaskPage) [['generate_mask', 'untrusted.rectangle=618,747,671,704'], ['apply_mask ...']]
activate_me(MaskPage)
cur_nod.ll_command_lst:
 [['generate_mask']]
lst_par(MaskPage) [['generate_mask']]
activate_me(MaskPage)
cur_nod.ll_command_lst:
 [['generate_mask', 'untrusted.rectangle=618,747,671,704']]
lst_par(MaskPage) [['generate_mask', 'untrusted.rectangle=618,747,671,704']]
except(build_mask_item) ... TypeError

Those errors look like red herrings, they seem to be coming from

except TypeError:
logger.debug("except(build_mask_item) ... TypeError")
return False, None, False
except AttributeError:
logger.debug(" except(build_mask_item) ... AttributeError")
return False, None, False
which looks like compensation for typing errors coming from somewhere and so maybe not platform/behaviour specific?

@luisodls do you know why these exceptions might occur? If it is just try/except being used for flow control then perhaps a comment in the code and not writing a message to the logger would suffice. It is hard to tell from the code which lines trigger the exceptions. Could it be refactored so that the try block wraps a smaller number of lines?

Fixed.