pywr / pycatchmod

A Cython implementation of the rainfall runoff model CATCHMOD (Wilby, 1994)
GNU General Public License v3.0
6 stars 5 forks source link

Add pickle support #4

Open snorfalorpagus opened 8 years ago

snorfalorpagus commented 8 years ago

It should be easy to add pickle support to the classes. This could be tied into read/write support for JSON.

(I realise catchment_from_json() exists - I was thinking, Catchment.load() and Catchment.dump().

jetuk commented 7 years ago

Would load and dump use a JSON format?

snorfalorpagus commented 7 years ago

Yes. I was thinking that load and dump handle the dictionary of parameters. The __setstate__ and __getstate__ methods could then make use of this, plus a little extra to handle the actual state.