PyCallJLD2.jl

An implementation of PyCallJLD for the JLD2 package, implementing a serializer for saving and loading PyCall objects.
Author AP6YC
Popularity
1 Star
Updated Last
11 Months Ago
Started In
July 2023

pycalljld2-header

This package is to JLD2 what PyCallJLD is to JLD, implementing a serializer for saving and loading PyCall PyObjects with JLD2.

Please see the official documentation for usage and contribution guidelines.

Documentation Coverage CI Status Releases
Dev Codecov CI Status Zenodo
Stable Coveralls Documentation version
Dependents Issues JuliaHub Status Downloads
deps GitHubIssues JuliaHub Downloads

Table of Contents

Usage

Please see the documentation for full usage.

To save and load JLD2, load PyCall, JLD2, and PyCallJLD2 in the same scope as where you intend to use the JLD2.save and JLD2.load functions. If you are coming from PyCallJLD, simply replace JLD with JLD2 everywhere in your usage.

The following example is take from PyCallJLD for direct comparison:

using PyCall, JLD2, PyCallJLD2

@pyimport sklearn.linear_model as lm

# Create some Python objects
m1 = lm.LinearRegression()
m2 = lm.ARDRegression()

# Save them to models.jld2
JLD2.save("models.jld2", "mods", [m1, m2])

# Load them back
models = JLD2.load("models.jld2", "mods")

# Do a dance🕺

Just as in PyCallJLD, these objects are saved with pickle.dumps.

Attribution

Authors

The following authors are responsible for authoring this package:

Packages

This package is heavily based upon the PyCallJLD.jl package; the funky-monkey-wrenching of PyCall ccalls, pointers, and other low-level tomfoolery would have been arcane and indecipherable without this prior work. This package merely modifies its internal usage to match the modified JLD2 API for custom serialization.

License

This package uses the MIT License.

Used By Packages

No packages found.