Skip to content

Make weighted_median iterative#604

Closed
keithtensor wants to merge 1 commit intomainfrom
end-recursion
Closed

Make weighted_median iterative#604
keithtensor wants to merge 1 commit intomainfrom
end-recursion

Conversation

@keithtensor
Copy link
Contributor

@keithtensor keithtensor commented Jul 1, 2024

Devnet companion: #628

This PR removes the recursive algorithm in weighted_median and replaces it with a iterative one.

Copy link
Contributor

@gztensor gztensor left a comment

Choose a reason for hiding this comment

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

Existing unit tests cause a lot of recursion on both branches of if statement in the older version. I am confident this fix doesn't break it.

Copy link
Contributor

@sam0x17 sam0x17 left a comment

Choose a reason for hiding this comment

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

looks good to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants