Skip to content

Commit

Permalink
Moving from dill to pickle for writing dump files
Browse files Browse the repository at this point in the history
  • Loading branch information
stammler committed May 24, 2023
1 parent 9a8ff75 commit ad3e691
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
1 change: 0 additions & 1 deletion docs/requirements.txt
@@ -1,4 +1,3 @@
dill
h5py
ipykernel
jupyter
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
@@ -1,4 +1,3 @@
dill
h5py
matplotlib
numpy
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -52,7 +52,7 @@ def read_version():
],

packages=find_packages(),
install_requires=["dill", "h5py", "matplotlib", "numpy", "scipy"],
install_requires=["h5py", "matplotlib", "numpy", "scipy"],
include_package_data=True,
zip_safe=False,
)
6 changes: 3 additions & 3 deletions simframe/io/dump.py
@@ -1,4 +1,4 @@
import dill
import pickle


def writedump(object, filename="object.dmp"):
Expand All @@ -11,7 +11,7 @@ def writedump(object, filename="object.dmp"):
filename : str, optional, default : "object.dmp"
path to file to be written"""
with open(filename, "wb") as dumpfile:
dill.dump(object, dumpfile)
pickle.dump(object, dumpfile)


def readdump(filename):
Expand All @@ -32,5 +32,5 @@ def readdump(filename):
Only read dump files from sources you trust.
Malware can be injected."""
with open(filename, "rb") as dumpfile:
obj = dill.load(dumpfile)
obj = pickle.load(dumpfile)
return obj
4 changes: 4 additions & 0 deletions tests/io/test_namespacewriter.py
Expand Up @@ -22,6 +22,10 @@ def test_namespacewriter_getfilename():


def test_namespacewriter_simple():

global dYdx
global dx

f = Frame()
f.addfield("Y", 1.)
f.addgroup("A")
Expand Down
4 changes: 4 additions & 0 deletions tests/io/test_reader.py
Expand Up @@ -47,6 +47,10 @@ def f():


def test_simple_read_files():

global dYdx
global dx

f = Frame()
f.addgroup("A")
f.A.addfield("B", [0., 0.])
Expand Down

0 comments on commit ad3e691

Please sign in to comment.