Skip to content

Commit

Permalink
Remove views code from this pull request
Browse files Browse the repository at this point in the history
  • Loading branch information
mkitti committed May 29, 2022
1 parent 7d12db2 commit bc8fe33
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 50 deletions.
3 changes: 0 additions & 3 deletions src/HDF5.jl
Original file line number Diff line number Diff line change
Expand Up @@ -934,8 +934,6 @@ end
# This infers the Julia type from the HDF5.Datatype. Specific file formats should provide their own read(dset).
const DatasetOrAttribute = Union{Dataset,Attribute}

include("views.jl")

function Base.read(obj::DatasetOrAttribute)
dtype = datatype(obj)
T = get_jl_type(dtype)
Expand Down Expand Up @@ -985,7 +983,6 @@ end

"""
copyto!(output_buffer::AbstractArray{T}, obj::Union{DatasetOrAttribute}) where T
copyto!(output_buffer::AbstractArray{T}, @view(obj::Union{DatasetOrAttribute}, I...))
Copy [part of] a HDF5 dataset or attribute to a preallocated output buffer.
The output buffer must be convertible to a pointer and have a contiguous layout.
Expand Down
41 changes: 0 additions & 41 deletions src/views.jl

This file was deleted.

8 changes: 4 additions & 4 deletions test/views.jl → test/nonallocating.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
using HDF5
using Test

@testset "views and non-allocating methods" begin
@testset "non-allocating methods" begin
fn = tempname()

@info "view.jl" fn
data = rand(UInt16, 16, 16)

h5open(fn, "w") do h5f
Expand All @@ -19,7 +18,8 @@ using Test
read!(h5f["data"], buffer)
@test isequal(buffer, data)

v = @view(h5f["data"][1:4, 1:4])
# Consider making this a view later
v = h5f["data"][1:4, 1:4]

buffer = similar(v)
@test size(buffer) == (4,4)
Expand All @@ -36,4 +36,4 @@ using Test
end

rm(fn)
end
end
4 changes: 2 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ include("filter.jl")
include("chunkstorage.jl")
@debug "fileio"
include("fileio.jl")
@debug "views"
include("views.jl")
@debug "nonallocating"
include("nonallocating.jl")
@debug "filter test utils"
include("filters/FilterTestUtils.jl")

Expand Down

0 comments on commit bc8fe33

Please sign in to comment.