On Fri, Jun 26, 2009 at 1:52 PM, Simon King<[email protected]> wrote: > > Dear Lars, > > On Jun 26, 1:43 pm, Lars Fischer <[email protected]> > wrote: >> you could try: >> import pGroupCohomology.mtx as mtx > > This is one of the things that I tried, but it didn't help. When > loading a pickle of some class instance from mtx, it was still > complaining. > > Probably, in the long run, the easiest is to temporarily have a fake > mtx module on top level, that imports the necessary classes from > pGroupCohomology.mtx. Then, > 1. load the old data: Loading looks for mtx.SomeClass, and this > results in pGroupCohomology.mtx.SomeClass. > 2. save the data back. Now, the pickle points to > pGroupCohomology.mtx.SomeClass > 3. remove the fake mtx, in order to not pollute the top level > 4. load the data. This is possible since the "address" of "SomeClass" > was automatically corrected when saving the data back. > > I know that this procedure works, but I was wondering if something > simpler is possible.
We do the above in several places in the Sage library right now. There is something else that is possible though -- I recall Craig Citro and Carl Witty discussing it -- but I can't remember exactly what it is. William --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---
