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

fix: distance_range calculation #626

Closed
wants to merge 3 commits into from

Conversation

maqi
Copy link
Member

@maqi maqi commented Aug 9, 2023

Description

Summary generated by Reviewpad on 09 Aug 23 11:24 UTC

This pull request makes a minor correction to the .github/workflows/merge.yml file. It changes the name of a test from "execute the dbc spend test" to "execute the dbc spend tests".

@reviewpad reviewpad bot requested a review from joshuef August 9, 2023 11:25
@reviewpad reviewpad bot added Small Pull request is small waiting-for-review labels Aug 9, 2023
@maqi maqi changed the title chore: minor correction fix: distance_range calculation Aug 9, 2023
@@ -57,10 +57,12 @@ impl Node {
}

// set the distance range used for pruning
let distance_range = match our_close_group.get(CLOSE_GROUP_SIZE) {
// our_close_group now only have CLOSE_GROUP_SIZE entries,
// which makes `our_close_group.get(CLOSE_GROUP_SIZE)` return None always.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure I follow why this is always None?

Copy link
Member Author

Choose a reason for hiding this comment

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

our_close_group now only contains 8th entries,
but .get(CLOSE_GROUP_SIZE) is asking for the entry with index 8.
As the vec's indexing is from 0, hence it's actually looking from 9th entry, which is None

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, i'd perhaps remove this line // which makes `our_close_group.get(CLOSE_GROUP_SIZE)` return None always. as it's a bit confusing (as we dont do it?)

We can just not perhaps // our_close_group now only have CLOSE_GROUP_SIZE entries, so we grab the last entry

maybe last and farthest if they are sorted?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, that comment is mainly explain what's the issue of previous, i.e. our_close_group.get(CLOSE_GROUP_SIZE) .
Not about the current approach (using last()).

@joshuef
Copy link
Contributor

joshuef commented Aug 11, 2023

already in main

@joshuef joshuef closed this Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Small Pull request is small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants