Skip to content

collect_results handles .jld2 with groups incorrectly #396

@xukai92

Description

@xukai92

Describe the bug
When config is saved as JLD2 format and has groups, collect_results cannot properly collect the results into a data frame

Minimal Working Example

config = Dict("a/x" => 1, "a/y" => 2, "a/z" => 3, "b/x" => "one", "b/y" => "two")
save("example.jld2", config)
collect_results(".")

gives
image

the root cause is the use of jldopen in function to_data_row(file::File{format"JLD2"}; kwargs...) that results in the grouped dict:

cjld2 = JLD2.jldopen("example.jld2")

image
and the keys on it is the groups

keys(cjld2)

gives

2-element Vector{String}:
 "a"
 "b"

comparing to loading with wload

wload("example.jld2")

which gives

Dict{String, Any} with 5 entries:
  "a/x" => 1
  "a/z" => 3
  "b/y" => "two"
  "a/y" => 2
  "b/x" => "one"

I think we should allow the user to control whether or not jldopen is used.
Any suggestion how to implement this?
I'm happy to raise a PR once we have an agreed solution.


  • Julia 1.9.3
  • DrWatson v2.12.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionLet's talk about how things should be!saving-filesFunctionality for saving files

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions