Skip to content

Commit

Permalink
grouped conda install calls and fixed a few integer array things
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb committed Nov 16, 2019
1 parent 2b68d2f commit b49da89
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 14 deletions.
13 changes: 5 additions & 8 deletions .ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,15 @@ fi
if [[ $TRAVIS == "true" ]] && [[ $TASK == "lint" ]]; then
conda install -q -y -n $CONDA_ENV \
pycodestyle \
pydocstyle
pydocstyle \
r-stringi # stringi needs to be installed separate from r-lintr to avoid issues like 'unable to load shared object stringi.so'
conda install -q -y -n $CONDA_ENV \
-c conda-forge \
r-lintr>=2.0
pip install --user cpplint
echo "Linting Python code"
pycodestyle --ignore=E501,W503 --exclude=./compute,./.nuget . || exit -1
pydocstyle --convention=numpy --add-ignore=D105 --match-dir="^(?!^compute|test|example).*" --match="(?!^test_|setup).*\.py" . || exit -1
# stringi needs to be installed separate from r-lintr
# to avoid issues like 'unable to load shared object stringi.so'
conda install -y -n $CONDA_ENV \
r-stringi
conda install -y -n $CONDA_ENV \
-c conda-forge \
r-lintr>=2.0
echo "Linting R code"
Rscript ${BUILD_DIRECTORY}/.ci/lint_r_code.R ${BUILD_DIRECTORY} || exit -1
echo "Linting C++ code"
Expand Down
2 changes: 1 addition & 1 deletion R-package/R/lgb.Dataset.R
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ dimnames.lgb.Dataset <- function(x) {
#' train <- agaricus.train
#' dtrain <- lgb.Dataset(train$data, label = train$label)
#'
#' dsub <- lightgbm::slice(dtrain, 1L:42L)
#' dsub <- lightgbm::slice(dtrain, seq_len(42L))
#' lgb.Dataset.construct(dsub)
#' labels <- lightgbm::getinfo(dsub, "label")
#'
Expand Down
6 changes: 3 additions & 3 deletions R-package/demo/leaf_stability.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ new_data$binned <- .bincode(
x = new_data$X
, breaks = quantile(
x = new_data$X
, probs = (1L:9L) / 10.0
, probs = seq_len(9L) / 10.0
)
, right = TRUE
, include.lowest = TRUE
Expand Down Expand Up @@ -120,7 +120,7 @@ new_data2$binned <- .bincode(
x = new_data2$X
, breaks = quantile(
x = new_data2$X
, probs = (1L:9L) / 10.0
, probs = seq_len(9L) / 10.0
)
, right = TRUE
, include.lowest = TRUE
Expand Down Expand Up @@ -189,7 +189,7 @@ new_data3$binned <- .bincode(
x = new_data3$X
, breaks = quantile(
x = new_data3$X
, probs = (1L:9L) / 10.0
, probs = seq_len(9L) / 10.0
)
, right = TRUE
, include.lowest = TRUE
Expand Down
2 changes: 1 addition & 1 deletion R-package/man/slice.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/tests/testthat/test_dataset.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ test_that("lgb.Dataset: slice, dim", {
dtest <- lgb.Dataset(test_data, label = test_label)
lgb.Dataset.construct(dtest)
expect_equal(dim(dtest), dim(test_data))
dsub1 <- slice(dtest, 1L:42L)
dsub1 <- slice(dtest, seq_len(42L))
lgb.Dataset.construct(dsub1)
expect_equal(nrow(dsub1), 42L)
expect_equal(ncol(dsub1), ncol(test_data))
Expand Down

0 comments on commit b49da89

Please sign in to comment.