Issue 224 in mpmath: cannot pickle mpi instances

24 views
Skip to first unread message

mpm...@googlecode.com

unread,
Mar 29, 2012, 11:33:16 AM3/29/12
to mpmath...@googlegroups.com
Status: New
Owner: ----

New issue 224 by damien.d...@gmail.com: cannot pickle mpi instances
http://code.google.com/p/mpmath/issues/detail?id=224

Intervals cannot be pickled:

>>> import cPickle
>>> import mpmath
>>> a = mpmath.mpi(10, 30)
>>> cPickle.dumps(a)
PicklingError: Can't pickle <class 'mpmath.ctx_iv.ivmpf'>: it's not the
same object as mpmath.ctx_iv.ivmpf

Using current SVN version (> 0.17) and python 2.7

It would be nice to have pickleable intervals for archiving /
multiprocessing purposes...

mpm...@googlecode.com

unread,
Jun 18, 2013, 12:59:52 AM6/18/13
to mpmath...@googlegroups.com

Comment #1 on issue 224 by mbogos...@gmail.com: cannot pickle mpi instances
http://code.google.com/p/mpmath/issues/detail?id=224

This is also true with matrices (with and without intervals):

>>> import cPickle as pickle
>>> import mpmath

>>> m1 = mpmath.iv.matrix([ [ 1, 2 ], [ 3, 4 ] ])
>>> pickle.dumps(m1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
cPickle.PicklingError: Can't pickle
<class 'mpmath.matrices.matrices.matrix'>: attribute lookup
mpmath.matrices.matrices.matrix failed

>>> m2 = mpmath.fp.matrix([ [ 1, 2 ], [ 3, 4 ] ])
>>> pickle.dumps(m2)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
cPickle.PicklingError: Can't pickle
<class 'mpmath.matrices.matrices.matrix'>: attribute lookup
mpmath.matrices.matrices.matrix failed


--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
Reply all
Reply to author
Forward
0 new messages