On Thu, Mar 26, 2009 at 8:50 AM, Jason Bandlow <[email protected]> wrote:
>
> Hi all,
>
> When I start up a clean version of sage 3.4 on my local machine and
> enter the following into a notebook cell:
>
> M=load('http://www.math.upenn.edu/~jbandlow/sage_data/dic_of_kst_to_G_cob_mats.sobj')
> # This object is a dictionary
> key = (1, Partition([1]),Partition([2]))
> print key in M.keys()
> M[key]
>
> I get the following (correct) output:
>
> Attempting to load remote file:
> http://www.math.upenn.edu/~jbandlow/sage_data/dic_of_kst_to_G_cob_mats.s\
> obj
> Loading: [..........]
> True
> # A matrix that I won't reproduce here
>
> When I enter the exact same text in a notebook cell on sagenb, I get the
> following output:
>
> Attempting to load remote file:
> http://www.math.upenn.edu/~jbandlow/sage_data/dic_of_kst_to_G_cob_mats.s\
> obj
> Loading: [..........]
> True
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File
> "/home/sage/sagenb/sage_notebook/worksheets/jbandlow/11/code/41.py",
> line 10, in <module>
> M[key]
> File
> "/home/sage/sage_install/sage-a/local/lib/python2.5/site-packages/SQLAlchemy-0.4.6-py2.5.egg/",
> line 1, in <module>
>
> KeyError: (1, [1], [2])
>
> Why am I getting a KeyError if key in M.keys() is returning True? And
> why is the behavior on sagenb different than on my local, 3.4
> built-from-source on Ubuntu 10.8 distribution?
>
> Any ideas are very welcome!
>
I'm guessing this is a subtle 32 versus 64-bit issue involving
pickling and assumptions made somewhere in the combinat or other sage
code involving 32/64-bit. The notebook is 64-bit and I bet your
computer is 32-bit.
By the way, this works on the notebook in the context of your session above:
for a, b in M.iteritems():
if a == key: print b
-- 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
-~----------~----~----~----~------~----~------~--~---