From 5a83578bdeecbce74db63adcfc4f246998d902f1 Mon Sep 17 00:00:00 2001 From: jmert <2965436+jmert@users.noreply.github.com> Date: Tue, 24 Nov 2020 13:50:52 -0600 Subject: [PATCH] Fix another incorrect double wrapping of HDF5 high-level object (#153) --- src/MAT_HDF5.jl | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/MAT_HDF5.jl b/src/MAT_HDF5.jl index 433f58b..af9553d 100644 --- a/src/MAT_HDF5.jl +++ b/src/MAT_HDF5.jl @@ -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) @@ -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