deepcopy and gap

14 views
Skip to first unread message

Nicolas M. Thiery

unread,
Apr 21, 2009, 7:26:46 PM4/21/09
to sage-...@googlegroups.com
Hello,

I just hit some strange interaction between Weyl groups, interactive
Gap session and deepcopy.

Anyone help on debugging this?

Thanks in advance,
Nicolas

----------------------------------------------------------------------
| Sage Version 3.4, Release Date: 2009-03-11 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------
sage: W = WeylGroup(["A",2])
sage: from copy import deepcopy
sage: W.list()

[[0 0 1]
[0 1 0]
[1 0 0],
[0 0 1]
[1 0 0]
[0 1 0],
[0 1 0]
[0 0 1]
[1 0 0],
[0 1 0]
[1 0 0]
[0 0 1],
[1 0 0]
[0 0 1]
[0 1 0],
[1 0 0]
[0 1 0]
[0 0 1]]
sage: deepcopy(QQ)
Rational Field
sage: deepcopy(QQ)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)

/home/nthiery/.sage/temp/zephyr/6426/_home_nthiery__sage_init_sage_0.py in <module>()

/opt/sage/local/lib/python/copy.pyc in deepcopy(x, memo, _nil)
187 raise Error(
188 "un(deep)copyable object of type %s" % cls)
--> 189 y = _reconstruct(x, rv, 1, memo)
190
191 memo[d] = y

/opt/sage/local/lib/python/copy.pyc in _reconstruct(x, info, deep, memo)
335 if state:
336 if deep:
--> 337 state = deepcopy(state, memo)
338 if hasattr(y, '__setstate__'):
339 y.__setstate__(state)

/opt/sage/local/lib/python/copy.pyc in deepcopy(x, memo, _nil)
160 copier = _deepcopy_dispatch.get(cls)
161 if copier:
--> 162 y = copier(x, memo)
163 else:
164 try:

/opt/sage/local/lib/python/copy.pyc in _deepcopy_dict(x, memo)
252 memo[id(x)] = y
253 for key, value in x.iteritems():
--> 254 y[deepcopy(key, memo)] = deepcopy(value, memo)
255 return y
256 d[dict] = _deepcopy_dict

/opt/sage/local/lib/python/copy.pyc in deepcopy(x, memo, _nil)
160 copier = _deepcopy_dispatch.get(cls)
161 if copier:
--> 162 y = copier(x, memo)
163 else:
164 try:

/opt/sage/local/lib/python/copy.pyc in _deepcopy_dict(x, memo)
252 memo[id(x)] = y
253 for key, value in x.iteritems():
--> 254 y[deepcopy(key, memo)] = deepcopy(value, memo)
255 return y
256 d[dict] = _deepcopy_dict

/opt/sage/local/lib/python/copy.pyc in deepcopy(x, memo, _nil)
169 y = _deepcopy_atomic(x, memo)
170 else:
--> 171 copier = getattr(x, "__deepcopy__", None)
172 if copier:
173 y = copier(memo)

/opt/sage/local/lib/python2.5/site-packages/sage/interfaces/expect.pyc in __getattr__(self, attrname)
1516
1517 def __getattr__(self, attrname):
-> 1518 P = self._check_valid()
1519 if attrname[:1] == "_":
1520 raise AttributeError

/opt/sage/local/lib/python2.5/site-packages/sage/interfaces/expect.pyc in _check_valid(self)
1471 raise ValueError, "The %s session in which this object was defined is no longer running."%P.name()
1472 except AttributeError:
-> 1473 raise ValueError, "The session in which this object was defined is no longer running."
1474 return P
1475

ValueError: The session in which this object was defined is no longer running.
> /opt/sage-3.4.rc0/local/lib/python2.5/site-packages/sage/interfaces/expect.py(1473)_check_valid()
1472 except AttributeError:
-> 1473 raise ValueError, "The session in which this object was defined is no longer running."
1474 return P

ipdb>

Nicolas
--
Nicolas M. Thiéry "Isil" <nth...@users.sf.net>
http://Nicolas.Thiery.name/

Minh Nguyen

unread,
Apr 21, 2009, 7:32:45 PM4/21/09
to sage-...@googlegroups.com
Hi Nicolas,

On Tue, Apr 21, 2009 at 11:26 PM, Nicolas M. Thiery
<Nicolas...@u-psud.fr> wrote:
>
> Hello,
>
> I just hit some strange interaction between Weyl groups, interactive
> Gap session and deepcopy.
>
> Anyone help on debugging this?
>

<SNIP>

I can reproduce it using Sage 3.4. But it's very strange, because I
can't seem to reproduce the above using Sage 3.4.1.rc4:

----------------------------------------------------------------------
| Sage Version 3.4.1.rc4, Release Date: 2009-04-19 |

Rational Field


sage: deepcopy(QQ)
Rational Field
sage: deepcopy(QQ)

Rational Field


sage: deepcopy(QQ)
Rational Field
sage: deepcopy(QQ)

Rational Field


sage: deepcopy(QQ)
Rational Field
sage: deepcopy(QQ)

Rational Field

--
Regards
Minh Van Nguyen

mabshoff

unread,
Apr 21, 2009, 7:35:40 PM4/21/09
to sage-devel


On Apr 21, 4:32 pm, Minh Nguyen <nguyenmi...@gmail.com> wrote:
> Hi Nicolas,
>
> On Tue, Apr 21, 2009 at 11:26 PM, Nicolas M. Thiery
>
> <Nicolas.Thi...@u-psud.fr> wrote:
>
> >        Hello,
>
> > I just hit some strange interaction between Weyl groups, interactive
> > Gap session and deepcopy.
>
> > Anyone help on debugging this?
>
> <SNIP>
>
> I can reproduce it using Sage 3.4. But it's very strange, because I
> can't seem to reproduce the above using Sage 3.4.1.rc4:

3.4.1.rc4 ships the downgraded GAP 4.4.10 again. That will probably
play a role here.

Cheers,

Michael

Minh Nguyen

unread,
Apr 21, 2009, 7:39:41 PM4/21/09
to sage-...@googlegroups.com

Ah... of course, it's #5697:

http://trac.sagemath.org/sage_trac/ticket/5697

This should definitely be in the release tour :-)

mabshoff

unread,
Apr 21, 2009, 7:45:44 PM4/21/09
to sage-devel


On Apr 21, 4:39 pm, Minh Nguyen <nguyenmi...@gmail.com> wrote:
> On Tue, Apr 21, 2009 at 11:35 PM, mabshoff <mabsh...@googlemail.com> wrote:
>
> > On Apr 21, 4:32 pm, Minh Nguyen <nguyenmi...@gmail.com> wrote:
> >> Hi Nicolas,
>
> >> On Tue, Apr 21, 2009 at 11:26 PM, Nicolas M. Thiery
>
> >> <Nicolas.Thi...@u-psud.fr> wrote:
>
> >> >        Hello,
>
> >> > I just hit some strange interaction between Weyl groups, interactive
> >> > Gap session and deepcopy.
>
> >> > Anyone help on debugging this?
>
> >> <SNIP>
>
> >> I can reproduce it using Sage 3.4. But it's very strange, because I
> >> can't seem to reproduce the above using Sage 3.4.1.rc4:
>
> > 3.4.1.rc4 ships the downgraded GAP 4.4.10 again. That will probably
> > play a role here.

Ok, I did not have an rc3+GAP 4.4.12 any more since I used that tree
to test the GAP downgrade before pulling it into 3.4.1.rc4. But

3.4.1.rc2 + GAP 4.4.12: *boom*
4.4.1.rc3 + GAP 4.4.10: it works

Note that the downgrade also changed some code that was merged due to
the updated GAP, i.e. some randgen framework work to set the random
seed for more GAP functions. I kind of doubt this has a side effect
here, so now I am quite confident to blame GAP for this :)

> Ah... of course, it's #5697:
>
> http://trac.sagemath.org/sage_trac/ticket/5697
>
> This should definitely be in the release tour :-)

Yeah, that would be nice :)

> --
> Regards
> Minh Van Nguyen

Cheers,

Michael
Reply all
Reply to author
Forward
0 new messages