alan-turing-institute / mogp-emulator

Package for fitting Gaussian Process Emulators to multiple output computer simulation results.
MIT License
47 stars 14 forks source link

`patsy` does not support pickling #219

Closed edaub closed 2 years ago

edaub commented 2 years ago

When fitting multiple outputs with a patsy mean function, an exception is thrown as patsy design matrices do not support pickling. One simple fix would be to convert to a numpy array -- the design matrices aren't really exposed to the user so I don't think it's an issue to store as an array. (Update: If we store just the design matrix array and you need any patsy-specific features, you can pass an existing array to the design matrix __init__ method and it will add any additional attributes that are needed. Thus, I think this is the correct solution.)

Related, current implementation supports passing a ModelDesc object as the mean argument to a GP, which does not allow pickling either. I think most users will simply provide a string for the mean argument, so this should not be a huge issue (though providing some kind of warning or fallback to serial prediction might be nice.