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

fix some errors in R-package after upgrade to 1.0.7 #342

Merged
merged 7 commits into from
Mar 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .ci/r_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ if [[ $OS_NAME == "macos-latest" ]]; then
echo 'options(pkgType = "mac.binary")' > .Rprofile
echo 'options(install.packages.check.source = "no")' >> .Rprofile
else
tlmgr --verify-repo=none --self --all update
tlmgr --verify-repo=none update --self
tlmgr --verify-repo=none install ec

echo "Sys.setenv(RETICULATE_PYTHON = '$CONDA_PREFIX/bin/python')" >> .Rprofile
fi

R_LIB_PATH=$HOME/R
Expand Down
2 changes: 1 addition & 1 deletion R-package/DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ Suggests:
rmarkdown
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.1.1
RoxygenNote: 7.0.2
VignetteBuilder: knitr
6 changes: 3 additions & 3 deletions R-package/R/FastRGF_Classifier.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
#' min_child_weight = 5.0, data_l2 = 2.0,
#' sparse_max_features = 80000,
#' sparse_min_occurences = 5,
#' calc_prob="sigmoid", n_jobs = 1,
#' calc_prob = "sigmoid", n_jobs = 1,
#' verbose = 0)}}{}
#'
#' \item{\code{--------------}}{}
Expand Down Expand Up @@ -89,7 +89,7 @@
#' # min_child_weight = 5.0, data_l2 = 2.0,
#' # sparse_max_features = 80000,
#' # sparse_min_occurences = 5,
#' # calc_prob="sigmoid", n_jobs = 1,
#' # calc_prob = "sigmoid", n_jobs = 1,
#' # verbose = 0)
#' @examples
#'
Expand All @@ -111,7 +111,7 @@
#' preds = fast_RGF_class$predict_proba(x)
#' }
#' }
#' }, silent=TRUE)
#' }, silent = TRUE)

FastRGF_Classifier <- R6::R6Class(
"FastRGF_Classifier",
Expand Down
2 changes: 1 addition & 1 deletion R-package/R/FastRGF_Regressor.R
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
#' preds = fast_RGF_regr$predict(x)
#' }
#' }
#' }, silent=TRUE)
#' }, silent = TRUE)

FastRGF_Regressor <- R6::R6Class(
"FastRGF_Regressor",
Expand Down
2 changes: 1 addition & 1 deletion R-package/R/RGF_Classifier.R
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
#' preds = RGF_class$predict_proba(x)
#' }
#' }
#' }, silent=TRUE)
#' }, silent = TRUE)

RGF_Classifier <- R6::R6Class(
"RGF_Classifier",
Expand Down
2 changes: 1 addition & 1 deletion R-package/R/RGF_Regressor.R
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
#' preds = RGF_regr$predict(x)
#' }
#' }
#' }, silent=TRUE)
#' }, silent = TRUE)

RGF_Regressor <- R6::R6Class(
"RGF_Regressor",
Expand Down
2 changes: 1 addition & 1 deletion R-package/R/TO_scipy_sparse.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
#' }
#' }
#' }
#' }, silent=TRUE)
#' }, silent = TRUE)

TO_scipy_sparse = function(R_sparse_matrix) {

Expand Down
2 changes: 1 addition & 1 deletion R-package/R/mat_2scipy_sparse.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#' print(res$shape)
#' }
#' }
#' }, silent=TRUE)
#' }, silent = TRUE)

mat_2scipy_sparse = function(x, format = 'sparse_row_matrix') {

Expand Down
8 changes: 4 additions & 4 deletions R-package/R/package.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ RGF_mod <- NULL; RGF_utils <- NULL; SCP <- NULL;

try({ # I added the try() functions in version 1.0.7 because I received a similar warning as mentioned in: [ https://github.com/rstudio/reticulate/issues/730#issuecomment-594365528 ] and [ https://github.com/rstudio/reticulate/issues/814 ]
RGF_mod <<- reticulate::import("rgf.sklearn", delay_load = TRUE)
}, silent=TRUE)
}, silent = TRUE)

try({
RGF_utils <<- reticulate::import("rgf.utils", delay_load = TRUE)
}, silent=TRUE)
}, silent = TRUE)

try({
SCP <<- reticulate::import("scipy", delay_load = TRUE, convert = FALSE)
}, silent=TRUE)
}, silent = TRUE)

# #................................................................................. keep this as a reference, however it gives a warning on CRAN because it tries to initialize python
# try({
Expand All @@ -59,6 +59,6 @@ RGF_mod <- NULL; RGF_utils <- NULL; SCP <- NULL;
# # else {
# # packageStartupMessage("The 'scipy' package is not available!")
# # }
# }, silent=TRUE)
# }, silent = TRUE)
# #.................................................................................
}
8 changes: 3 additions & 5 deletions R-package/man/FastRGF_Classifier.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions R-package/man/FastRGF_Regressor.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 0 additions & 10 deletions R-package/man/Internal_class.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions R-package/man/RGF_Classifier.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions R-package/man/RGF_Regressor.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion R-package/man/TO_scipy_sparse.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion R-package/man/mat_2scipy_sparse.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions R-package/tests/testthat/setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ y_reg = runif(100)
#---------------------------------

set.seed(4)
y_BINclass = sample(1:2, 100, replace = T)
y_BINclass = sample(1:2, 100, replace = TRUE)


# response "multiclass" classification
#-------------------------------------

set.seed(5)
y_MULTIclass = sample(1:5, 100, replace = T)
y_MULTIclass = sample(1:5, 100, replace = TRUE)


# weights for the fit function
Expand Down