diff --git a/docs/v0.1.0/.documenter-siteinfo.json b/docs/v0.1.0/.documenter-siteinfo.json index 763293b..a748a5f 100644 --- a/docs/v0.1.0/.documenter-siteinfo.json +++ b/docs/v0.1.0/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.0","generation_timestamp":"2024-06-04T08:50:31","documenter_version":"1.4.1"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.0","generation_timestamp":"2024-06-04T11:06:02","documenter_version":"1.4.1"}} \ No newline at end of file diff --git a/src/h5df_format.jl b/src/h5df_format.jl index 6adc9a9..f006caf 100644 --- a/src/h5df_format.jl +++ b/src/h5df_format.jl @@ -879,7 +879,7 @@ function Formats.format_get_matrix( end function dataset_as_vector(dataset::HDF5.Dataset)::Tuple{StorageVector, CacheType} - if HDF5.ismmappable(dataset) && HDF5.iscontiguous(dataset) + if HDF5.ismmappable(dataset) && HDF5.iscontiguous(dataset) && length(dataset) > 0 return (HDF5.readmmap(dataset), MappedData) else return (read(dataset), MemoryData) @@ -887,7 +887,7 @@ function dataset_as_vector(dataset::HDF5.Dataset)::Tuple{StorageVector, CacheTyp end function dataset_as_matrix(dataset::HDF5.Dataset)::Tuple{StorageMatrix, CacheType} - if HDF5.ismmappable(dataset) && HDF5.iscontiguous(dataset) + if HDF5.ismmappable(dataset) && HDF5.iscontiguous(dataset) && length(dataset) > 0 return (HDF5.readmmap(dataset), MappedData) else return (read(dataset), MemoryData) # untested