Skip to content

Commit

Permalink
fixes a bug on brute force indexes in push_item and append_items
Browse files Browse the repository at this point in the history
  • Loading branch information
sadit committed Feb 20, 2024
1 parent e1bc5e2 commit 47f2fa1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SimilaritySearch"
uuid = "053f045d-5466-53fd-b400-a066f88fe02a"
authors = ["Eric S. Tellez <donsadit@gmail.com>"]
version = "0.11.1"
version = "0.11.2"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
12 changes: 6 additions & 6 deletions src/parallel-exhaustive.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,19 @@ end

function push_item!(ex::ParallelExhaustiveSearch, context::GenericContext, u)
push_item!(ex.db, u)
context.logger !== nothing && LOG(context.logger, push_item!, index, length(seq))
context.logger !== nothing && LOG(context.logger, push_item!, ex, length(ex))
ex
end

function append_items!(ex::ParallelExhaustiveSearch, context::GenericContext, u::AbstractDatabase)
sp = length(seq)
sp = length(ex)
push_item!(ex.db, u)
ep = length(seq)
context.logger !== nothing && LOG(context.logger, append_items!, index, sp, ep, ep)
ep = length(ex)
context.logger !== nothing && LOG(context.logger, append_items!, ex, sp, ep, ep)
ex
end

function index!(seq::ParallelExhaustiveSearch, ctx::AbstractContext)
function index!(ex::ParallelExhaustiveSearch, ctx::AbstractContext)
# do nothing
seq
ex
end
4 changes: 2 additions & 2 deletions src/sequential-exhaustive.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ Base.copy(seq::ExhaustiveSearch; dist=seq.dist, db=seq.db) = ExhaustiveSearch(di

function push_item!(seq::ExhaustiveSearch, context::GenericContext, u)
push_item!(seq.db, u)
context.logger !== nothing && LOG(context.logger, push_item!, index, length(seq))
context.logger !== nothing && LOG(context.logger, push_item!, seq, length(seq))
seq
end

function append_items!(seq::ExhaustiveSearch, context::GenericContext, u::AbstractDatabase)
sp = length(seq)
append_items!(seq.db, u)
ep = length(seq)
context.logger !== nothing && LOG(context.logger, append_items!, index, sp, ep, ep)
context.logger !== nothing && LOG(context.logger, append_items!, seq, sp, ep, ep)
seq
end

Expand Down

2 comments on commit 47f2fa1

@sadit
Copy link
Owner Author

@sadit sadit commented on 47f2fa1 Feb 20, 2024

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/101311

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.11.2 -m "<description of version>" 47f2fa1b27b3e1bdfc4d16163d6917a453ee4bd9
git push origin v0.11.2

Please sign in to comment.