Skip to content

Commit

Permalink
Added utils load_data(), and save_data()
Browse files Browse the repository at this point in the history
  • Loading branch information
dsblank committed Sep 13, 2018
1 parent 9cc52b6 commit abb93d5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions conx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@
from .dataset import *

print("ConX, version %s" % __version__, file=sys.stderr)
sys.stderr.flush()
12 changes: 12 additions & 0 deletions conx/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2094,6 +2094,18 @@ def shape(item, summary=False):
else:
return retval

def load_data(filename, *args, **kwargs):
"""
Load a numpy datafile.
"""
return np.load(filename, *args, **kwargs)

def save_data(filename, data, *args, **kwargs):
"""
Save an numpy datafile.
"""
np.save(filename, data, *args, **kwargs)

def get_ranges(items, form, dims=tuple()):
"""
Expand Down

0 comments on commit abb93d5

Please sign in to comment.