Closed galenlynch closed 5 years ago
Perhaps the sudden ambiguity stems from JuliaLang/julia#30114?
The problem seems to involve reading a Matlab logical array, but I'm having trouble creating a simple demonstration of the problem due to other, unrelated, issues with creating logical arrays:
julia> foo = BitArray{1}(undef, 3)
3-element BitArray{1}:
false
false
false
julia> file = matopen("foo.mat", "w")
MAT.MAT_HDF5.MatlabHDF5File(HDF5 data file: foo.mat, true, true, 0)
julia> write(file, "foo", foo)
ERROR: This is the write function for CompositeKind, but the input doesn't fit
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] m_write(::MAT.MAT_HDF5.MatlabHDF5File, ::HDF5.HDF5Group, ::String, ::Tuple{Int64}) at /home/glynch/.julia/packages/MAT/1a6rY/src/MAT_HDF5.jl:518
[3] m_write(::MAT.MAT_HDF5.MatlabHDF5File, ::HDF5.HDF5File, ::String, ::Array{String,1}, ::Array{Any,1}) at /home/glynch/.julia/packages/MAT/1a6rY/src/MAT_HDF5.jl:506
[4] m_write(::MAT.MAT_HDF5.MatlabHDF5File, ::HDF5.HDF5File, ::String, ::BitArray{1}) at /home/glynch/.julia/packages/MAT/1a6rY/src/MAT_HDF5.jl:521
[5] write(::MAT.MAT_HDF5.MatlabHDF5File, ::String, ::BitArray{1}) at /home/glynch/.julia/packages/MAT/1a6rY/src/MAT_HDF5.jl:534
[6] top-level scope at none:0
julia> foo = Vector{Bool}(undef, 3)
3-element Array{Bool,1}:
true
false
false
julia> write(file, "foo", foo)
ERROR: MethodError: no method matching m_writearray(::HDF5.HDF5File, ::String, ::Base.ReinterpretArray{UInt8,1,Bool,Array{Bool,1}})
Closest candidates are:
m_writearray(::Union{HDF5File, HDF5Group}, ::String, ::Array{T<:Union{Bool, Float32, Float64, Int16, Int32, Int64, Int8, UInt16, UInt32, UInt64, UInt8},N} where N) where T<:Union{Bool, Float32, Float64, Int16, Int32, Int64, Int8, UInt16, UInt32, UInt64, UInt8} at /home/glynch/.julia/dev/MAT/src/MAT_HDF5.jl:334
m_writearray(::Union{HDF5File, HDF5Group}, ::String, ::Array{Complex{T<:Union{Bool, Float32, Float64, Int16, Int32, Int64, Int8, UInt16, UInt32, UInt64, UInt8}},N} where N) where T<:Union{Bool, Float32, Float64, Int16, Int32, Int64, Int8, UInt16, UInt32, UInt64, UInt8} at /home/glynch/.julia/dev/MAT/src/MAT_HDF5.jl:346
Stacktrace:
[1] m_write(::MAT.MAT_HDF5.MatlabHDF5File, ::HDF5.HDF5File, ::String, ::Array{Bool,1}) at /home/glynch/.julia/packages/MAT/1a6rY/src/MAT_HDF5.jl:370
[2] write(::MAT.MAT_HDF5.MatlabHDF5File, ::String, ::Array{Bool,1}) at /home/glynch/.julia/packages/MAT/1a6rY/src/MAT_HDF5.jl:534
[3] top-level scope at none:0
Whoops, I just remembered that I'm using https://github.com/halleysfifthinc/MAT.jl#v0.7-update
instead of a tagged version, so this issue is maybe not relevant.
I guess you upgraded HDF5 . Try pinning it to v0.10.4. PR #110 requires HDF5 v0.11.
I am unable to load some mat files using MAT 0.4.0 and Julia 1.1.0, due to method ambiguities:
This just started happening, and I'm not sure what changed.