Skip to content

An implementation of PyCallJLD for the JLD2 package, implementing a serializer for saving and loading PyCall objects.

License

Notifications You must be signed in to change notification settings

AP6YC/PyCallJLD2.jl

Repository files navigation

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.

About

An implementation of PyCallJLD for the JLD2 package, implementing a serializer for saving and loading PyCall objects.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages