From ec996f2705a991f19fb97f171bd4f5524133996a Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Tue, 5 Sep 2023 14:59:40 -0700 Subject: [PATCH] more deprecations --- src/deprecated.jl | 1 + src/readwrite.jl | 2 +- test/plain.jl | 18 ++++-------------- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/deprecated.jl b/src/deprecated.jl index 28761845d..e89132e68 100644 --- a/src/deprecated.jl +++ b/src/deprecated.jl @@ -85,6 +85,7 @@ import .Filters: ExternalFilter p::Properties, val::Bool ) false +### Changed in PR #1104 Base.@deprecate( dataspace(sz::Dims{N}; max_dims::Union{Dims{N},Tuple{}}=()) where {N}, Dataspace(sz; max_dims=max_dims == () ? nothing : max_dims) diff --git a/src/readwrite.jl b/src/readwrite.jl index 0769746e3..0abbd3b46 100644 --- a/src/readwrite.jl +++ b/src/readwrite.jl @@ -173,7 +173,7 @@ function _generic_read( end memtype = _memtype(filetype, T) - memspace = isempty(I) ? dspace : dataspace(sz) + memspace = isempty(I) ? dspace : Dataspace(sz) try if obj isa Dataset diff --git a/test/plain.jl b/test/plain.jl index f9a96afef..d5ee740b1 100644 --- a/test/plain.jl +++ b/test/plain.jl @@ -137,16 +137,12 @@ end copy_object(f["mygroup/BloscA"], g, "BloscA") close(g) # Writing hyperslabs - dset = create_dataset( - f, "slab", datatype(Float64), (20, 20, 5); chunk=(5, 5, 1) - ) + dset = create_dataset(f, "slab", datatype(Float64), (20, 20, 5); chunk=(5, 5, 1)) Xslab = randn(20, 20, 5) for i in 1:5 dset[:, :, i] = Xslab[:, :, i] end - dset = create_dataset( - f, nothing, datatype(Float64), (20, 20, 5); chunk=(5, 5, 1) - ) + dset = create_dataset(f, nothing, datatype(Float64), (20, 20, 5); chunk=(5, 5, 1)) dset[:, :, :] = 3.0 # More complex hyperslab and assignment with "incorrect" types (issue #34) d = create_dataset(f, "slab2", datatype(Float64), ((10, 20), (100, 200)); chunk=(1, 1)) @@ -906,10 +902,8 @@ end # generic read of native types dtypeattrs = attributes(dtype) @test sprint(show, dtypeattrs) == "Attributes of HDF5.Datatype: /type H5T_IEEE_F64LE" - # Now test printing after closing each object - close(dtype) @test sprint(show, dtype) == "HDF5.Datatype: (invalid)" @@ -1252,18 +1246,14 @@ end # haskey tests hfile = h5open(fn, "w") @test_nowarn create_group(hfile, GenericString("group1")) - @test_nowarn create_dataset( - hfile, GenericString("dset1"), datatype(Int), (1,) - ) + @test_nowarn create_dataset(hfile, GenericString("dset1"), datatype(Int), (1,)) @test_nowarn create_dataset(hfile, GenericString("dset2"), 1) @test_nowarn hfile[GenericString("group1")] @test_nowarn hfile[GenericString("dset1")] dset1 = hfile["dset1"] - @test_nowarn create_attribute( - dset1, GenericString("meta1"), datatype(Bool), (1,) - ) + @test_nowarn create_attribute(dset1, GenericString("meta1"), datatype(Bool), (1,)) @test_nowarn create_attribute(dset1, GenericString("meta2"), 1) @test_nowarn dset1[GenericString("meta1")] @test_nowarn dset1[GenericString("x")] = 2