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

World age issue when dynamically loading CodecZlib #623

Open
kbarros opened this issue Nov 26, 2024 · 2 comments
Open

World age issue when dynamically loading CodecZlib #623

kbarros opened this issue Nov 26, 2024 · 2 comments

Comments

@kbarros
Copy link

kbarros commented Nov 26, 2024

Hi, I'm on Julia 1.11 and JLD2 v0.5.10. Is the error below an expected behavior?

import JLD2
filename = "/Users/kbarros/Desktop/1Dcut_sym_0p00T_K.nxs"

# [ Info: Attempting to dynamically load CodecZlib
# ERROR: MethodError: no method matching CodecZlib.ZlibDecompressor()
# The applicable method may be too new: running in world age 26666, while current world is 26668.
data = JLD2.jldopen(filename, "r"; compress=false)
println(data["MDHistoWorkspace"]["data"]["signal"])

# The second time it works
data = JLD2.jldopen(filename, "r"; compress=false)
println(data["MDHistoWorkspace"]["data"]["signal"])

Also, is there any way to avoid the dependency on CodeZlib for this file?

1Dcut_sym_0p00T_K.nxs.zip

@JonasIsensee
Copy link
Collaborator

Hi @kbarros ,

I've also observed this on v1.11 and I don't know whether it can be fixed.
This is one of the reasons that the dynamic loading will probably be removed from JLD2 in the future.
(Instead, you should manually import CodecZlib)

About your second question:
Loading your file triggered the loading of CodecZlib. This means that your dataset in this file is stored in compressed form. There is no way to access it without the (de-) compression algorithm.

Side note: the compress=false argument is the default and only used when writing anyway.

@kbarros
Copy link
Author

kbarros commented Nov 26, 2024

Thanks, this sounds reasonable. I agree an error saying "You must load CodecZlib" would be preferable.

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

2 participants