-
Notifications
You must be signed in to change notification settings - Fork 58
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
R-package #208
R-package #208
Changes from all commits
dc0467d
177c9ec
2e7a335
7848cb7
7904f2e
561e9e7
ac9132b
f4fc73d
fb293ac
ee359ab
bb0fefb
4a11583
dea3ead
423fa5e
0f67f49
4654f93
b13150a
a781553
b153174
6c53fec
edea4ed
a2a3798
430df8d
25e5986
374e9bf
34336fd
4ca872e
4470326
f8d8ab5
4c9e9ff
bd9b118
846c747
53112f4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
mkdir -p $R_LIB_PATH | ||
cd $TRAVIS_BUILD_DIR/R-package | ||
echo "R_LIBS=$R_LIB_PATH" > .Renviron | ||
echo 'options(repos = "https://cran.rstudio.com")' > .Rprofile | ||
|
||
export PATH="$R_LIB_PATH/R/bin:$PATH" | ||
|
||
sudo apt-get install gfortran-5 | ||
sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-5 10 | ||
# use system-wide libraries (fix error "symbol _ZTINSt8ios_base7failureB5cxx11E, version GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference") | ||
conda remove --force libgfortran-ng libgcc-ng libstdcxx-ng | ||
|
||
# install packages to build and check documentation | ||
conda install --no-deps pandoc | ||
sudo apt-get install texlive-latex-recommended texlive-fonts-recommended texlive-fonts-extra qpdf | ||
|
||
# fix "libcurl error code 60: server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none" | ||
echo -n | openssl s_client -connect arxiv.org:443 2>/dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-certificates.crt | ||
|
||
if ! command -v R &> /dev/null; then | ||
R_VER=3.5.1 | ||
cd $TRAVIS_BUILD_DIR | ||
wget https://cran.r-project.org/src/base/R-3/R-$R_VER.tar.gz | ||
tar -xzf R-$R_VER.tar.gz | ||
R-$R_VER/configure --enable-R-shlib --prefix=$R_LIB_PATH/R | ||
make | ||
make install | ||
cd $TRAVIS_BUILD_DIR/R-package | ||
fi | ||
|
||
Rscript -e 'if(!"devtools" %in% rownames(installed.packages())) { install.packages("devtools", dependencies = TRUE) }' | ||
Rscript -e 'if(!"roxygen2" %in% rownames(installed.packages())) { install.packages("roxygen2", dependencies = TRUE) }' | ||
Rscript -e 'if(!"testthat" %in% rownames(installed.packages())) { install.packages("testthat", dependencies = TRUE) }' | ||
Rscript -e 'if(!"knitr" %in% rownames(installed.packages())) { install.packages("knitr", dependencies = TRUE) }' | ||
Rscript -e 'if(!"covr" %in% rownames(installed.packages())) { install.packages("covr", dependencies = TRUE) }' | ||
Rscript -e 'if(!"rmarkdown" %in% rownames(installed.packages())) { install.packages("rmarkdown", dependencies = TRUE) }' | ||
Rscript -e 'if(!"reticulate" %in% rownames(installed.packages())) { install.packages("reticulate", dependencies = TRUE) }' | ||
Rscript -e 'if(!"R6" %in% rownames(installed.packages())) { install.packages("R6", dependencies = TRUE) }' | ||
Rscript -e 'if(!"Matrix" %in% rownames(installed.packages())) { install.packages("Matrix", dependencies = TRUE) }' | ||
|
||
Rscript -e 'update.packages(ask = FALSE, instlib = Sys.getenv("R_LIB_PATH"))' | ||
|
||
Rscript -e 'devtools::install_deps(pkg = ".", dependencies = TRUE)' | ||
|
||
R CMD build . || exit -1 | ||
|
||
PKG_FILE_NAME=$(ls -1t *.tar.gz | head -n 1) | ||
PKG_NAME="${PKG_FILE_NAME%%_*}" | ||
LOG_FILE_NAME="$PKG_NAME.Rcheck/00check.log" | ||
|
||
R CMD check "${PKG_FILE_NAME}" --as-cran || exit -1 | ||
if grep -q -R "WARNING" "$LOG_FILE_NAME"; then | ||
echo "WARNINGS have been found in the build log!" | ||
exit -1 | ||
#elif grep -q -R "NOTE" "$LOG_FILE_NAME"; then | ||
# echo "NOTES have been found in the build log!" | ||
# exit -1 | ||
fi | ||
|
||
Rscript -e 'covr::codecov(quiet = FALSE)' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line can be related to codecov behavior. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line has been here since the first commit in the PR. Before today it silently printed information to the Travis log and updated the badge, but today decided to come here in comments and post the report. PS. it seems that registration at codecov.io isn't required and done automatically after using the package. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I want to rollback to the previous behavior: report is printed to the Travis log and badge updates without these useless and annoying comments. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've found the way to easily disable comments, but this PR should be merged first. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
^\.R\.travis\.sh$ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.Rproj.user | ||
.Rhistory | ||
.RData | ||
.Ruserdata |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Package: RGF | ||
Type: Package | ||
Title: Regularized Greedy Forest | ||
Version: 1.0.5 | ||
Date: 2018-08-15 | ||
Authors@R: c( person("Lampros", "Mouselimis", email = "mouselimislampros@gmail.com", role = c("aut", "cre")), person("Ryosuke", "Fukatani", role = "cph", comment = "Author of the python wrapper of the 'Regularized Greedy Forest' machine learning algorithm"), person("Nikita", "Titov", role = "cph", comment = "Author of the python wrapper of the 'Regularized Greedy Forest' machine learning algorithm"), person("Tong", "Zhang", role = "cph", comment = "Author of the 'Regularized Greedy Forest' and of the Multi-core implementation of Regularized Greedy Forest machine learning algorithm"), person("Rie", "Johnson", role = "cph", comment = "Author of the 'Regularized Greedy Forest' machine learning algorithm") ) | ||
Maintainer: Lampros Mouselimis <mouselimislampros@gmail.com> | ||
BugReports: https://github.com/RGF-team/rgf/issues | ||
URL: https://github.com/RGF-team/rgf/tree/master/R-package | ||
Description: Regularized Greedy Forest wrapper of the 'Regularized Greedy Forest' <https://github.com/RGF-team/rgf/tree/master/python-package> 'python' package, which also includes a Multi-core implementation (FastRGF) <https://github.com/RGF-team/rgf/tree/master/FastRGF>. | ||
License: MIT + file LICENSE | ||
SystemRequirements: Python (2.7 or >= 3.4), rgf_python, scikit-learn (>= 0.18.0), scipy, numpy. Detailed installation instructions for each operating system can be found in the README file. | ||
Depends: | ||
R(>= 3.2.3) | ||
Imports: | ||
reticulate, R6, Matrix | ||
Suggests: | ||
testthat, | ||
covr, | ||
knitr, | ||
rmarkdown | ||
Encoding: UTF-8 | ||
LazyData: true | ||
RoxygenNote: 6.0.1 | ||
VignetteBuilder: knitr |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
YEAR: 2018 | ||
COPYRIGHT HOLDER: Mouselimis Lampros <mouselimislampros@gmail.com> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the license of the RGF R wrapper? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The license is MIT. This appears in the DESCRIPTION file (License: MIT + file LICENSE) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, then please put the text of the MIT license here, because after opening There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm sorry but I can't do that. CRAN requires from R package maintainers to only mention the YEAR and the COPYRIGHT HOLDER. If I'll add the MIT text inside the LICENSE file then the package will not pass the tests and the package will not be accepted on CRAN. This is actually the reason that the DESCRIPTION file includes License: MIT + file LICENSE There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you sure in this? Seems that it's allowed to add test of a license. Please take a look: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is an Apache license. I'm not familiar with this schema. However in case of the MIT license the approved schema is the following : ... This is a template. Complete and ship as file LICENSE the following 2 lines (only) ... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
# Regularized Greedy Forest (RGF) | ||
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
|
||
See file COPYING: https://github.com/RGF-team/rgf/blob/master/RGF/COPYING | ||
|
||
|
||
|
||
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
# Fast Regularized Greedy Forest (FastRGF) | ||
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
|
||
See file LICENSE: https://github.com/RGF-team/rgf/blob/master/FastRGF/LICENSE | ||
|
||
|
||
|
||
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
# Python wrapper of RGF and FastRGF | ||
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
|
||
See file LICENSE: https://github.com/RGF-team/rgf/blob/master/python-package/LICENSE |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export(RGF_cleanup_temp_files) | ||
export(mat_2scipy_sparse) | ||
export(TO_scipy_sparse) | ||
export(RGF_Regressor) | ||
export(RGF_Classifier) | ||
export(FastRGF_Regressor) | ||
export(FastRGF_Classifier) | ||
import(reticulate) | ||
importFrom(R6,R6Class) | ||
importFrom(Matrix,Matrix) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
## RGF 1.0.5 | ||
|
||
The RGF R package was integrated in the home repository for the Regularized Greedy Forest (RGF) library (https://github.com/RGF-team). | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove 2 blank lines at the top of the file. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed and pushed changes. |
||
## RGF 1.0.4 | ||
|
||
* We modified the license from GPL-3 to MIT to go in accordance with the new structure of the *rgf_python* package. The package includes two files : *LICENSE* (for the RGF R package) and *LICENSE.note* (for the *RGF*, *FastRGF* and *rgf_python* packages). | ||
* We added the following new features of RGF estimators : *feature_importances_* and *dump_model()* | ||
* We modified the README.md file and especially the installation instructions for all operating systems (Linux, Mac OS X, Windows) | ||
* We created an R6 class (*Internal_class*) for all secondary functions which are used in RGF and FastRGF | ||
|
||
|
||
## RGF 1.0.3 | ||
|
||
* The *dgCMatrix_2scipy_sparse* function was renamed to *TO_scipy_sparse* and now accepts either a *dgCMatrix* or a *dgRMatrix* as input. The appropriate format for the RGF package in case of sparse matrices is the *dgCMatrix* format (*scipy.sparse.csc_matrix*) | ||
* We added an onload.R file to inform the users about the previous change | ||
* Due to the previous changes we modified the Vignette and the tests too | ||
|
||
|
||
## RGF 1.0.2 | ||
|
||
We commented the example(s) and test(s) related to the *dgCMatrix_2scipy_sparse* function [ *if (Sys.info()["sysname"] != 'Darwin')* ], because the *scipy-sparse* library on CRAN is not upgraded and the older version includes a bug (*TypeError : could not interpret data type*). This leads to an error on *Mac OS X* ( *reference* : https://github.com/scipy/scipy/issues/5353 ). | ||
|
||
|
||
## RGF 1.0.1 | ||
|
||
We added links to the GitHub repository (master repository, issues). | ||
|
||
|
||
## RGF 1.0.0 | ||
|
||
Initial version. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#------------------------- | ||
# Load the python-modules | ||
#------------------------- | ||
|
||
|
||
RGF_mod <- NULL; RGF_utils <- NULL; SCP <- NULL; | ||
|
||
|
||
.onLoad <- function(libname, pkgname) { | ||
|
||
if (reticulate::py_available(initialize = TRUE)) { | ||
|
||
if (reticulate::py_module_available("rgf.sklearn")) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will this function raise understandable error about the need of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you don't mind I would rather keep this file intact. Otherwise it might lead to problems when I have to check-test the package on CRAN There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got it! |
||
|
||
RGF_mod <<- reticulate::import("rgf.sklearn", delay_load = TRUE) | ||
} | ||
|
||
if (reticulate::py_module_available("rgf.utils")) { | ||
|
||
RGF_utils <<- reticulate::import("rgf.utils", delay_load = TRUE) | ||
} | ||
|
||
if (reticulate::py_module_available("scipy")) { | ||
|
||
SCP <<- reticulate::import("scipy", delay_load = TRUE, convert = FALSE) | ||
} | ||
} | ||
} |
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.
If unnecessary, l.55-l.57 should be deleted.
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.
I guess @StrikerRUS should decide if this code chunk should be removed
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.
These lines will be uncommented right after the merging this PR. The reason is that at present there is no
rgf/R-package
directory and CRAN check produces a NOTE for this.