Skip to content

Commit

Permalink
Fix reading HDF5 from buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
alubbock committed Nov 3, 2018
1 parent f34ed22 commit 6648cfb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath('../'))

# -- General configuration ------------------------------------------------

Expand Down
14 changes: 13 additions & 1 deletion doc/tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,26 @@
"First, specify a file to load. This can be done as a string filename, but here we load an example dataset from the thunor package itself, but you can also another filename."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# If \"import thunor\" fails, you may need to uncomment the following two lines\n",
"# import os, sys\n",
"# sys.path.insert(0, os.path.abspath('../'))\n",
"import thunor"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import pkg_resources\n",
"hts007_file = pkg_resources.resource_filename('thunor', 'testdata/hts007.h5')"
"hts007_file = pkg_resources.resource_stream('thunor', 'testdata/hts007.h5')"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion thunor/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ def _read_hdf_unstacked(filename_or_buffer):
'path': 'data.h5',
'driver': 'H5FD_CORE',
'driver_core_backing_store': 0,
'driver_core_image': filename_or_buffer
'driver_core_image': filename_or_buffer.read()
})
with pd.HDFStore(**hdf_kwargs) as hdf:
df_assays = hdf['assays']
Expand Down

0 comments on commit 6648cfb

Please sign in to comment.