Skip to content

Commit

Permalink
allow passing pytables options on load operation via pytables_kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
Matteo Cerutti committed Nov 20, 2019
1 parent 01af936 commit d45d90e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions deepdish/io/hdf5io.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ def save(path, data, compression='default'):
group._v_attrs[DEEPDISH_IO_UNPACK] = True


def load(path, group=None, sel=None, unpack=False):
def load(path, group=None, sel=None, unpack=False, pytables_kwargs={}):
"""
Loads an HDF5 saved with `save`.
Expand All @@ -621,6 +621,8 @@ def load(path, group=None, sel=None, unpack=False):
If True, a single-entry dictionaries will be unpacked and the value
will be returned directly. That is, if you save ``dict(a=100)``, only
``100`` will be loaded.
pytables_kwargs : dict
Keyword arguments to pass to pytables when opening a file.
Returns
-------
Expand All @@ -632,7 +634,7 @@ def load(path, group=None, sel=None, unpack=False):
save
"""
with tables.open_file(path, mode='r') as h5file:
with tables.open_file(path, mode='r', **pytables_kwargs) as h5file:
pathtable = {} # dict to keep track of objects already loaded
if group is not None:
if isinstance(group, str):
Expand Down

0 comments on commit d45d90e

Please sign in to comment.