Pickle.jl icon indicating copy to clipboard operation
Pickle.jl copied to clipboard

Writing Julia Objects to pickle and load from python

Open chengchingwen opened this issue 4 years ago • 3 comments

To make Julia Object loadable from python, there are three issues:

  1. For simple Julia struct (no functions): utilities the stack machine to build a similar python class and load data into it. Will need a rule-base translation for the struct definition to python class definition string.

  2. For Julia Arrays: use the array element type to determine whether to write as python list or numpy array.

  3. For complex Julia Object (like Function and struct with functions): currently there is no simple solution, so these will be unsupported.

chengchingwen avatar Apr 08 '20 09:04 chengchingwen

For Julia Arrays: use the array element type to determine whether to write as python list or numpy array.

Could it be more specific here? I guess you mean Array{<:Any} -> list, Array{<:Number} -> numpy array?

findmyway avatar May 15 '20 07:05 findmyway

Yes, I think we can use some rule to determine whether the Array is compatible with numpy array, and if not, fallback to python list.

chengchingwen avatar May 15 '20 07:05 chengchingwen

numpy array also have python object dtype, we probably can use it for Array{Any, N}, but I haven't try it.

chengchingwen avatar May 15 '20 07:05 chengchingwen