Code Monkey home page Code Monkey logo

Comments (4)

JonasIsensee avatar JonasIsensee commented on June 8, 2024 1

That makes more sense.
Ah, maybe I only tested on an older version of JLD2.

This was broken by #492
which apparently was an overly eager fix.

It should not define a custom serialization for <:AbstractDict
but only for the ones implementations of AbstractDict.

from jld2.jl.

JonasIsensee avatar JonasIsensee commented on June 8, 2024 1

This is fixed on v0.4.38

from jld2.jl.

JonasIsensee avatar JonasIsensee commented on June 8, 2024

Hi @justinmimbs,
thanks for the report.
The error message above has little to do with JLD2.

julia> LRU{UInt64, String}()
ERROR: UndefKeywordError: keyword argument `maxsize` not assigned
Stacktrace:
   [1] LRU{UInt64, String}()
     @ LRUCache /data.lmp/isensee/.julia/packages/LRUCache/NCFtW/src/LRUCache.jl:21

When I construct a cache with the required maxsize keyword, it works for me.

julia> jldsave("lru.jld2"; lru = LRU{UInt64,String}(maxsize=10))

julia> load("lru.jld2")
Dict{String, Any} with 1 entry:
  "lru" => LRU{UInt64, String}(; maxsize = 10)

If the problem persists, you are welcome to provide more info :)

from jld2.jl.

justinmimbs avatar justinmimbs commented on June 8, 2024

Thanks, @JonasIsensee.

I'm sorry, I stripped my example too aggressively when posting it. 😅

Running the corrected example using JLD2 v0.4.36 gives me the same result you posted. However, running it using JLD2 v0.4.37 gives me the error as described.

julia> jldsave("lru.jld2"; lru = LRU{UInt64,String}(maxsize=10))

julia> load("lru.jld2")
Error encountered while load FileIO.File{FileIO.DataFormat{:JLD2}, String}("lru.jld2").

Fatal error:
ERROR: UndefKeywordError: keyword argument `maxsize` not assigned
Stacktrace:
  [1] LRU{UInt64, String}()
    @ LRUCache ~/.julia/packages/LRUCache/NCFtW/src/LRUCache.jl:21
  [2] rconvert(#unused#::Type{LRU{UInt64, String}}, x::Vector{Pair{UInt64, String}})
    @ JLD2 ~/.julia/packages/JLD2/z2UM4/src/data/specialcased_types.jl:252
  [3] jlconvert(#unused#::JLD2.ReadRepresentation{LRU{UInt64, String}, JLD2.CustomSerialization{Array, JLD2.RelOffset}}, f::JLD2.JLDFile{JLD2.MmapIO}, ptr::Ptr{Nothing}, header_offset::JLD2.RelOffset)
    @ JLD2 ~/.julia/packages/JLD2/z2UM4/src/data/custom_serialization.jl:57
  [4] read_scalar(f::JLD2.JLDFile{JLD2.MmapIO}, rr::JLD2.ReadRepresentation{LRU{UInt64, String}, JLD2.CustomSerialization{Array, JLD2.RelOffset}}, header_offset::JLD2.RelOffset)
    @ JLD2 ~/.julia/packages/JLD2/z2UM4/src/dataio.jl:37
  [5] read_data(f::JLD2.JLDFile{JLD2.MmapIO}, rr::Any, read_dataspace::Tuple{JLD2.ReadDataspace, JLD2.RelOffset, JLD2.DataLayout, JLD2.FilterPipeline}, attributes::Vector{JLD2.ReadAttribute})
    @ JLD2 ~/.julia/packages/JLD2/z2UM4/src/datasets.jl:238

Can you please confirm this does not error for you using these versions?

  [033835bb] JLD2 v0.4.37
  [8ac3fa9e] LRUCache v1.5.0

Thanks for your help.

from jld2.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.