ccp4 / DUI

CCP4 DIALS User Interface
GNU General Public License v2.0
5 stars 3 forks source link

Mask tool prints many errors #122

Closed dagewa closed 3 years ago

dagewa commented 4 years ago

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?

rjgildea commented 4 years ago

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

dagewa commented 4 years ago

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

dagewa commented 4 years ago

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
ndevenish commented 4 years ago

Those errors look like red herrings, they seem to be coming from https://github.com/ccp4/DUI/blob/ca908d35fca4eb23b73ad43a5041a82f5cf4545a/src/dui/outputs_n_viewers/img_viewer.py#L158-L164 which looks like compensation for typing errors coming from somewhere and so maybe not platform/behaviour specific?

dagewa commented 4 years ago

@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?

dagewa commented 3 years ago

Fixed.