Skip to content

Commit

Permalink
more deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbyrne committed Sep 5, 2023
1 parent caf143e commit ec996f2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
1 change: 1 addition & 0 deletions src/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/readwrite.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 4 additions & 14 deletions test/plain.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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)"

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ec996f2

Please sign in to comment.