Pickle.jl
Pickle.jl copied to clipboard
Writing Julia Objects to pickle and load from python
To make Julia Object loadable from python, there are three issues:
-
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.
-
For Julia Arrays: use the array element type to determine whether to write as python list or numpy array.
-
For complex Julia Object (like Function and struct with functions): currently there is no simple solution, so these will be unsupported.
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?
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.
numpy array also have python object dtype, we probably can use it for Array{Any, N}
, but I haven't try it.