Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Implement checks for fulfilment of algorithm requirements in the OsipiBase class #45

Open
IvanARashid opened this issue Mar 1, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@IvanARashid
Copy link
Contributor

Feature description

Currently, the OsipiBase class is used as a parent class for the standardisation of the submitted algorithms. It is also used as a common interface which we use in our testing, allowing for mass-calling of function fitting.

However, one thing we would like to implement in order to make things more robust is to check the inputs and compare them to the requirements of the submitted code. This is in order to raise relevant errors when we know that something will not work due to the input of e.g. init of OsipiBase, or OsipiBase.osipi_fit() not being compatible with the requirements of the fitting algorithm.

Describe the solution

The stadardised implementations of the algorithms can have attributes which describe the requirements of the inputs. E.g. specification of function bounds, number of b-values, number of b-value thresholds, etc (see the required_* attributes in src/standardized/IAR_LU_biexp.py. Write functions that makes sure that the inputs to OsipiBase follow these requirements. Call these checks in the OsipiBase.osipi_fit() function.

Describe alternatives

No response

Additional context

IVIM fitting algorithms can be categorised into e.g. least-squares fits, segmented least-squares fits, Bayesian, variable projection, etc. These have different types of requirements. The segmented algorithms require some kind of segmentation of the b-scale, i.e. a b-value threshold. Therefore, these algorithms would need this parameter specified. However, it could also be that the specific algorithm in question already has some default value, making it a non-requirement in the case of actually initiating the OsipiBase class. So to understand the requirements of each submission, one would need to actually dig into the code. However, for the implementation of this feature, it is not necessarily needed. You essentially only need to write code that compares inputs with the requirements specified in the standardised implementation of the algorithm.

Are you working on this?

None

@IvanARashid IvanARashid added the enhancement New feature or request label Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant