Skip to content

Commit

Permalink
Merge pull request #41 from banhbio/dev
Browse files Browse the repository at this point in the history
support multithreading
  • Loading branch information
banhbio committed Jan 30, 2023
2 parents 429e9a5 + bf08ae3 commit 99e04b3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Taxonomy"
uuid = "10bb16a4-4bfc-432e-9419-4ca69c1a753c"
authors = ["banhbio <ban@kuicr.kyoto-u.ac.jp>"]
version = "0.4.2"
version = "0.4.3"

[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
Expand Down
6 changes: 4 additions & 2 deletions src/database.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ struct DB
function DB(nodes_dmp::String, names_dmp::String)
@assert isfile(nodes_dmp)
@assert isfile(names_dmp)
_nodes = Threads.@spawn importnodes(nodes_dmp)
_names = Threads.@spawn importnames(names_dmp)

parents, ranks = importnodes(nodes_dmp)
names = importnames(names_dmp)
parents, ranks = fetch(_nodes)
names = fetch(_names)

db = new(nodes_dmp, names_dmp, Dict(parents), Dict(ranks), Dict(names))
current_db!(db)
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ else
@warn "Start test with existing database"
end

@testset "dabase.jl" begin
@testset "database.jl" begin
@test_throws ErrorException isnothing(current_db())

db = Taxonomy.DB("db/nodes.dmp", "db/names.dmp")
Expand Down

2 comments on commit 99e04b3

@banhbio
Copy link
Owner Author

Choose a reason for hiding this comment

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

@JuliaRegistrator register()

@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/76648

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.4.3 -m "<description of version>" 99e04b34d7327551f102b3a03575ac0a69181818
git push origin v0.4.3

Please sign in to comment.