rmnldwg / lymph

Python package for statistical modelling of lymphatic metastatic spread in head & neck cancer.
https://lymph-model.readthedocs.io
MIT License
5 stars 4 forks source link

make library more modular and reusable #41

Closed rmnldwg closed 10 months ago

rmnldwg commented 1 year ago

Currently, most of the methods do their job well, but can't be reused. There is also the issue with overlap in the functionality. For example, both inside the likelihood and the risk methods, it computes the prior over the hidden states, given the spread parameters.

To resolve this, large parts of the code base should be broken apart and refactored into smaller and more general methods. A consequence of this would also be that large methods like the risk and the likelihood are easier to understand on an abstract level and the smaller methods they are made up of can be tested more effectively.

rmnldwg commented 1 year ago

Recently, I needed to write a risk prediction in the LyProX app. There, too, I needed to write a lot of redundant stuff.

For example, the function create_diagnose_probs in the LyProX' new risk predictor should be something I can use this library for. But since it's not well modularized, I needed to write that from scratch.

Similarly - or even more so - for the function create_marginalisation: This is routinely computed in the lymph library, but in a way that makes it somewhat hard to reuse from the outside. And therefore, I had to write that function again as well.