Skip to content

Commit

Permalink
Merge pull request #502 from willow-ahrens/wma/fix-500
Browse files Browse the repository at this point in the history
fix NPZ reader for local paths
  • Loading branch information
willow-ahrens authored Apr 22, 2024
2 parents 36ce64c + aae3450 commit 5d084b1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Finch"
uuid = "9177782c-1635-4eb9-9bfb-d9dfa25e6bce"
authors = ["Willow Ahrens"]
version = "0.6.21"
version = "0.6.22"

[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
Expand Down
2 changes: 1 addition & 1 deletion ext/NPZExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ isdefined(Base, :get_extension) ? (using NPZ) : (using ..NPZ)

function Base.getindex(g::NPYPath, key::AbstractString)
path = joinpath(g.dirname, key)
if isfile(key, "$path.npy")
if isfile("$path.npy")
npzread("$path.npy")
else
NPYPath(path)
Expand Down
12 changes: 12 additions & 0 deletions test/test_issues.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@ using SparseArrays
@testset "issues" begin
@info "Testing Github Issues"

#https://github.com/willow-ahrens/Finch.jl/issues/500
let
using NPZ
f = mktempdir(;prefix="finch-issue-500")
cd(f) do
A = Tensor(Dense(Element(0.0)), rand(4))
fwrite("test.bspnpy", A)
B = fread("test.bspnpy")
@test A == B
end
end

#https://github.com/willow-ahrens/Finch.jl/issues/358
let
A = Tensor(Dense(SparseList(Element(0))), [
Expand Down

2 comments on commit 5d084b1

@willow-ahrens
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/105386

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.6.22 -m "<description of version>" 5d084b1bf58b8b531318963c228f7328c40542bd
git push origin v0.6.22

Please sign in to comment.