JuliaPy / JuliaPy/PythonCall.jl
Pickle doesn't work on julia modules
- Vorherrschende Sprache
- Julia
- Sterne
- 1.1k
- Forks
- 86
- Ø Merge
- 1 T. 22 Std.
- Gemergte PRs (30 T.)
- 3
Beschreibung
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.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- julia, python
- Bereich
- backend
- Issue-Typ
- Bug
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100