Skip to content

Commit

Permalink
Fix how properties are passed during dataset creation.
Browse files Browse the repository at this point in the history
JuliaIO/HDF5.jl#631 fixed a method ambiguity that is recognized in
Julia v1.3+, but the fix caused the usage here to break. This fixes
the situation on HDF5.jl v0.13.4+.
  • Loading branch information
jmert committed Sep 2, 2020
1 parent 377b83b commit 3c13788
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/MAT_HDF5.jl
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,14 @@ end

# Write an array to a dataset in a MATLAB file, returning the dataset
function m_writearray(parent::HDF5Parent, name::String, adata::AbstractArray{T}, compress::Bool) where {T<:HDF5BitsOrBool}
dset, dtype = compress ? d_create(parent, name, adata, "chunk",HDF5.heuristic_chunk(adata), "compress",3) : d_create(parent, name, adata)
if compress
p = p_create(HDF5.H5P_DATASET_CREATE)
p["compress"] = 3
p["chunk"] = HDF5.heuristic_chunk(adata)
dset, dtype = d_create(parent, name, adata, HDF5._link_properties(name), p)
else
dset, dtype = d_create(parent, name, adata)
end
try
HDF5.writearray(dset, dtype.id, adata)
dset
Expand Down

0 comments on commit 3c13788

Please sign in to comment.