-
Notifications
You must be signed in to change notification settings - Fork 9
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
Getting rid of R+Rcpp dependencies #20
Comments
I completely agree that it would be nice to remove the dependencies. However, the R interface helped me a lot when writing the pdf/hfunc/hinv for parametric families to benchmark against VineCopula and I think that it can still be useful in the development phase. I like the idea of using an R script that writes inputs and outputs into files, but there may be a "size" problem. Currently, we are running 5 tests (pdf/hfunc1-2/hinv1-2, not counting tau/loglik) for 4+3*4 families (4 rotationless and 3 with rotations), i.e. 80 tests, for a sample size of 10'000, which means that the output would be a relatively large file (~15MB on my computer)... So we would need to run the R script and clean-up the files after the test is run (i.e., we would still need the R dependencies). Furthermore, we would need still a way to let C++ pass arguments to the R script (at least as long as we're in the development phase). |
Is it really necessary to run the tests with a sample size of 10'000? If there's a bug in the code, it will probably also show up when n = 10. The only thing that such a large sample size adds is to (randomly) test the stability of the C++ implementaiton near the boundaries. But this could be done with a few deterministic points as well. As for passing arguments to R script. We could write a separate setup file which is loaded from both C++ and the R-script. |
Concerning the sample size: I agree that it may not be necessary for the tests of pdf/hfunc1-2/hinv1-2 and that ~100 carefully chosen points may be enough. In fact, I increased the sample size to 10'000 to properly test I also agree with the separate setup file. However, we would still depend on R or am I missing something? |
We would "depend" on R to create the "expected results" file. But my idea was to do that manually once, not re-creating it every time we build the project. So the C++ project and tests do not depend on R, just on this one file that we ship with the library. |
I'm OK with this solution, but I would still ship the R script and setup file with the library (so that one can check and/or modify if needed). |
Yes! |
What about creating three CMake projects within the vinecopulib repository:
People not interested in Python or tests would not need to be bothered with those at all. |
First, I think that creating something for the non-R-dependent tests is not very useful right now, since we'll remove the R dependencies altogether at some point (see my answer to the ASAN issue). Second, about the Python bindings: couldn't we include this as an option to the main CMake project that would be passed using e.g. |
Hmm, separating the R dependent tests from the lib + non-R-dependent tests doesn't sound too bad. That way, we don't have an R dependency for users, but still have the interface available for unit testing. This would make it a lot less urgent to remove the R dependency (if necessary at all), for which I won't have time in the next 2-3 weeks. |
Two advantages I can think of are:
... but certainly there are other more urgent things - this comment was rather an afterthought from the fights with Travis and Appveyor :) |
To summarize what we discussed in the last weeks:
|
So now we have another solution. Rcpp, RcppEigen, RInside dependencies are removed. So only R is required as dependency. This was addressed by 366a339 with some bug-fixes following (latest b3be63f). It's probably still a good idea to make a CMake flag, because R is not necessary for using the library. |
As discussed with Thomas, I added dealt with this issue using the standard CMake flag to avoid compiling unit tests (i.e., |
I wrote my unit tests in #18 and #19 by hardcoding input values and VineCopula output - mainly because I was to lazy to deal with the R interface (we will remove it at some point anyway).
It is a bit ugly, but there's little reason not to do it. The tests catch 99% of the errors the R interface would and can be used even with R interface removed. A cleaner version of this would be to write an R script that writes inputs and results into a file which is loaded from within the tests.
What do you think?
The text was updated successfully, but these errors were encountered: