Skip to content

Commit

Permalink
load_data() returns the H5 file, wrapped in an np.array()
Browse files Browse the repository at this point in the history
  • Loading branch information
dsblank committed Sep 14, 2018
1 parent 2645283 commit c9809d3
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions conx/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2095,17 +2095,14 @@ def shape(item, summary=False):
else:
return retval

def load_data(filename, return_h5=False, *args, **kwargs):
def load_data(filename, *args, **kwargs):
"""
Load a numpy or h5 datafile.
"""
import h5py
if filename.endswith("h5"):
h5 = h5py.File(filename, 'r')
if return_h5:
return h5
else:
return h5["data"][:]
return np.array(h5["data"])
else:
return np.load(filename, *args, **kwargs)

Expand Down

0 comments on commit c9809d3

Please sign in to comment.