Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Oct 29, 2018

I mostly rewrote :

  • some functions definitions with the new syntax ' func(... : : T) where{T}'.

  • struct definitions with the keyword 'struct' instead of 'type'

  • old variables Vector{UInt8}(nbytes) to Vector{UInt8}(undef,nbytes)

After these modifications i was able to read some .mat files

Copy link
Collaborator

@yuyichao yuyichao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still dup of #86 but if you make sure you don't touch the copying related ones, fix all the comments below, this can be merged if you claim that it fixes some usecases.

You do need to raise the julia requirement to at least 0.6.

src/MAT.jl Outdated
to a Matlab file, opening and closing it automatically.
"""
function matwrite{S, T}(filename::AbstractString, dict::Associative{S, T})
function matwrite(filename::AbstractString, dict::Dict{S, T}) where{S,T}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AbstractDict.

mattype = a_read(dset, name_type_attr_matlab)
if mattype == "char"
return ""
elseif mattype == "struct"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't delete this!

src/MAT_HDF5.jl Outdated

# Write the MATLAB type string for dset
m_writetypeattr{T}(dset, ::Type{Complex{T}}) = m_writetypeattr(dset, T)
m_writetypeattr(dset, ::Type{Complex{T}}) where{T} = m_writetypeattr(dset, T)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EOL whitespace.

src/MAT_HDF5.jl Outdated

# Write Associative as a struct
m_write(mfile::MatlabHDF5File, parent::HDF5Parent, name::String, s::Associative) =
m_write(mfile::MatlabHDF5File, parent::HDF5Parent, name::String, s::Dict) =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AbstractDict.

src/MAT.jl Outdated

# Check for MAT v4 file
magic = read!(rawfid, Vector{UInt8}(4))
magic = read!(rawfid, Vector{UInt8}(undef,4))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space after the ,, same below.

@yuyichao
Copy link
Collaborator

And this shouldn't drop 0.6 support so you need Compat.SparseArrays instead. You'll also need to raise the Compat version required and for 1.0 compatibility changes Compat 1.0 should be good enough.

@yuyichao yuyichao closed this Nov 5, 2018
@yuyichao
Copy link
Collaborator

yuyichao commented Nov 5, 2018

Sorry I made a mistake when updating this branch (I pushed my local master instead of the updated branch to the PR branch) and it appears not revertable so I reopenned this as #102

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant