diff --git a/CHANGELOG.md b/CHANGELOG.md index ab7f49d2..4b7e8b1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,16 +1,20 @@ +## 0.5.10 + - fix regression for `UInt32` + - **Deprecation**: Do not rely on JLD2 to load a compression library. This feature will be removed in a future release. Instead explicitly add `using` statements into your scripts. + ## 0.5.9 - fix regression for `Union{Bool,Nothing}` array elements (#617) - - fix printing issue in `printtoc` + - fix printing issue in `printtoc` ## 0.5.8 - Stop using `Base.module_keys` as it is removed on nightly ## 0.5.7 - Fix edge case for uninitialized Vlens - + ## 0.5.6 - Add Aqua tests and eliminate method ambiguities - + ## 0.5.5 - Experimental support for writing to and reading from `IO` objects e.g. `jldopen(io, "r")` @@ -27,7 +31,7 @@ that may get GC'ed while storing is in progress! (#603) ## 0.5.1 - Bugfix and added test for bug introduced in v0.5.0 - + ## 0.5.0 - Improved encoding of committed datatypes. This fixes longstanding issues but new files will not be loaded correctly with JLD2 versions prior to `v0.5.0`. @@ -58,7 +62,7 @@ that may get GC'ed while storing is in progress! (#603) - fix `Upgrade` for Singleton types ## 0.4.50 - - Don't hide exception data during loading and saving (#569) + - Don't hide exception data during loading and saving (#569) ## 0.4.49 - update compat bounds @@ -68,7 +72,7 @@ that may get GC'ed while storing is in progress! (#603) - fix behaviour for unnormalized strings - add missing method for load_attributes - clean up `using` statements - + ## 0.4.47 - fix loading structs with more than 256 fields (#558) @@ -107,7 +111,7 @@ that may get GC'ed while storing is in progress! (#603) - restrict default Dict encoding to Base implementations ## 0.4.37 - - Update Dict encoding for latest julia + - Update Dict encoding for latest julia ## 0.4.36 - compat bound for TranscodingStreams.jl @@ -129,22 +133,22 @@ that may get GC'ed while storing is in progress! (#603) ## 0.4.31 - fix UInt32 truncation error for absurdly large array sizes - move test-files to a separate repo - + ## 0.4.30 - allow loading compressed files during precompilation #446 (@marius311) - + ## 0.4.29 - added `Upgrade` feature - + ## 0.4.28 - compatibility to julia v1.9-dev (@eschnett) - + ## 0.4.26 - fix identity relations with custom serialization ## 0.4.25 - remove leftover debug statement - + ## 0.4.24 - read-only support for `JLD.jl` files - read-only support for many HDF5 files. Most test files of HDF5.jl are covered @@ -155,14 +159,14 @@ that may get GC'ed while storing is in progress! (#603) ## 0.4.23 - Support for `const` fields in mutable structs - + ## 0.4.22 - Fix reconstruction of partially initialized structs ## 0.4.21 - - Add explicit type mapping + - Add explicit type mapping -## 0.4.20 +## 0.4.20 - TTFX improvements - Add a comment on jldsave (@BoundaryValueProblems) ## 0.4.19 diff --git a/Project.toml b/Project.toml index a86f6234..548f8296 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "JLD2" uuid = "033835bb-8acc-5ee8-8aae-3f567f8a3819" -version = "0.5.9" +version = "0.5.10" [deps] FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" diff --git a/src/data/number_types.jl b/src/data/number_types.jl index 176c0785..71a80361 100644 --- a/src/data/number_types.jl +++ b/src/data/number_types.jl @@ -37,7 +37,7 @@ function jltype(f::JLDFile, dt::FixedPointDatatype) elseif dt.size == 1 return signed ? SameRepr{Int8}() : SameRepr{UInt8}() elseif dt.size == 4 - return signed ? SameRepr{Int32}() : SameRepr{Int32}() + return signed ? SameRepr{Int32}() : SameRepr{UInt32}() elseif dt.size == 2 return signed ? SameRepr{Int16}() : SameRepr{UInt16}() elseif dt.size == 16 diff --git a/test/loadsave.jl b/test/loadsave.jl index 5b3decaf..5a3e00f1 100644 --- a/test/loadsave.jl +++ b/test/loadsave.jl @@ -847,4 +847,21 @@ end loaded_data = load(fn, "data") @test !isassigned(loaded_data, 2) @test loaded_data[1] == :a -end \ No newline at end of file +end + +@testset "Issue #619 - Number type turnaround" begin + fn = joinpath(mktempdir(), "number_type_turnaround.jld2") + types = [UInt8, Int8, UInt16, Int16, UInt32, Int32, UInt64, Int64, UInt128, Int128, Float16, Float32, Float64] + jldopen(fn, "w") do f + for t in types + f[string(t)] = typemax(t) + end + end + jldopen(fn) do f + for t in types + v = f[string(t)] + @test v isa t + @test v == typemax(t) + end + end +end diff --git a/test/runtests.jl b/test/runtests.jl index 89a11958..df52be7b 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,5 +1,6 @@ using JLD2, FileIO using Test +using CodecZlib, CodecBzip2, CodecZstd, CodecLz4 function better_success(cmd) fn1, _ = mktemp()