Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

file["varname"] and file[:varname] interface? #30

Open
lucasb-eyer opened this issue Aug 14, 2014 · 6 comments
Open

file["varname"] and file[:varname] interface? #30

lucasb-eyer opened this issue Aug 14, 2014 · 6 comments

Comments

@lucasb-eyer
Copy link
Contributor

I just found myself intuitively expecting that, probably because I'm used to it from scipy io and jsoncpp.

Would you want a PR for that, or is it too non-Julian? (Or is there a caveat which I'm not seeing?)

@simonster
Copy link
Member

This seems reasonable to me. It's also possible we might want to use this syntax for an interface that allows incremental reading/writing of datasets, analogous to what HDF5 (and MATLAB's matfile) do, but no one has asked for that yet. @timholy, what do you think?

@lucasb-eyer
Copy link
Contributor Author

Not sure how that would play together, though. file[:X, 100:200] += 10?

@timholy
Copy link
Member

timholy commented Aug 16, 2014

Can we get both without ambiguity?

obj = file["varname"]
X = obj[100:200]

@lucasb-eyer
Copy link
Contributor Author

My guess was that to achieve this, we need another family of proxy-types for obj which sounds like overkill, but then again, I don't know much of Julia. I also wouldn't be up for the task.

lucasb-eyer added a commit to lucasb-eyer/MAT.jl that referenced this issue Aug 16, 2014
@jgbos
Copy link

jgbos commented Sep 19, 2017

I figure my issues falls into this category. I was hoping I could read MatlabHDF5File files incrementally. We have very large MAT files and was hoping I could just do:

mat = matopen("myfile.mat")
mat.plain["data"][:, :, :, 1]

but get the following error:

ERROR: Dataset indexing (hyperslab) is available only for bits types
Stacktrace:
 [1] _getindex(::HDF5.HDF5Dataset, ::Type{T} where T, ::UnitRange{Int64}, ::Vararg{Union{Int64, Range{Int64}},N} where N) at .julia/v0.6/HDF5/src/HDF5.jl:1682
 [2] getindex(::HDF5.HDF5Dataset, ::UnitRange{Int64}, ::UnitRange{Int64}, ::UnitRange{Int64}, ::Int64, ::Vararg{Int64,N} where N) at .julia/v0.6/HDF5/src/HDF5.jl:1678
 [3] getindex(::HDF5.HDF5Dataset, ::Colon, ::Colon, ::Colon, ::Int64, ::Vararg{Int64,N} where N) at .julia/v0.6/HDF5/src/HDF5.jl:1747

There are no issues reading via matfile. I wish I could just convince our people to just use HDF5 in this case!

@jgbos
Copy link

jgbos commented Sep 19, 2017

Shoot delving into the issue, this is a reading a matrix of complex numbers

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

No branches or pull requests

4 participants