Skip to content

Commit 8cbc6b2

Browse files
authored
Merge pull request #98 from fact-project/fix_mode
Use mode='r' by default
2 parents ba602d1 + 66d99ef commit 8cbc6b2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

fact/io.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def to_native_byteorder(array):
8989
return array
9090

9191

92-
def read_h5py(file_path, key='data', columns=None, mode='r+'):
92+
def read_h5py(file_path, key='data', columns=None, mode='r'):
9393
'''
9494
Read a hdf5 file written with h5py into a dataframe
9595
@@ -135,7 +135,7 @@ def read_h5py(file_path, key='data', columns=None, mode='r+'):
135135
return df
136136

137137

138-
def h5py_get_n_rows(file_path, key='data', mode='r+'):
138+
def h5py_get_n_rows(file_path, key='data', mode='r'):
139139

140140
with h5py.File(file_path, mode) as f:
141141
group = f.get(key)
@@ -146,7 +146,7 @@ def h5py_get_n_rows(file_path, key='data', mode='r+'):
146146
return group[next(iter(group.keys()))].shape[0]
147147

148148

149-
def read_h5py_chunked(file_path, key='data', columns=None, chunksize=None, mode='r+'):
149+
def read_h5py_chunked(file_path, key='data', columns=None, chunksize=None, mode='r'):
150150
'''
151151
Generator function to read from h5py hdf5 in chunks,
152152
returns an iterator over pandas dataframes.

0 commit comments

Comments
 (0)