GEMScienceTools/gmpe-smtk

Refactor of Residuals subclasses

g-weatherill opened this issue · 0 comments

Currently the comparison of GMPEs to data is undertaken in the smtk.residuals.gmpe_residuals.Residuals class. The various tools for analysis the model fit (Likelihood, LLH, EDR, MultivariateLLH) all subclass the Residuals object, adding on specific functions when needed. This was intended when the anticipated use case was to look at exploring the results from a single tool. The downside, however, is that if the user wishes to apply several metrics then they need to instantiate each class, and thus re-calculate the residuals, which is extremely time consuming. As this latter workflow is becoming more common there is no good argument for keeping the tools as separate classes. Instead a refactor is proposed to move the functions as methods of the core residuals class.