Add automatic disk synchronization of the state dict
Since #12 (closed) was implemented in !6 (merged), contestants implementing recsystems are automatically given a "state" dict in which they can store any data related to the functioning of their recsystem.
As documented in #14 (closed), use of this is somewhat optional: They may choose to store data however they want (e.g. in a database) but this makes it really easy to get started without a more sophisticated storage backend.
However, the state dict is not saved to disk anywhere, and if the recsystem is restarted it will be lost. This is not ideal.
As I mentioned in today's meeting, the current interface easily allows contestants to save the state dict themselves. For example, they can write in their recsys module a function called:
import pickle
def every_minute(state, *args, **kwargs):
with open('state.pickle', 'wb') as fobj:
pickle.dump(state, fobj)
This will save their state to a pickle once per minute. Reloading it is a bit trickier--this suggests that it would still be useful to provide an optional initialize()
callback, which would allow the state to be initialized when the recsystem starts up.
All that said, this is a common use case that should be supported out-of-the-box.