JuliaPy / JuliaPy/PythonCall.jl

Pickle doesn't work on julia modules

未關閉
#32 7 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
bug
主要語言
Julia
星號
1.1k
分支
86
平均合併
1 天 22 小時
30 天內合併 PR
3

描述

Bit of a strange request, but there is a use case. A minimal example is:
```python
import pickle
from juliacall import Base
pickle.dumps(Base)
# Traceback (most recent call last):
# File "", line 1, in
# TypeError: cannot pickle 'juliacall.ModuleValue' object
```

This would be useful for defining functions that are passed around in Python. I initially ran into this when using ray, so a slightly more complex example that has the same behaviour:
```python
import ray
ray.init()
from juliacall import Base
@ray.remote
def v(x):
Base.println(x)
x = ray.get(v.remote(1))
```

I had a look at PyCall as well, but they've got a similar issue here https://github.com/JuliaPy/PyCall.jl/issues/863, with a few comments on how to fix it.

Any ideas? I'll try to have a look into this further, but any help getting this working would be appreciated.

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

Start by reproducing the minimal pickle.dumps(Base) example and the ray.remote example from the issue. Read the linked PyCall.jl issue for related serialization discussion; done means the reported juliacall module can be passed through the shown Python use cases without the current TypeError.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
julia, python
領域
backend
Issue 類型
缺陷
難度
5/5
預估耗時
一週以上
活躍度
停滯
描述清晰度
需要釐清
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。