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

update for 0.7 #468

Merged
merged 4 commits into from
Mar 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
julia 0.6
BinDeps 0.6.0
Blosc
Compat 0.32.0
Compat 0.61.0
@osx Homebrew 0.3.1
@windows WinRPM
1 change: 1 addition & 0 deletions deps/build.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using BinDeps
using Compat
using Compat.Libdl

@BinDeps.setup

Expand Down
152 changes: 77 additions & 75 deletions src/HDF5.jl

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions src/blosc_filter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ struct H5Z_class2_t
encoder_present::Cuint # Does this filter have an encoder?
decoder_present::Cuint # Does this filter have a decoder?
name::Ptr{UInt8} # Comment for debugging
can_apply::Ptr{Void} # The "can apply" callback
set_local::Ptr{Void} # The "set local" callback
filter::Ptr{Void} # The filter callback
can_apply::Ptr{Cvoid} # The "can apply" callback
set_local::Ptr{Cvoid} # The "set local" callback
filter::Ptr{Cvoid} # The filter callback
end

const FILTER_BLOSC_VERSION = 2
const FILTER_BLOSC = 32001 # Filter ID registered with the HDF Group for Blosc
const blosc_name = "blosc"

const blosc_flags_ = Vector{Cuint}(1)
const blosc_nelements_ = Vector{Csize_t}(1)
const blosc_values = Vector{Cuint}(8)
const blosc_chunkdims = Vector{Hsize}(32)
const blosc_flags_ = Vector{Cuint}(undef,1)
const blosc_nelements_ = Vector{Csize_t}(undef,1)
const blosc_values = Vector{Cuint}(undef,8)
const blosc_chunkdims = Vector{Hsize}(undef,32)
function blosc_set_local(dcpl::Hid, htype::Hid, space::Hid)
blosc_nelements_[1] = 8
if ccall((:H5Pget_filter_by_id2,libhdf5), Herr,
Expand Down Expand Up @@ -75,7 +75,7 @@ end

function blosc_filter(flags::Cuint, cd_nelmts::Csize_t,
cd_values::Ptr{Cuint}, nbytes::Csize_t,
buf_size::Ptr{Csize_t}, buf::Ptr{Ptr{Void}})
buf_size::Ptr{Csize_t}, buf::Ptr{Ptr{Cvoid}})
typesize = unsafe_load(cd_values, 3) # The datatype size
outbuf_size = unsafe_load(cd_values, 4)
# Compression level:
Expand Down Expand Up @@ -122,7 +122,7 @@ function register_blosc()
c_blosc_set_local = cfunction(blosc_set_local, Herr, Tuple{Hid,Hid,Hid})
c_blosc_filter = cfunction(blosc_filter, Csize_t,
Tuple{Cuint, Csize_t, Ptr{Cuint}, Csize_t,
Ptr{Csize_t}, Ptr{Ptr{Void}}})
Ptr{Csize_t}, Ptr{Ptr{Cvoid}}})
if ccall((:H5Zregister, libhdf5), Herr, (Ref{H5Z_class2_t},),
H5Z_class2_t(H5Z_CLASS_T_VERS,
FILTER_BLOSC,
Expand Down
4 changes: 2 additions & 2 deletions src/datafile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# Types inheriting from DataFile should have names, read, and write
# methods

@compat abstract type DataFile end
abstract type DataFile end

import Base: read, write

Expand Down Expand Up @@ -40,7 +40,7 @@ read(f::Base.Callable, parent::DataFile, name::String...) =
# Read every variable in the file
function read(f::DataFile)
vars = names(f)
vals = Vector{Any}(length(vars))
vals = Vector{Any}(undef,length(vars))
for i = 1:length(vars)
vals[i] = read(f, vars[i])
end
Expand Down
2 changes: 1 addition & 1 deletion test/extend_test.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using HDF5
using Base.Test
using Compat.Test

@testset "extendtest" begin

Expand Down
2 changes: 1 addition & 1 deletion test/external.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using HDF5
using Base.Test
using Compat.Test

@testset "external" begin

Expand Down
13 changes: 7 additions & 6 deletions test/gc.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
using HDF5
using Base.Test
using Compat.Test
import Compat.GC

macro gcvalid(args...)
Expr(:block, quote
gc_enable(true)
gc()
gc_enable(false)
GC.enable(true)
GC.gc()
GC.enable(false)
end,
[:(@test HDF5.isvalid($(esc(x)))) for x in args]...)
end
Expand All @@ -23,7 +24,7 @@ end

@testset "gc" begin

gc_enable(false)
GC.enable(false)
fn = tempname()
for i = 1:10
file = h5open(fn, "w")
Expand Down Expand Up @@ -62,7 +63,7 @@ for i = 1:10
@gcvalid dt ds d g a
close(file)
end
gc_enable(true)
GC.enable(true)
rm(fn)

end # testset gc
2 changes: 1 addition & 1 deletion test/plain.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using HDF5
using Base.Test
using Compat
using Compat.Test

@testset "plain" begin

Expand Down
3 changes: 2 additions & 1 deletion test/readremote.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using HDF5
using Base.Test
using Compat.Test
using Compat.LinearAlgebra: norm

@testset "readremote" begin

Expand Down
4 changes: 3 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using HDF5
using Base.Test
using Compat.Test
using Compat.Distributed
using Compat.SharedArrays

include("plain.jl")
include("readremote.jl")
Expand Down
2 changes: 1 addition & 1 deletion test/swmr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if nprocs() == 1
addprocs(1)
end
@everywhere using HDF5
using Base.Test
using Compat.Test

@testset "swmr" begin
fname = tempname()
Expand Down