-
Notifications
You must be signed in to change notification settings - Fork 0
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
✨ gains numeric sum_with_threads
#25
Conversation
…le numeric entries.
…tests in R pass.
I don't know where better to put this - I was curious about the difference between What surprised me was that compared to just doing
Maybe I implemented something wrong - I haven't played with multithreading in Rust before, so this is a great opportunity for me to learn. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One tiny NIT comment on style, but functionally looks great!
I tested this by:
- Reviewing the added unit test to ensure we are testing for the new behavious
- Syntactically reviewing the code
- Pulling and building locally, and testing out the functionality in a live R session
@jonocarroll I extracted your comment into this discussion post for posterity so that we don't lose track of it once this PR is merged 😊 I will respond there. |
Co-authored-by: Jackson Hoffart <jackson.hoffart@gmail.com>
Co-authored-by: Jackson Hoffart <jackson.hoffart@gmail.com>
This PR enhances the functionality of the
sum_with_threads
function to support both integer and double numeric types.Initially, the approach of handling both types via
NumericSexp
was considered, but this was not feasible due to the fact thatNumericSexp
does not implement theto_vec()
method, which is necessary for the operation. Following the compiler suggestions, the solution was to use a match expression withinsum_with_threads
to explicitly handle two distinct types of numeric data:IntegerSexp
for integers andRealSexp
for doubles. This enables the function to process both types separately via two implementation.