Skip to content

Commit e8a68f2

Browse files
authored
[docs] use consistent naming for R-package and Python-package across the repo (#6655)
1 parent 718da7d commit e8a68f2

19 files changed

+55
-55
lines changed

Diff for: .ci/check-python-dists.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ DIST_DIR=${1}
88
METHOD=${METHOD:-""}
99
TASK=${TASK:-""}
1010

11-
echo "checking Python package distributions in '${DIST_DIR}'"
11+
echo "checking Python-package distributions in '${DIST_DIR}'"
1212

1313
pip install \
1414
-qq \
@@ -55,4 +55,4 @@ else
5555
echo "skipping pydistcheck (does not support Python 3.${PY_MINOR_VER})"
5656
fi
5757

58-
echo "done checking Python package distributions"
58+
echo "done checking Python-package distributions"

Diff for: .ci/test-python-oldest.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pip freeze
3030
echo ""
3131
echo "checking that examples run without error"
3232

33-
# run a few examples to test that Python package minimally works
33+
# run a few examples to test that Python-package minimally works
3434
echo ""
3535
echo "--- advanced_example.py ---"
3636
echo ""

Diff for: .ci/test-r-package-windows.ps1

+3-3
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ Write-Output "Installing dependencies"
144144
$packages = "c('data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'processx', 'R6', 'RhpcBLASctl', 'testthat'), dependencies = c('Imports', 'Depends', 'LinkingTo')"
145145
Run-R-Code-Redirect-Stderr "options(install.packages.check.source = 'no'); install.packages($packages, repos = '$env:CRAN_MIRROR', type = 'binary', lib = '$env:R_LIB_PATH', Ncpus = parallel::detectCores())" ; Check-Output $?
146146

147-
Write-Output "Building R package"
147+
Write-Output "Building R-package"
148148

149149
# R CMD check is not used for MSVC builds
150150
if ($env:COMPILER -ne "MSVC") {
@@ -234,7 +234,7 @@ if ($checks_cnt -eq 0) {
234234
Check-Output $False
235235
}
236236

237-
# Checking that we actually got the expected compiler. The R package has some logic
237+
# Checking that we actually got the expected compiler. The R-package has some logic
238238
# to fail back to MinGW if MSVC fails, but for CI builds we need to check that the correct
239239
# compiler was used.
240240
if ($env:R_BUILD_TYPE -eq "cmake") {
@@ -303,4 +303,4 @@ if ($env:COMPILER -eq "MSVC") {
303303
Rscript.exe --vanilla "testthat.R" ; Check-Output $?
304304
}
305305

306-
Write-Output "No issues were found checking the R package"
306+
Write-Output "No issues were found checking the R-package"

Diff for: .ci/test-r-package.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ elif [[ $R_BUILD_TYPE == "cran" ]]; then
155155
git diff --name-only | wc -l
156156
)
157157
if [[ ${num_files_changed} -gt 0 ]]; then
158-
echo "'configure' in the R package has changed. Please recreate it and commit the changes."
158+
echo "'configure' in the R-package has changed. Please recreate it and commit the changes."
159159
echo "Changed files:"
160160
git diff --compact-summary
161161
echo "See R-package/README.md for details on how to recreate this script."
@@ -167,7 +167,7 @@ elif [[ $R_BUILD_TYPE == "cran" ]]; then
167167
./build-cran-package.sh || exit 1
168168

169169
if [[ "${TASK}" == "r-rchk" ]]; then
170-
echo "Checking R package with rchk"
170+
echo "Checking R-package with rchk"
171171
mkdir -p packages
172172
cp ${PKG_TARBALL} packages
173173
RCHK_LOG_FILE="rchk-logs.txt"

Diff for: CMakeLists.txt

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ option(BUILD_CLI "Build the 'lightbgm' command-line interface in addition to lib
1919
option(BUILD_CPP_TEST "Build C++ tests with Google Test" OFF)
2020
option(BUILD_STATIC_LIB "Build static library" OFF)
2121
option(INSTALL_HEADERS "Install headers to CMAKE_INSTALL_PREFIX (e.g. '/usr/local/include')" ON)
22-
option(__BUILD_FOR_PYTHON "Set to ON if building lib_lightgbm for use with the Python package" OFF)
23-
option(__BUILD_FOR_R "Set to ON if building lib_lightgbm for use with the R package" OFF)
22+
option(__BUILD_FOR_PYTHON "Set to ON if building lib_lightgbm for use with the Python-package" OFF)
23+
option(__BUILD_FOR_R "Set to ON if building lib_lightgbm for use with the R-package" OFF)
2424
option(__INTEGRATE_OPENCL "Set to ON if building LightGBM with the OpenCL ICD Loader and its dependencies included" OFF)
2525

2626
cmake_minimum_required(VERSION 3.28)
@@ -60,9 +60,9 @@ if(__INTEGRATE_OPENCL)
6060
endif()
6161

6262
if(__BUILD_FOR_PYTHON OR __BUILD_FOR_R OR USE_SWIG)
63-
# the SWIG wrapper, the Python and R package don't require the CLI
63+
# the SWIG wrapper, the Python and R packages don't require the CLI
6464
set(BUILD_CLI OFF)
65-
# installing the SWIG wrapper, the R and Python package shouldn't place LightGBM's headers
65+
# installing the SWIG wrapper, the R and Python packages shouldn't place LightGBM's headers
6666
# outside of where the package is installed
6767
set(INSTALL_HEADERS OFF)
6868
endif()
@@ -497,7 +497,7 @@ endif()
497497

498498
set(API_SOURCES "src/c_api.cpp")
499499
# Only build the R part of the library if building for
500-
# use with the R package
500+
# use with the R-package
501501
if(__BUILD_FOR_R)
502502
list(APPEND API_SOURCES "src/lightgbm_R.cpp")
503503
endif()

Diff for: R-package/README.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ NOTE: `Rtools42` and later take a very different approach to the compiler toolch
112112

113113
#### Windows Toolchain Options
114114

115-
A "toolchain" refers to the collection of software used to build the library. The R package can be built with three different toolchains.
115+
A "toolchain" refers to the collection of software used to build the library. The R-package can be built with three different toolchains.
116116

117117
**Warning for Windows users**: it is recommended to use *Visual Studio* for its better multi-threading efficiency in Windows for many core systems. For very simple systems (dual core computers or worse), MinGW64 is recommended for maximum performance. If you do not know what to choose, it is recommended to use [Visual Studio](https://visualstudio.microsoft.com/downloads/), the default compiler. **Do not try using MinGW in Windows on many core systems. It may result in 10x slower results than Visual Studio.**
118118

@@ -221,7 +221,7 @@ CRAN does not prepare precompiled binaries for Linux, and as of this writing nei
221221

222222
### Installing from a Pre-compiled lib_lightgbm <a name="lib_lightgbm"></a>
223223

224-
Previous versions of LightGBM offered the ability to first compile the C++ library (`lib_lightgbm.{dll,dylib,so}`) and then build an R package that wraps it.
224+
Previous versions of LightGBM offered the ability to first compile the C++ library (`lib_lightgbm.{dll,dylib,so}`) and then build an R-package that wraps it.
225225

226226
As of version 3.0.0, this is no longer supported. If building from source is difficult for you, please [open an issue](https://github.com/microsoft/LightGBM/issues).
227227

@@ -241,11 +241,11 @@ Please visit [demo](https://github.com/microsoft/LightGBM/tree/master/R-package/
241241
Testing
242242
-------
243243

244-
The R package's unit tests are run automatically on every commit, via integrations like [GitHub Actions](https://github.com/microsoft/LightGBM/actions). Adding new tests in `R-package/tests/testthat` is a valuable way to improve the reliability of the R package.
244+
The R-package's unit tests are run automatically on every commit, via integrations like [GitHub Actions](https://github.com/microsoft/LightGBM/actions). Adding new tests in `R-package/tests/testthat` is a valuable way to improve the reliability of the R-package.
245245

246246
### Running the Tests
247247

248-
While developing the R package, run the code below to run the unit tests.
248+
While developing the R-package, run the code below to run the unit tests.
249249

250250
```shell
251251
sh build-cran-package.sh \
@@ -268,7 +268,7 @@ Rscript testthat.R
268268

269269
When adding tests, you may want to use test coverage to identify untested areas and to check if the tests you've added are covering all branches of the intended code.
270270

271-
The example below shows how to generate code coverage for the R package on a macOS or Linux setup. To adjust for your environment, refer to [the customization step described above](#custom-installation-linux-mac).
271+
The example below shows how to generate code coverage for the R-package on a macOS or Linux setup. To adjust for your environment, refer to [the customization step described above](#custom-installation-linux-mac).
272272

273273
```shell
274274
# Install
@@ -287,7 +287,7 @@ Rscript -e " \
287287
Updating Documentation
288288
----------------------
289289

290-
The R package uses [`{roxygen2}`](https://CRAN.R-project.org/package=roxygen2) to generate its documentation.
290+
The R-package uses [`{roxygen2}`](https://CRAN.R-project.org/package=roxygen2) to generate its documentation.
291291
The generated `DESCRIPTION`, `NAMESPACE`, and `man/` files are checked into source control.
292292
To regenerate those files, run the following.
293293

@@ -310,9 +310,9 @@ Rscript \
310310
Preparing a CRAN Package
311311
------------------------
312312

313-
This section is primarily for maintainers, but may help users and contributors to understand the structure of the R package.
313+
This section is primarily for maintainers, but may help users and contributors to understand the structure of the R-package.
314314

315-
Most of `LightGBM` uses `CMake` to handle tasks like setting compiler and linker flags, including header file locations, and linking to other libraries. Because CRAN packages typically do not assume the presence of `CMake`, the R package uses an alternative method that is in the CRAN-supported toolchain for building R packages with C++ code: `Autoconf`.
315+
Most of `LightGBM` uses `CMake` to handle tasks like setting compiler and linker flags, including header file locations, and linking to other libraries. Because CRAN packages typically do not assume the presence of `CMake`, the R-package uses an alternative method that is in the CRAN-supported toolchain for building R packages with C++ code: `Autoconf`.
316316

317317
For more information on this approach, see ["Writing R Extensions"](https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Configure-and-cleanup).
318318

@@ -344,7 +344,7 @@ R CMD install lightgbm_*.tar.gz
344344

345345
### Changing the CRAN Package
346346

347-
A lot of details are handled automatically by `R CMD build` and `R CMD install`, so it can be difficult to understand how the files in the R package are related to each other. An extensive treatment of those details is available in ["Writing R Extensions"](https://cran.r-project.org/doc/manuals/r-release/R-exts.html).
347+
A lot of details are handled automatically by `R CMD build` and `R CMD install`, so it can be difficult to understand how the files in the R-package are related to each other. An extensive treatment of those details is available in ["Writing R Extensions"](https://cran.r-project.org/doc/manuals/r-release/R-exts.html).
348348

349349
This section briefly explains the key files for building a CRAN package. To update the package, edit the files relevant to your change and re-run the steps in [Build a CRAN Package](#build-a-cran-package).
350350

@@ -488,4 +488,4 @@ These tests can also be triggered on any pull request by leaving a comment in a
488488
Known Issues
489489
------------
490490
491-
For information about known issues with the R package, see the [R-package section of LightGBM's main FAQ page](https://lightgbm.readthedocs.io/en/latest/FAQ.html#r-package).
491+
For information about known issues with the R-package, see the [R-package section of LightGBM's main FAQ page](https://lightgbm.readthedocs.io/en/latest/FAQ.html#r-package).

Diff for: R-package/tests/testthat/test_basic.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ test_that("lgb.cv() prefers objective in params to keyword argument", {
634634
for (bst_list in cv_bst$boosters) {
635635
bst <- bst_list[["booster"]]
636636
expect_equal(bst$params$objective, "regression_l1")
637-
# NOTE: using save_model_to_string() since that is the simplest public API in the R package
637+
# NOTE: using save_model_to_string() since that is the simplest public API in the R-package
638638
# allowing access to the "objective" attribute of the Booster object on the C++ side
639639
model_txt_lines <- strsplit(
640640
x = bst$save_model_to_string()
@@ -807,7 +807,7 @@ test_that("lgb.train() prefers objective in params to keyword argument", {
807807
, obj = "regression_l2"
808808
)
809809
expect_equal(bst$params$objective, "regression_l1")
810-
# NOTE: using save_model_to_string() since that is the simplest public API in the R package
810+
# NOTE: using save_model_to_string() since that is the simplest public API in the R-package
811811
# allowing access to the "objective" attribute of the Booster object on the C++ side
812812
model_txt_lines <- strsplit(
813813
x = bst$save_model_to_string()

Diff for: R-package/tests/testthat/test_lgb.Booster.R

+3-3
Original file line numberDiff line numberDiff line change
@@ -1111,7 +1111,7 @@ test_that("all parameters are stored correctly with save_model_to_string()", {
11111111
)
11121112
all_param_entries <- c(non_default_param_entries, default_param_entries)
11131113

1114-
# parameters should match what was passed from the R package
1114+
# parameters should match what was passed from the R-package
11151115
model_str <- bst$save_model_to_string()
11161116
params_in_file <- .params_from_model_string(model_str = model_str)
11171117
.expect_in(all_param_entries, params_in_file)
@@ -1176,7 +1176,7 @@ test_that("early_stopping, num_iterations are stored correctly in model string e
11761176
model_str <- bst$save_model_to_string()
11771177
params_in_file <- .params_from_model_string(model_str = model_str)
11781178

1179-
# parameters should match what was passed from the R package, and the "main" (non-alias)
1179+
# parameters should match what was passed from the R-package, and the "main" (non-alias)
11801180
# params values in `params` should be preferred to keyword argumentts or aliases
11811181
expect_equal(sum(startsWith(params_in_file, "[num_iterations:")), 1L)
11821182
expect_equal(sum(params_in_file == sprintf("[num_iterations: %s]", num_iterations)), 1L)
@@ -1406,7 +1406,7 @@ test_that("lgb.cv() correctly handles passing through params to the model file",
14061406
model_str <- bst[["booster"]]$save_model_to_string()
14071407
params_in_file <- .params_from_model_string(model_str = model_str)
14081408

1409-
# parameters should match what was passed from the R package, and the "main" (non-alias)
1409+
# parameters should match what was passed from the R-package, and the "main" (non-alias)
14101410
# params values in `params` should be preferred to keyword argumentts or aliases
14111411
expect_equal(sum(startsWith(params_in_file, "[num_iterations:")), 1L)
14121412
expect_equal(sum(params_in_file == sprintf("[num_iterations: %s]", num_iterations)), 1L)

Diff for: R-package/vignettes/basic_walkthrough.Rmd

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ table(bank$y)
5454

5555
## Training the model
5656

57-
The R package of LightGBM offers two functions to train a model:
57+
The R-package of LightGBM offers two functions to train a model:
5858

5959
- `lgb.train()`: This is the main training logic. It offers full flexibility but requires a `Dataset` object created by the `lgb.Dataset()` function.
6060
- `lightgbm()`: Simpler, but less flexible. Data can be passed without having to bother with `lgb.Dataset()`.

Diff for: build-cran-package.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/bin/sh
22

33
# [description]
4-
# Prepare a source distribution of the R package
4+
# Prepare a source distribution of the R-package
55
# to be submitted to CRAN.
66
#
77
# [arguments]
88
#
99
# --r-executable Customize the R executable used by `R CMD build`.
10-
# Useful if building the R package in an environment with
10+
# Useful if building the R-package in an environment with
1111
# non-standard builds of R, such as those provided in
1212
# https://github.com/wch/r-debug.
1313
#
@@ -83,7 +83,7 @@ cp \
8383
external_libs/fmt/include/fmt/*.h \
8484
"${TEMP_R_DIR}/src/include/LightGBM/utils/fmt"
8585

86-
# including only specific files from Eigen, to keep the R package
86+
# including only specific files from Eigen, to keep the R-package
8787
# small and avoid redistributing code with licenses incompatible with
8888
# LightGBM's license
8989
EIGEN_R_DIR="${TEMP_R_DIR}/src/include/Eigen"
@@ -116,7 +116,7 @@ cd "${TEMP_R_DIR}"
116116
rm recreate-configure.sh
117117

118118
# files only used by the lightgbm CLI aren't needed for
119-
# the R package
119+
# the R-package
120120
rm src/application/application.cpp
121121
rm src/include/LightGBM/application.h
122122
rm src/main.cpp
@@ -223,4 +223,4 @@ else
223223
lightgbm_r
224224
fi
225225

226-
echo "Done building R package"
226+
echo "Done building R-package"

Diff for: build-python.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# [description]
44
#
55
# Prepare a source distribution (sdist) or built distribution (wheel)
6-
# of the Python package, and optionally install it.
6+
# of the Python-package, and optionally install it.
77
#
88
# [usage]
99
#
@@ -13,10 +13,10 @@
1313
# # build wheel and put it in dist/
1414
# sh ./build-python.sh bdist_wheel [OPTIONS]
1515
#
16-
# # compile lib_lightgbm and install the Python package wrapping it
16+
# # compile lib_lightgbm and install the Python-package wrapping it
1717
# sh ./build-python.sh install [OPTIONS]
1818
#
19-
# # install the Python package using a pre-compiled lib_lightgbm
19+
# # install the Python-package using a pre-compiled lib_lightgbm
2020
# # (assumes lib_lightgbm.{dll,so} is located at the root of the repo)
2121
# sh ./build-python.sh install --precompile
2222
#
@@ -184,7 +184,7 @@ done
184184
pip install --prefer-binary 'build>=0.10.0'
185185

186186
# create a new directory that just contains the files needed
187-
# to build the Python package
187+
# to build the Python-package
188188
create_isolated_source_dir() {
189189
rm -rf \
190190
./lightgbm-python \

Diff for: build_r.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ for (submodule in list.dirs(
321321
, recursive = FALSE
322322
)) {
323323
# compute/ is a submodule with boost, only needed if
324-
# building the R package with GPU support;
324+
# building the R-package with GPU support;
325325
# eigen/ has a special treatment due to licensing aspects
326326
if ((submodule == "compute" && !USING_GPU) || submodule == "eigen") {
327327
next

Diff for: cmake/modules/FindLibR.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if(NOT R_ARCH)
2424
endif()
2525

2626
if(NOT ("${R_ARCH}" STREQUAL "x64"))
27-
message(FATAL_ERROR "LightGBM's R package currently only supports 64-bit operating systems")
27+
message(FATAL_ERROR "LightGBM's R-package currently only supports 64-bit operating systems")
2828
endif()
2929

3030
# Creates R.lib and R.def in the build directory for linking with MSVC

Diff for: docker/README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ For more details on how to configure and use the LightGBM CLI, see https://light
5757

5858
## Running the Python-package Сontainer
5959

60-
Build an image with the LightGBM Python package installed.
60+
Build an image with the LightGBM Python-package installed.
6161

6262
```shell
6363
mkdir lightgbm-docker
@@ -69,8 +69,8 @@ docker build \
6969
.
7070
```
7171

72-
Once that completes, the built image can be used to run LightGBM's Python package in a container.
73-
Run the following to produce a model using the Python package.
72+
Once that completes, the built image can be used to run LightGBM's Python-package in a container.
73+
Run the following to produce a model using the Python-package.
7474

7575
```shell
7676
# get training data
@@ -116,7 +116,7 @@ docker run \
116116

117117
## Running the R-package Сontainer
118118

119-
Build an image with the LightGBM R package installed.
119+
Build an image with the LightGBM R-package installed.
120120

121121
```shell
122122
mkdir lightgbm-docker
@@ -129,8 +129,8 @@ docker build \
129129
.
130130
```
131131

132-
Once that completes, the built image can be used to run LightGBM's R package in a container.
133-
Run the following to produce a model using the R package.
132+
Once that completes, the built image can be used to run LightGBM's R-package in a container.
133+
Run the following to produce a model using the R-package.
134134

135135
```shell
136136
# get training data

0 commit comments

Comments
 (0)