dumps() and loads() of symbolic functions problem

18 views
Skip to first unread message

CDSousa

unread,
Oct 11, 2011, 7:16:27 AM10/11/11
to sage-support
Hi,

When doing

x = var('x'); f = function('f',x) ; s = dumps(f) ; loads(s)

I get a "RuntimeError: unknown function 'f' in archive".

I have equal problem with save()/load() and db_save()/db().

Nils Bruin

unread,
Oct 11, 2011, 12:02:23 PM10/11/11
to sage-support
On Oct 11, 4:16 am, CDSousa <cris...@gmail.com> wrote:
> x = var('x'); f = function('f',x) ; s = dumps(f) ; loads(s)
> I get a  "RuntimeError: unknown function 'f' in archive".

Excellent example. That's definitely a bug. You must be the first
person who tries to pickle a formal function (i.e., one without a
defining expression). You should file a bug report with exactly this
example in there.

Some technical information from
sage.misc.explain_pickle.explain_pickle:
(indeed, pickle is not an opaque binary format when looked at with the
right tools. However, in this case it turns out it wraps another
format from Pynac which is probably also not opaque but needs an
expert to make sense of)

Things go wrong in sage.symbolic.expression.Expression , which
basically just wraps Pynac's GArchive. Apparently, this routine
handles free "variables" properly but not "free functions".

The bug will be immediately pushed upstream to Pynac developers, but
luckily those are actively involved in sage.

CDSousa

unread,
Oct 12, 2011, 9:39:54 AM10/12/11
to sage-support
I noticed there is no bug in sage 7.4 (sagenb.org).
Pynac was updated to 0.2.2 (sage-4.7.1.alpha1) and then to 0.2.3
(sage-4.7.1.alpha4) according to sage 7.4.1 changelog.

Where do I fill the bug?
I've already filled a bug at the "Sage Notebook Bugreport", is it
enough?
Is it mandatory to ask for a Tracker account?

Nils Bruin

unread,
Oct 12, 2011, 10:43:32 AM10/12/11
to sage-support
On Oct 12, 6:39 am, CDSousa <cris...@gmail.com> wrote:
> I noticed there is no bug in sage 7.4 (sagenb.org).Eventually there must be a track ticket., so if you don't file it, someone else has to.
> Pynac was updated to 0.2.2 (sage-4.7.1.alpha1) and then to 0.2.3
> (sage-4.7.1.alpha4) according to sage 7.4.1 changelog.

So it's a regression in Pynac. In a way that's good news because those
are even easier to repair.

> Where do I fill the bug?
> I've already filled a bug at the "Sage Notebook Bugreport", is it enough?
> Is it mandatory to ask for a Tracker account?

I don't know how often the "notebook bugreports" are looked at.
Eventually there must be a trac ticket, so if you don't file it,
someone else has to. To file a ticket you do need a tracker account.

Threads like this are usually ended with a message "This is now trac
#..." for archival purposes, so please let us know if you've filed a
ticket or if you prefer someone else to do it on your behalf. Your
help is appreciated.

CDSousa

unread,
Oct 14, 2011, 4:37:21 AM10/14/11
to sage-support
Reply all
Reply to author
Forward
0 new messages