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

Add support/tests for exposing functions with tuples #860

Merged
merged 1 commit into from
Sep 29, 2023

Conversation

andrjohns
Copy link
Collaborator

Submission Checklist

  • Run unit tests
  • Declare copyright holder and agree to license (see below)

Summary

Reported in #859, Rcpp doesn't support converting std::tuple<> types to/from R. This PR adds the specialisations necessary for Rcpp, as well as tests for exposing tuple functions.

Copyright and Licensing

Please list the copyright holder for the work you are submitting
(this will be you or your assignee, such as a university or company):
Andrew Johnson

By submitting this pull request, the copyright holder is agreeing to
license the submitted work under the following licenses:

@codecov-commenter
Copy link

Codecov Report

Merging #860 (6dd285f) into master (77a1443) will increase coverage by 0.01%.
The diff coverage is 100.00%.

❗ Current head 6dd285f differs from pull request most recent head 973e5ba. Consider uploading reports for the commit 973e5ba to get more accurate results

@@            Coverage Diff             @@
##           master     #860      +/-   ##
==========================================
+ Coverage   86.62%   86.63%   +0.01%     
==========================================
  Files          12       12              
  Lines        4365     4369       +4     
==========================================
+ Hits         3781     3785       +4     
  Misses        584      584              
Files Coverage Δ
R/utils.R 70.44% <100.00%> (+0.22%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more


/**
* The Rcpp::wrap class is used to convert a C++ type to an R object type.
* Rather than implement anything bespoke for tuples we simply return an R list.
Copy link
Member

Choose a reason for hiding this comment

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

Awesome!

Copy link
Member

Choose a reason for hiding this comment

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

Awesome!

Indeed!

Copy link
Member

@rok-cesnovar rok-cesnovar left a comment

Choose a reason for hiding this comment

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

🚀

@jgabry
Copy link
Member

jgabry commented Sep 29, 2023

Thanks @andrjohns! everything passing so I'll go ahead and merge.

@jgabry jgabry merged commit a2af167 into master Sep 29, 2023
12 checks passed
@jgabry jgabry deleted the expose-tuple-support branch September 29, 2023 18:56
@jgabry jgabry linked an issue Sep 29, 2023 that may be closed by this pull request
@andrjohns
Copy link
Collaborator Author

Thanks both! I'll have a look into upstreaming this into Rcpp-proper

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.

[Stan 2.33] Expose functions with tuple return type or argument type
4 participants