Heavy class rewrite and old pickles

27 views
Skip to first unread message

Nathann Cohen

unread,
Apr 30, 2015, 3:33:22 AM4/30/15
to Sage devel
Hellooooooo everybody,

I come to you because I plan to (seriously) rewrite the internal
strucure of graph classes. While this makes no difference on the
outside, I am meeting problems with pickles:

Indeed, there are two classes in sage.graphs.base.backends which are
named (since 2010):
- NetworkXGraphDeprecated
- NetworkXDiGraphDeprecated

I plan to remove them during the rewriting, but when I do some (old)
things do not unpickle anymore...

How can I manage to rewrite the class hierarchy while old pickles seem
to expect the old one?

Thanks for your help,

Nathann

P.S.: There are several layers of classes below Graph and DiGraph, and
I plan to merge some of them to simplify the structure. Most of what
these layers do when one of their method is called is to .... forward
it to the layer below.

Vincent Delecroix

unread,
Apr 30, 2015, 3:47:17 AM4/30/15
to sage-...@googlegroups.com
Hi Nathann,

There is a tiny bit of documentation in sage.structure.sage_object. Look
in particular at register_unpickle_override that allows you to redefine
how old pickles have to be pickled. There are tons of examples in the
Sage library. Just grep register_unpickle_override.

On the other hand, if some classes are seriously deprecated since 2010,
then I would simply remove the corresponding pickles from the pickle jar.

Vincent
Reply all
Reply to author
Forward
0 new messages