JoeyV55 / PartialSetModelSelection

Implementation of an optimal model selection function using input from a partial set of segmentation models.
0 stars 0 forks source link

R package interface #6

Closed tdhock closed 3 years ago

tdhock commented 4 years ago

I would suggest creating the interface using Rcpp modules, please read this https://cloud.r-project.org/web/packages/Rcpp/vignettes/Rcpp-modules.pdf to see how to do that

JoeyV55 commented 4 years ago

Ok great, so I can write unit tests with Rcpp and not have to use gtest? I will read this today.

JoeyV55 commented 4 years ago

Its unfortunate because I do like gtest, but it has been so difficult to integrate it with other technologies that it is simply not worth it imo.

tdhock commented 4 years ago

no you can't write unit tests with Rcpp. You can write an R interface for your C++ code using Rcpp. Then you can write R code that calls your insert/minimize/etc methods. And I would suggest writing tests in R code using https://r-pkgs.org/tests.html

On Mon, Jun 8, 2020 at 3:01 PM Joseph Vargovich notifications@github.com wrote:

Ok great, so I can write unit tests with Rcpp and not have to use gtest? I will read this today.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/DovahCraft/PartialSetModelSelection/issues/6#issuecomment-640904210, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHDX4WN4GRETM3K6HRIEA3RVVLYHANCNFSM4NYZL42Q .

JoeyV55 commented 4 years ago

Great thanks for the info on that.

tdhock commented 4 years ago

Also would be good for you to read some other parts of that book, starting from the beginning, to learn more about how to write your own R package.

JoeyV55 commented 4 years ago

Do you think it would be ok if I continued to implement the C++ code with the test suite I have with gtest and then port it over to R unit tests and set up CI at that time too?

Gtest is working well for my development of the core data structure itself, so I wanted to see if I could get that done first. (or at least most of it..)

tdhock commented 4 years ago

yes that is fine you can work on both in parallel if you want

JoeyV55 commented 4 years ago

Great will do, thanks for the help!

JoeyV55 commented 4 years ago

@tdhock Have you ever used Circle CI? I was going to look into it and see if it is easy to use with gtest than Travis CI.

tdhock commented 4 years ago

no I have only experience with appveyor, wercker and travis. but please try circle ci if you think it may work. google is your friend. (others must have already got google test working on these platforms)