BreakoutDetection icon indicating copy to clipboard operation
BreakoutDetection copied to clipboard

Added support for Python. Removed dependencies on Rcpp in C++ code.

Open roland-hochmuth opened this issue 10 years ago • 15 comments

Removed dependencies on Rcpp from the C++ files that aren't required for R. Created a file RcppWrappers.cpp that declares the Rcpp wrappers. Added some CMakeLists files to build directly from the C++ source as a stand-alone shared library. Added support for Python.

roland-hochmuth avatar Jan 22 '15 21:01 roland-hochmuth

@roland-hochmuth The Travis CI build failed. Please submit a new PR after fixes.

akejariwal avatar Jan 23 '15 01:01 akejariwal

That's embarrassing. I'll get this resolved as soon as I understand what exactly went wrong. Have to learn a little more about Travis CI. Hopefully, will get resolved soon.

roland-hochmuth avatar Jan 23 '15 01:01 roland-hochmuth

@roland-hochmuth Click on 'Details' to see what went wrong with the CI build.

cc @putnam120

akejariwal avatar Jan 29 '15 18:01 akejariwal

Thanks Arun, I know what is going wrong, but unfortunately, I haven't figured out how to resolve it. In experience with Rcpp and a busy week. Hopefully, I'll get back to this over the weekend. If this pull request sitting around becomes a problem I could abandon it. I'll eventually figure it out and issue a new one.

roland-hochmuth avatar Jan 29 '15 20:01 roland-hochmuth

@roland-hochmuth No rush. Things will not break as I have not merged it. Once you have an update @putnam120 will review your patch.

akejariwal avatar Jan 29 '15 21:01 akejariwal

+1 for the Python support! Is this a dead branch though?

klynch avatar Jul 07 '15 02:07 klynch

Hi Kevin, Sorry, I started to get this done over the holidays and then ran into problems with my understanding of Rcpp. The Python bindings works, but the R bindings don't. I had tested in R, but it turned out I wasn't really testing my code, but instead was testing the already installed code. Thankfully, your automated tests caught this. I'm not sure when I'll get back to this. I think I need another holiday to complete it. If you want to remove the branch to clean things up, that would be OK with me. I'm still looking at integrating this into Monasca.

Regards --Roland

roland-hochmuth avatar Jul 07 '15 03:07 roland-hochmuth

+1 for Python support

shbharath avatar Jul 08 '16 02:07 shbharath

@bhemashekar rolands fork has Python support and worked out of the box for me. I ported the R-wrapper to Python to have the interface described in the R help file.

I will send a pull request end of August but could share work in progress via email (it's for a university project, and they don't give credit for code published before hand in date).

PatrickSchiffmann avatar Jul 08 '16 06:07 PatrickSchiffmann

@PatrickSchiffmann Kindly share it with sh(dot)bharath(at)gmail(dot)com

shbharath avatar Jul 12 '16 23:07 shbharath

@bhemashekar it is here https://github.com/roland-hochmuth/BreakoutDetection

jkleckner avatar Jul 13 '16 02:07 jkleckner

The PR appears to cause an error with R installation:

RcppWrappers.cpp:13:40: error: cannot initialize a variable of type 'Rcpp::NumericVector::iterator' (aka 'double ') with an rvalue of type 'const_iterator' (aka 'const double ')
    for (Rcpp::NumericVector::iterator it = Z.begin(); it != Z.end(); ++it) {
                                       ^    ~~~~~~~~~
1 error generated.
make: *** [RcppWrappers.o] Error 1
ERROR: compilation failed for package 'BreakoutDetection'

Which builds with the line altered as follows:

-    for (Rcpp::NumericVector::iterator it = Z.begin(); it != Z.end(); ++it) {
+    for (Rcpp::NumericVector::const_iterator it = Z.begin(); it != Z.end(); ++it) {

kmatt avatar Jun 07 '17 18:06 kmatt

Hi Roland, +1 for python support. However for some reason the min_size/beta/Degree arguments don't work and this is the error i get: TypeError: evaluate() got an unexpected keyword argument 'min_size'

Anand191 avatar Aug 14 '17 13:08 Anand191

Hi Roland, I figured it out!! evaluate in EdmMulti has been defined with *args, and therefore should only accepts values of the arguments min_size/beta/Degree. In order to provide named arguments viz. min_size=64 we need to define EdmMulti with **kwargs

Anand191 avatar Aug 14 '17 13:08 Anand191

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Roland Hochmuth seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Jul 18 '19 15:07 CLAassistant