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

JLD 0.0 reader should convert data to field type #205

Closed
tomasaschan opened this issue Jan 9, 2015 · 6 comments
Closed

JLD 0.0 reader should convert data to field type #205

tomasaschan opened this issue Jan 9, 2015 · 6 comments

Comments

@tomasaschan
Copy link
Contributor

I have a JLD file saved a few months ago, and a script which loads data from it and plots it. When I run the same script today, I get the following error:

type: setfield!: expected Dict{Symbol,Int64}, got Dict{Symbol,Union(AbstractArray{Real,1},Real)}
while loading In[4], in expression starting on line 6

 in read at /home/tlycken/.julia/v0.3/HDF5/src/JLD00.jl:466
 in read at /home/tlycken/.julia/v0.3/HDF5/src/JLD00.jl:293
 in getrefs at /home/tlycken/.julia/v0.3/HDF5/src/JLD00.jl:488
 in read at /home/tlycken/.julia/v0.3/HDF5/src/JLD00.jl:452
 in read at /home/tlycken/.julia/v0.3/HDF5/src/JLD00.jl:293
 in read at /home/tlycken/.julia/v0.3/HDF5/src/JLD00.jl:248
 in read at /home/tlycken/.julia/v0.3/HDF5/src/JLD00.jl:254
 in anonymous at /media/data/Tomas/Dropbox/Skolan/KTH/Åk6/ED225X - Examensarbete (Tomas)/Report/Plotting/ReportPlots2.jl:28
 in jldopen at /home/tlycken/.julia/v0.3/HDF5/src/JLD.jl:234
 in loaditer at /media/data/Tomas/Dropbox/Skolan/KTH/Åk6/ED225X - Examensarbete (Tomas)/Report/Plotting/ReportPlots2.jl:41

The relevant section of my own code is this:

jldopen(joinpath(root, "processed.jld")) do f
    read(f, :sall), # <-- This is ReportPlots2.jl:28 in the stacktrace above
    read(f, :sloops),
    read(f, :sloss),
    read(f, :initialhist),
    read(f, :finalhist),
    read(f, :Nbins)
end

Is this a known problem? Can I get around it by changing my code somehow? The file processed.jld holds postprocessed data from a computation run that potentially takes the better part of a day to run, so it would be nice to not have to re-run it just because I can't read the file...

I've tried pinning the package to earlier versions, but without finding one that works (I get the same error with all the ones I've tried; unfortunately, I haven't taken notes what versions I've tried...).

@simonster
Copy link
Member

Dup of #198. Should work on master.

@tomasaschan
Copy link
Contributor Author

Thanks a lot for the quick reply, @simonster!

However, I can't quite get it to work. After Pkg.checkout("HDF5"); Pkg.checkout("Compat"); Pkg.update(), then restarting the kernel and trying again, I still get the same error message. Any hints on what to try next?

@simonster
Copy link
Member

Ah, I see now. Your JLD file is in the old format, and we only changed this for the new format. I'll see if I can tweak that to work as well.

@simonster simonster reopened this Jan 9, 2015
@simonster
Copy link
Member

(If you want this to work immediately, the easiest solution is to downgrade DataFrames to 0.5.12.)

@tomasaschan
Copy link
Contributor Author

I just need these files very temporarily (I have to make a few last fixes to my thesis report) and then hopefully I'll never need to read them again, so downgrading is definitely an option. Thanks for the version reference (and for the very quick response!) - I could get it working now! =)

@simonster simonster changed the title Breaking change since a couple of months ago? JLD 0.0 reader should perform field type conversions Jan 9, 2015
@simonster simonster changed the title JLD 0.0 reader should perform field type conversions JLD 0.0 reader should convert data to field type Jan 9, 2015
@musm
Copy link
Member

musm commented Aug 4, 2020

stale / outdated

@musm musm closed this as completed Aug 4, 2020
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

3 participants