fhs / NPZ.jl

A Julia package that provides support for reading and writing Numpy .npy and .npz files
Other
117 stars 16 forks source link

function barrier in npzreadarray and introduce readheader #44

Closed jishnub closed 3 years ago

jishnub commented 3 years ago

This PR does two things:

On master:

julia> npzwrite("abc.npy", ones(3,4));

julia> @btime npzread("abc.npy");
  23.639 μs (91 allocations: 5.80 KiB)

After this PR:

julia> @btime npzread("abc.npy");
  20.911 μs (80 allocations: 5.28 KiB)

The difference in run-time is marginal.

julia> npzwrite("abc.npy", ones(3,4));

julia> NPZ.readheader("abc.npy")
NPZ.Header{Float64,2,typeof(ltoh)}(ltoh, true, (3, 4))

julia> NPZ.readheader("abc.npy") |> size
(3, 4)

julia> NPZ.readheader("abc.npy") |> eltype
Float64
codecov-io commented 3 years ago

Codecov Report

Merging #44 (37374e4) into master (9a66947) will increase coverage by 0.85%. The diff coverage is 92.10%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #44      +/-   ##
==========================================
+ Coverage   85.29%   86.15%   +0.85%     
==========================================
  Files           1        1              
  Lines         170      195      +25     
==========================================
+ Hits          145      168      +23     
- Misses         25       27       +2     
Impacted Files Coverage Δ
src/NPZ.jl 86.15% <92.10%> (+0.85%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 9a66947...37374e4. Read the comment docs.

jishnub commented 3 years ago

Thank you for your package! Could you tag a new version by commenting @JuliaRegistrator register on the merged commit?

JuliaRegistrator commented 3 years ago

Error while trying to register: Register Failed @jishnub, it looks like you don't have collaborator status on this repository.

fhs commented 3 years ago

Thank you for your package! Could you tag a new version by commenting @JuliaRegistrator register on the merged commit?

Ok, commented

JuliaRegistrator commented 3 years ago

Comments on pull requests will not trigger Registrator, as it is disabled. Please try commenting on a commit or issue.