Have you looked at the examples section of unpickle_all
? I noticed the following there:
We unpickle the standard pickle jar. This doctest tests that all standard pickles unpickle. Every so often the standard pickle jar should be updated by running the doctest suite with the environment variable SAGE_PICKLE_JAR
set, then copying the files from SAGE_ROOT/tmp/pickle_jar*
into the standard pickle jar.
But I don't know much about pickling, so I don't know if this actually answers your question! Anyway, I hope it's helpful :)
EDIT: Judging by the docstring, I think the "standard pickle jar" is the contents of SAGE_DATA/extcode/pickle_jar/pickle_jar.tar.bz2
:
sage: std = os.environ['SAGE_DATA'] + '/extcode/pickle_jar/pickle_jar.tar.bz2'
sage: std
'/Applications/sage/data/extcode/pickle_jar/pickle_jar.tar.bz2'
testing this:
$ cd $SAGE_ROOT/devel/sage
$ export SAGE_PICKLE_JAR="pickle"
$ sage -t sage/rings/power_series_ring*
sage -t "devel/sage-main/sage/rings/power_series_ring.py"
[4.3 s]
sage -t "devel/sage-main/sage/rings/power_series_ring_element.pyx"
[3.3 s]
----------------------------------------------------------------------
All tests passed!
Total time for all tests: 7.7 seconds
$ ls ../../tmp/pickle_jar*
_class__sage_rings_power_series_ring_PowerSeriesRing_domain__.sobj
_class__sage_rings_power_series_ring_PowerSeriesRing_domain__.txt
_class__sage_rings_power_series_ring_PowerSeriesRing_over_field__.sobj
_class__sage_rings_power_series_ring_PowerSeriesRing_over_field__.txt
_type__sage_rings_power_series_poly_PowerSeries_poly__.sobj
_type__sage_rings_power_series_poly_PowerSeries_poly__.txt
And this looks a lot like the contents of pickle_jar.tar.bz2
.
So I guess all you have to do is add whatever new things are generated by your code to the pickle jar file (or maybe replace existing things with the new things).