bachlab / PsPM

A matlab suite for Psycho-Physiological Modelling
GNU General Public License v3.0
45 stars 11 forks source link

Streamline function output #519

Closed dominikbach closed 6 months ago

dominikbach commented 1 year ago

Feature Description

teddychao commented 1 year ago

I agree with the concept that "sts should be provided for all internally called functions that produce output, to offer a systematic way to handle problems without interrupting batch processing". The reason why I conceptualise "dynamic output" is to minimise the modifications of how these functions are called. If we change all functions to [ sts, Y ] = function [ X ] it will be a heavy update. For example glm = pspm_glm [ X ] will need to be updated into [sts, glm] = pspm_glm [ X ]. As the result, all the functions which call pspm_glm will need to be changed. However, I admit, static outputs are theoretically more robust and easier to debug, and following the traditional coding style of PsPM. Therefore, I don't have a strong opinion to use either static or dynamic outputs. The only thing I think that is useful is to make the logic consistent between functions, which is what I was normally trying to improve.