Skip to content

Commit

Permalink
Merge branch 'master' of github.com:nlesc/noodles
Browse files Browse the repository at this point in the history
  • Loading branch information
jhidding committed Apr 21, 2021
2 parents 1afcd7f + 540ba9e commit 9e3d590
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions noodles/serial/numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def __init__(self, filename, lockfile):
def encode(self, obj, make_rec):
key = array_sha256(obj)
with self.lock:
f = h5py.File(self.filename)
f = h5py.File(self.filename, 'a')
path = next(
(ds for ds in f if f[ds].attrs.get('hash') == key),
False)
Expand All @@ -99,7 +99,7 @@ def encode(self, obj, make_rec):

def decode(self, cls, data):
with self.lock:
f = h5py.File(self.filename)
f = h5py.File(self.filename, 'r')
obj = f[data["path"]].value
f.close()

Expand Down

0 comments on commit 9e3d590

Please sign in to comment.