rosalindfranklininstitute / RedLionfish

Apache License 2.0
29 stars 4 forks source link

Adding print output after every (other, 5, etc) iteration #16

Closed sabotaha closed 1 year ago

sabotaha commented 1 year ago

Hi,

Thank you for this algorithm. Would you consider adding a print code for following up iterations? It would be beneficial for coding in notebook.

Best, Taha

perdigao1 commented 1 year ago

Hi Sabotaha.

In initial versions there were a lot of print statements but we now we view them as a some sort of bloating and replaced with logging. We added callback support, which means that you can create a function that runs at every iteration. A good example can be found in RedLionfish/scripts/test_RL_deconv_callbk.py /. It should work also in notebooks.

https://github.com/rosalindfranklininstitute/RedLionfish/blob/872b18832be5706b8f836aa15555e202c063f9b4/scripts/test_RL_deconv_callbk.py

Note that, if the data is large the deconvolution will be done in blocks. In that case, the function is called after every block is processed and not every iteration.