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

h5dump compatibility #18

Closed
timholy opened this issue Jul 11, 2017 · 2 comments
Closed

h5dump compatibility #18

timholy opened this issue Jul 11, 2017 · 2 comments

Comments

@timholy
Copy link
Member

timholy commented Jul 11, 2017

I was taking a look at JuliaIO/JLD.jl#168 and noticed that it's fixed here (yay!). I went looking for clues with h5dump, and noticed that the demo in that issue, when saved as a .jld2, doesn't support h5dump.

@timholy
Copy link
Member Author

timholy commented Jul 11, 2017

h5ls seems OK, though.

@simonster
Copy link
Member

This seems to work for me. Make sure you have HDF5 1.10 or newer; otherwise you'll get an internal error.

julia> using JLD

julia> type type1
         a::CartesianIndex{3}
       end

julia> p = (2, 3, 4)
(2, 3, 4)

julia> my_object = type1(CartesianIndex(p))
type1(CartesianIndex{3}((2, 3, 4)))

julia> save("test.jld2", "my_object", my_object)

shell> /usr/local/bin/h5dump test.jld2
HDF5 "test.jld2" {
GROUP "/" {
   GROUP "_types" {
      DATATYPE "00000001" H5T_COMPOUND {
         H5T_STRING {
            STRSIZE H5T_VARIABLE;
            STRPAD H5T_STR_NULLPAD;
            CSET H5T_CSET_UTF8;
            CTYPE H5T_C_S1;
         } "name";
         H5T_VLEN { H5T_REFERENCE { H5T_STD_REF_OBJECT }} "parameters";
      }
         ATTRIBUTE "julia_type" {
            DATATYPE  "/_types/00000001"
            DATASPACE  SCALAR
            DATA {
            (0): {
                  "Core.DataType",
                  ()
               }
            }
         }
      DATATYPE "00000002" H5T_COMPOUND {
         H5T_STD_I64LE "1";
         H5T_STD_I64LE "2";
         H5T_STD_I64LE "3";
      }
         ATTRIBUTE "julia_type" {
            DATATYPE  "/_types/00000001"
            DATASPACE  SCALAR
            DATA {
            (0): {
                  "Core.Tuple",
                  (DATASET 4449, DATASET 4449, DATASET 4449)
               }
            }
         }
      DATATYPE "00000003" H5T_COMPOUND {
         H5T_COMPOUND {
            H5T_STD_I64LE "1";
            H5T_STD_I64LE "2";
            H5T_STD_I64LE "3";
         } "I";
      }
         ATTRIBUTE "field_datatypes" {
            DATATYPE  H5T_REFERENCE { H5T_STD_REF_OBJECT }
            DATASPACE  SIMPLE { ( 1 ) / ( 1 ) }
            DATA {
            (0): DATATYPE 4312 /_types/00000002 
            }
         }
         ATTRIBUTE "julia_type" {
            DATATYPE  "/_types/00000001"
            DATASPACE  SCALAR
            DATA {
            (0): {
                  "Base.IteratorsMD.CartesianIndex",
                  (DATASET 4732)
               }
            }
         }
      DATATYPE "00000004" H5T_COMPOUND {
         H5T_COMPOUND {
            H5T_COMPOUND {
               H5T_STD_I64LE "1";
               H5T_STD_I64LE "2";
               H5T_STD_I64LE "3";
            } "I";
         } "a";
      }
         ATTRIBUTE "field_datatypes" {
            DATATYPE  H5T_REFERENCE { H5T_STD_REF_OBJECT }
            DATASPACE  SIMPLE { ( 1 ) / ( 1 ) }
            DATA {
            (0): DATATYPE 4528 /_types/00000003 
            }
         }
         ATTRIBUTE "julia_type" {
            DATATYPE  "/_types/00000001"
            DATASPACE  SCALAR
            DATA {
            (0): {
                  "type1",
                  ()
               }
            }
         }
   }
   DATASET "my_object" {
      DATATYPE  "/_types/00000004"
      DATASPACE  SCALAR
      DATA {
      (0): {
            {
               {
                  2,
                  3,
                  4
               }
            }
         }
      }
   }
}
}

@timholy timholy closed this as completed Jul 12, 2017
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