Skip to content

Commit

Permalink
Fix another incorrect double wrapping of HDF5 high-level object (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmert authored Nov 24, 2020
1 parent 5e3ffda commit 5a83578
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/MAT_HDF5.jl
Original file line number Diff line number Diff line change
Expand Up @@ -356,12 +356,11 @@ function m_writearray(parent::HDF5Parent, name::String, adata::AbstractArray{Com
try
stype = dataspace(adata)
if compress
obj_id = create_dataset(parent, name, dtype, stype;
dset = create_dataset(parent, name, dtype, stype;
compress = 3, chunk = HDF5.heuristic_chunk(adata))
else
obj_id = create_dataset(parent, name, dtype, stype)
dset = create_dataset(parent, name, dtype, stype)
end
dset = HDF5.Dataset(obj_id, HDF5.file(parent))
try
arr = reshape(reinterpret(T, adata), tuple(2, size(adata)...))
write_dataset(dset, dtype, arr)
Expand All @@ -371,7 +370,7 @@ function m_writearray(parent::HDF5Parent, name::String, adata::AbstractArray{Com
finally
close(stype)
end
dset
return dset
finally
close(dtype)
end
Expand Down

0 comments on commit 5a83578

Please sign in to comment.