andersen-lab / Freyja

Depth-weighted De-Mixing
BSD 2-Clause "Simplified" License
100 stars 29 forks source link

[BUG] freyja exits rather than raising errors #227

Closed wutron closed 2 months ago

wutron commented 2 months ago

If freyja demix solver fails, it exits rather than raising exception up the call stack.

If the solver fails, it seems like the intended behavior is to catch the exception and still return a demix file that only has the coverage. https://github.com/andersen-lab/Freyja/blob/29221487fa68978076330f071c39d0a815b7bcd3/freyja/_cli.py#L120-L124 But currently sample_deconv.solve_demixing_problem uses sys.exit(1) instead. Recommend changing sys.exit(1) to raise throughout (in sample_deconv.py and possibly also in utils.py).

dylanpilz commented 2 months ago

Hey @wutron!

Thanks for posting this, I definitely agree it's more useful to see the full stack trace instead of the program exiting. Will include this in the next release