opencobra / cobratoolbox

The COnstraint-Based Reconstruction and Analysis Toolbox. Documentation:
https://opencobra.github.io/cobratoolbox
Other
240 stars 305 forks source link

refactor how solver parameters are handled #2257

Open rmtfleming opened 2 months ago

rmtfleming commented 2 months ago

Passing non-solver specific parameters to a solver gives an error. But this approach to split parameter structures

[problemTypeParams, extraParams] = parseSolverParameters(problemType, varargin)

and use extraParams for the solver needs to be replaced with one where a single parameter structure is stripped of any non-solver specific parameters before. What is problemType specific is defined here paramNames = getCobraSolverParamsOptionsForType(problemType) but that changes over time, making it confusing what parameter is a solver, problem-type vs other type of parameter with the potential for the same parameter to be different in different parameter structures. Better to only have one parameter structure then strip that to the solver specific ones just before calling the solver. One strip function per solver.