You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The package currently does not support saving or loading regions. This would be an extremely useful feature to support because regions in high-resolution models can take a fairly long time to compute but once they are computed are cheap to reuse.
I have had some success using pickle to locally save and load class instances but there are two fatal flaws to this approach:
the files written by pickle are not safe as unknown Python code may be executing while reading in a file
without a stable file structure, it is not guaranteed that files written with one version of regionate will be readable by an earlier or later version.
My proposal is to create custom save and load methods that store class attributes using more robust save methods from established packages (e.g. xarray, pandas, json). I have not yet figures out how best to do this, especially when dealing with class inheritance of these methods.
The text was updated successfully, but these errors were encountered:
The package currently does not support saving or loading regions. This would be an extremely useful feature to support because regions in high-resolution models can take a fairly long time to compute but once they are computed are cheap to reuse.
I have had some success using
pickle
to locally save and load class instances but there are two fatal flaws to this approach:pickle
are not safe as unknown Python code may be executing while reading in a fileregionate
will be readable by an earlier or later version.My proposal is to create custom
save
andload
methods that store class attributes using more robust save methods from established packages (e.g.xarray
,pandas
,json
). I have not yet figures out how best to do this, especially when dealing with class inheritance of these methods.The text was updated successfully, but these errors were encountered: