I am looking for advice on how to best pass around the fit results from a (Python) script to another script. Currently, I am exporting the best-fit parameters and function names into a YAML file. I find this approach a bit "icky" since I do need to "share" the functions using a common module, and I still have trouble making easy changes to the underlying fit and propagating it around. More Detailed, I have some underlying data samples stored in a file (data.txt). I have a Python script, PerformFit.py, that fits each sample to different functions for different variables and different analyses. The idea is to have a Predict.py file, which is then passed a new dataset to provide a prediction based on the previous fits. I need to obtain the predictions for different fits to determine if a fit from a specific dataset performs better than the combined dataset or if a different function yields better results. For now, I use a FitResults.yaml file to achieve the passing of the fit results. It looks something like: DataSet1/Variable/AnalysisType/PredefinedCut: functionName: sigmoid fitParams: <list of parameters from fit> fitCovariance: <cov matrix from fit> Given the complexity of the things I could change... Dataset, variable, AnalysisType, Predefined cut. I am almost convinced that I should have a database with the fit results and functions, allowing me to easily swap things around. Not to mention, then storing the Predictions for each different type of fit is just as convoluted. I am trying to find a better way to achieve the same goal while keeping the code modular, specifically by having a Fitter script and a Predictor script. Continue reading...