[Numpy-discussion] Pickling ufuncs?

Travis Oliphant oliphant at ee.byu.edu
Tue Jan 30 16:51:16 EST 2007


Robert Kern wrote:
> Note that this is a hack. It won't work for the ufuncs in scipy.special, for
> example.
>
> We should look into including __module__ information in ufuncs. This is how
> regular functions are pickled.
>
>   
This sounds like a good idea.  Would it be possible to add a "dict" 
object to the end of the ufunc structure  without bumping up the Version 
number of the C-API?  I think it would be possible, but I'm interested 
in other points of view. 

If we added the dict object then we could add the __module__ attribute 
to all ufuncs and use that in pickling.  

Then, we could add an API function that took a module name and found all 
ufuncs under that name and set their __module__ attribute correctly.

Thoughts?

-Travis





More information about the NumPy-Discussion mailing list