SNEWS2 / snewpdag

SNEWS2 alert calculations
BSD 3-Clause "New" or "Revised" License
1 stars 13 forks source link

Pickle input and output #75

Closed tsengj10 closed 2 years ago

tsengj10 commented 2 years ago

Modules PickleInput and renderers.PicklePayload (maybe should change the name of the latter): to pickle the payload and read it back in. This should be useful for reproducing calculations.

Note "make pickle_input" doesn't quite work yet because renderers.Histogram1D responds to report rather than alert. Something we should be able to adjust: PicklePayload can create a pickle on alert or report, and ideally we restore the pickle with the same action.

tsengj10 commented 2 years ago

Changed name of PicklePayload to PickleOutput, and fixed "make pickle_input": PickleInput by default acts only on 'report' rather than 'alert', but this can be changed using the 'on' argument.

tsengj10 commented 2 years ago

Note for @KaraMelih: it appears cPickle only needs to be imported for python2. It seems to have been integrated into python3. Thanks for the suggestion, though.