From d204e58337b9199322a38c1dfef85f8335137f10 Mon Sep 17 00:00:00 2001 From: mb706 Date: Tue, 11 Jun 2024 18:15:51 +0200 Subject: [PATCH 1/4] preparing workflow update --- .github/ISSUE_TEMPLATE.md | 43 ------------------------- .github/ISSUE_TEMPLATE/bug.md | 28 ---------------- .github/ISSUE_TEMPLATE/miscellaneous.md | 16 --------- .github/ISSUE_TEMPLATE/question.md | 16 --------- .github/PULL_REQUEST_TEMPLATE.md | 19 ----------- .github/stale.yml | 19 ----------- 6 files changed, 141 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE.md delete mode 100644 .github/ISSUE_TEMPLATE/bug.md delete mode 100644 .github/ISSUE_TEMPLATE/miscellaneous.md delete mode 100644 .github/ISSUE_TEMPLATE/question.md delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/stale.yml diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index a2c93eea55..0000000000 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,43 +0,0 @@ -For bug reports, please respect the following guidelines and check the boxes accordingly. -Please include your source code using tripple backticks ` like this: - - -```r -# your code -``` - - -For questions of the type: "How can this be done?", please consider posting them on Stackoverflow. - -For everything else ignore this template. - -## Bug report - -- [ ] Start a new R session -- [ ] Install the latest version of mlr: `update.packages(oldPkgs="mlr", ask=FALSE)` or if you use a GitHub install of mlr: `devtools::install_github(c("BBmisc", "ParamHelpers", "mlr"))` -- [ ] run `sessionInfo()` -- [ ] Give a minimal reproducible example - -## Writing a good bug report - -[ Slightly adapted version of (this) [https://www.r-project.org/bugs.html#writing-a-good-bug-report] ] - -Bug reports should include a way of reproducing the bug. This should be as simple as possible. If the person trying to fix the bug can’t work out how to make it appear, or has to jump through a lot of unnecessary hoops to make it appear, you’re going to waste a lot of their time. - -mlr is maintained by a number of people, so it’s best to make sure your bug report is clear and well-written. If it’s not, it will suck in more energy from the maintainers and take longer for the bug to get fixed - or it may end up not getting handled at all. In particular, you should: - -Write a clear and unique summary for the bug. “Running a model on data set with a constant feature causes the following exception” is good; “software crashes” is not. -Include, in the description, the steps to reproduce the bug mentioned above. -Focus most on the facts of what happened, but if course helps if you can already give us (informed!) guesses where the bug comes from. - -## Minimal reproducible example - -A minimal reproducible example consists of the following items: - -a minimal dataset, necessary to reproduce the error -the minimal runnable code necessary to reproduce the error, which can be run on the given dataset. -the necessary information on the used packages, R version and system it is run on. -in the case of random processes, a seed (set by set.seed()) for reproducibility - -If you want to learn more, read -https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example] diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md deleted file mode 100644 index 235d4dd391..0000000000 --- a/.github/ISSUE_TEMPLATE/bug.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -name: Bug -about: mlr produced an error, failure, or otherwise unexpected result. -title: '' -labels: 'type-bug' - ---- - -## Prework - -- [ ] Search for duplicates among the [existing issues](https://github.com/ropensci/mlr/issues), both open and closed. -- [ ] Advanced users: verify that the bug still persists in the current development version (i.e. `remotes::install_github("mlr-org/mlr")`) and mention the [SHA-1 hash](https://git-scm.com/book/en/v1/Getting-Started-Git-Basics#Git-Has-Integrity) of the [Git commit you install](https://github.com/ropensci/drake/commits/master). - -## Description - -Describe the bug clearly and concisely. - -## Reproducible example - -Provide a minimal reproducible example with code and output that demonstrates the bug. The [`reprex`](https://github.com/tidyverse/reprex) package is extremely helpful for this. - -## Session info - -End the reproducible example with a call to `sessionInfo()` in the same session (e.g. `reprex(si = TRUE)`) and include the output. - -## Expected output - -What output would the correct behavior have produced? diff --git a/.github/ISSUE_TEMPLATE/miscellaneous.md b/.github/ISSUE_TEMPLATE/miscellaneous.md deleted file mode 100644 index a31818b20e..0000000000 --- a/.github/ISSUE_TEMPLATE/miscellaneous.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -name: Miscellaneous -about: Suggest an idea or raise a concern. -title: '' -labels: '' -assignees: '' - ---- - -## Prework - -- [ ] Search for duplicates among the [existing issues](https://github.com/mlr-org/mlr/issues), both open and closed. - -## Description - -Describe the issue clearly and concisely. If applicable, write a minimal example in R code or pseudo-code to show input, usage, and desired output. diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md deleted file mode 100644 index 558ad7fbb3..0000000000 --- a/.github/ISSUE_TEMPLATE/question.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -name: Question -about: Ask a question. -title: '' -labels: 'type-question' - ---- - -## Prework - -- [ ] Search for duplicates among the [existing issues](https://github.com/mlr-org/mlr/issues), both open and closed. -- [ ] Consider instead posting to [Stack Overflow](https://stackoverflow.com) under the [`mlr` tag](https://stackoverflow.com/tags/mlr). - -## Question - -What would you like to know? diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 29a0c1440c..0000000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,19 +0,0 @@ -We are always happy to receive pull requests. - -Please make sure you have read our [coding guidelines](https://github.com/mlr-org/mlr3/wiki/style-guide). - -This means in particular that you have understood: - -* The [style guide&(https://github.com/mlr-org/mlr3/wiki/style-guide) - our lintr will provide you feedback on this -* Circle CI will run the tests for you - no need to punch your machine with it (they take about 30 mins) -* You can run `devtools::test()` locally in RStudio and tests will be skipped - -Please request a review from the following people on your PR: - -- pat-s -- larskotthoff -- mllg -- berndbischl - -You might want to join our slack at: -https://mlr-org.slack.com diff --git a/.github/stale.yml b/.github/stale.yml deleted file mode 100644 index 1bca40e7b5..0000000000 --- a/.github/stale.yml +++ /dev/null @@ -1,19 +0,0 @@ -# Number of days of inactivity before an issue becomes stale -daysUntilStale: 300 -# Number of days of inactivity before a stale issue is closed -daysUntilClose: 7 -# Issues with these labels will never be considered stale -exemptLabels: - - pinned - - prio-high - - prio-blocking - - type-bug -# Label to use when marking an issue as stale -staleLabel: stale -# Comment to post when marking an issue as stale. Set to `false` to disable -markComment: > - This issue has been automatically marked as stale because it has not had - recent activity. It will be closed if no further activity occurs. Thank you - for your contributions. -# Comment to post when closing a stale issue. Set to `false` to disable -closeComment: false From 0f4e2f7f79b18b2582e227dcfa970b34a71ee6d4 Mon Sep 17 00:00:00 2001 From: mb706 Date: Tue, 11 Jun 2024 18:17:14 +0200 Subject: [PATCH 2/4] new workflows --- .github/workflows/check.yml | 161 ++++++++++++++++++++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 .github/workflows/check.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000000..9ea72bd192 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,161 @@ + +on: + push: + branches: [master, devel] + pull_request: + branches: [master, devel] + schedule: + - cron: '33 4 * * *' # work 4:33 in the morning +name: check + +env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_REMOTES_NO_ERRORS_FROM_WARNINGS: true + WARNINGS_ARE_ERRORS: 1 + _R_CHECK_CRAN_INCOMING_REMOTE_: false + _R_CHECK_TESTS_NLINES_: 0 # disable limiting of output lines + _R_CHECK_CRAN_INCOMING_: false + +jobs: + check: + defaults: + run: + shell: bash + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false # continue runs even when a parallel run failed + matrix: + # run on ubuntu, macos, windows. 20.04 is more recent than ubuntu-latest, currently. + os: [macos-latest, windows-latest, ubuntu-latest] + action: [check] + r: [release] + include: + # additionally run r-devel, but only on ubuntu, and an old R version on an old ubuntu + - os: ubuntu-latest + action: check + r: devel + - os: ubuntu-20.04 + action: check + r: '4.1' + - os: ubuntu-latest + action: coverage + r: release + - os: ubuntu-latest + action: githubversions + r: release + + steps: + - uses: actions/checkout@v4 + - uses: r-lib/actions/setup-r@v2 + id: install-r + with: + r-version: ${{ matrix.r }} + - if: runner.os == 'Linux' + name: apt-get update + run: sudo apt-get update + - name: Install curl for Ubuntu + # necessary for pkgdown & covr, so we do that on ubuntu-latest / R release only + if: ${{ matrix.r == 'release' && matrix.os == 'ubuntu-latest' }} + run: sudo apt-get install libcurl4-openssl-dev libharfbuzz-dev libfribidi-dev + - uses: r-lib/actions/setup-pandoc@v2 + - uses: r-lib/actions/setup-tinytex@v2-branch + - name: Create Cache Key + shell: Rscript {0} + run: | + if (!require("remotes", quietly = TRUE)) install.packages("remotes") + writeLines(capture.output(print(remotes::dev_package_deps())), ".github/deps.txt") + - uses: actions/cache@v4 + with: + path: ${{ env.R_LIBS_USER }} + key: ${{ matrix.os }}-${{ steps.install-r.outputs.installed-r-version }}-${{ hashFiles('.github/deps.txt') }} + - shell: Rscript {0} + name: install necessary build env packages + run: for (req in c("remotes", "roxygen2", "covr", "pkgdown")) if (!require(req, quietly = TRUE)) install.packages(req) + - if: runner.os == 'Linux' + name: install system requirements + run: | + while read -r depinst ; do + echo "> $depinst" + eval sudo $depinst + done < <( Rscript -e "writeLines(remotes::system_requirements('ubuntu', '$( . /etc/os-release ; echo $VERSION_ID )'))") + - shell: Rscript {0} + name: install package dependencies + run: | + remotes::install_deps(dependencies = TRUE) + - name: install github versions + if: ${{ matrix.action == 'githubversions' }} + shell: Rscript {0} + run: | + system("sudo apt-get install libhiredis-dev") + remotes::install_github("mlr-org/paradox") + remotes::install_github("mlr-org/bbotk") + remotes::install_github("mlr-org/mlr3tuning") + - name: Session Info + shell: Rscript {0} + run: | + options(width = 200) + installed.packages()[, c("Package", "Version", "Built")] + sessionInfo() + - name: Document + shell: Rscript {0} + run: | + roxygen2::roxygenise() + system("attic/clean_man.sh") + - if: runner.os == 'windows' + name: Remove hypertarget from Latex for Windows + run: "sed -i 's/\\\\hypertarget{[^}]*}//g' man/*" + - if: runner.os == 'windows' + name: Install tinytex packages + shell: Rscript {0} + run: | + library(tinytex) + tlmgr_version() + tlmgr_update() + tlmgr_install('collection-latexrecommended') + tlmgr_install('collection-fontsrecommended') + tlmgr(c('list', '--only-installed')) + - name: Build + if: ${{ matrix.action != 'coverage' }} + working-directory: .. + run: 'R CMD build */' + - name: Check + if: ${{ matrix.action != 'coverage' }} + working-directory: .. + run: 'R CMD check --as-cran --run-donttest *.tar.gz' + - name: Coverage + if: ${{ matrix.action == 'coverage' }} + shell: Rscript {0} + run: covr::codecov(quiet = FALSE, type = "tests") + - name: install + if: ${{ matrix.action != 'coverage' && matrix.os == 'ubuntu-20.04' && matrix.r == 'release' }} + working-directory: .. + run: 'R CMD INSTALL *.tar.gz' + - name: Build Docs + if: ${{ matrix.action != 'coverage' && matrix.os == 'ubuntu-20.04' && matrix.r == 'release' }} + shell: Rscript {0} + run: | + pkgdown::build_site() + roxygen2::roxygenise() + tools::buildVignettes(dir = ".") + - name: Deploy Docs + if: ${{ matrix.action != 'coverage' && matrix.os == 'ubuntu-20.04' && matrix.r == 'release' && github.ref == 'refs/heads/master' }} + run: | + git config --local user.name "github-actions[bot]" + git config --local user.email "mb706@users.noreply.github.com" + git checkout --orphan gh-pages + git --work-tree=docs add --all + git --work-tree=docs commit -m "gh-pages" + git push origin HEAD:gh-pages --force + - name: Install Log + if: ${{ failure() }} + working-directory: .. + run: 'cat *.Rcheck/00install.out' + - name: Check Log + if: ${{ failure() }} + working-directory: .. + run: 'cat *.Rcheck/00check.log' + - name: Latex Log + if: ${{ failure() }} + working-directory: .. + run: 'cat *.Rcheck/Rdlatex.log' + From ec0baa0207b14e100095cd89e774655c36e6fa0a Mon Sep 17 00:00:00 2001 From: mb706 Date: Tue, 11 Jun 2024 18:24:22 +0200 Subject: [PATCH 3/4] cleaning up --- .pre-commit-config.yaml | 41 ----------------------------------------- DESCRIPTION | 6 ++++-- NEWS.md | 22 +++------------------- cran-comments.md | 29 ----------------------------- tic.R | 23 ----------------------- 5 files changed, 7 insertions(+), 114 deletions(-) delete mode 100644 .pre-commit-config.yaml delete mode 100644 cran-comments.md delete mode 100644 tic.R diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml deleted file mode 100644 index 931087f24c..0000000000 --- a/.pre-commit-config.yaml +++ /dev/null @@ -1,41 +0,0 @@ -# All available hooks: https://pre-commit.com/hooks.html -# R specific hooks: https://github.com/lorenzwalthert/precommit -repos: -- repo: https://github.com/lorenzwalthert/precommit - rev: v0.3.2.9003 - hooks: - - id: style-files - args: [--style_pkg=styler.mlr, --style_fun=mlr_style] - exclude: > - (?x)^( - todo-files/.*| - tests/.*| - man-roxygen/.*| - inst/.*| - )$ - additional_dependencies: - - mlr-org/styler.mlr - - id: use-tidy-description - - id: readme-rmd-rendered - - id: parsable-R - - id: no-browser-statement -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 - hooks: - - id: check-added-large-files - args: ['--maxkb=1000'] - - id: end-of-file-fixer - exclude: '\.Rd' -- repo: local - hooks: - - id: forbid-to-commit - name: Don't commit common R artifacts - entry: Cannot commit .Rhistory, .RData, .Rds or .rds. - language: fail - files: '\.Rhistory|\.RData|\.Rds|\.rds$' - exclude: "gunpoint.RData|yeast.RData" - # `exclude: ` to allow committing specific files. - -ci: - autoupdate_schedule: monthly - skip: [style-files] diff --git a/DESCRIPTION b/DESCRIPTION index 4ea2694e68..578e790067 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -129,7 +129,6 @@ Suggests: mlbench, mldr, mlrMBO, - mmpf, modeltools, mRMRe, neuralnet, @@ -148,6 +147,7 @@ Suggests: rappdirs, refund, rex, + mmpf, rFerns, rgenoud, rmarkdown, @@ -167,7 +167,6 @@ Suggests: stepPlr, survAUC, svglite, - SwarmSVM, testthat, tgp, TH.data, @@ -176,6 +175,9 @@ Suggests: vdiffr, wavelets, xgboost (>= 0.7) +Remote: + zmjones/mmpf/pkg, + mb706/SwarmSVM@patch-1 VignetteBuilder: knitr ByteCompile: yes diff --git a/NEWS.md b/NEWS.md index 0e98201b09..3827846331 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,39 +1,23 @@ - - -# mlr 2.19.1.9001 +# mlr 2.19.2 +- Make tests run with suggested packages absent. - Remove bartMachine learner (#2851) -# mlr 2.19.1.9000 - -- no changes - - # mlr 2.19.1 ## Bug fixes - Adjust behavior of `"positive"` arg for `classif.logreg` (#2846) - - Consistent naming for dummy feature encoding of variables with different levels count (#2847) - - Remove {nodeHarvest} learners (#2841) - - Remove {rknn} learner (#2842) - - Remove all {DiscriMiner} learners (#2840) - - Remove {extraTrees} learner (#2839) - - Remove depcrecated {rrlda} learner - - Resolve some {ggplot} deprecation warnings - - Fixed `information.gain` filter calculation. Before, `chi.squared` was calculated even though `information.gain` was requested due to a glitch in the filter naming (#2816, @jokokojote) - - Make `helpLearnerParam()`'s HTML parsing more robust (#2843) - - Add HTML5 support for help pages # mlr 2.19.0 @@ -55,7 +39,7 @@ - xgboost: update `objective` default from `reg:linear` (deprecated) to `reg:squarederror` - issue a warning if `blocking` was set in the Task but `blocking.cv` was not set within `makeResampleDesc() (#2788) - Fix order of learners in `generateLearningCurveData()` (#2768) - - `getFeatureImportance()`: Account for feature importance weight of linear xgboost models +- `getFeatureImportance()`: Account for feature importance weight of linear xgboost models - Fix learner note for learner glmnet (the default of param `s` did not match the learner note) (#2747) - Remove dependency {hrbrthemes} used in `createSpatialResamplingPlots()`. The package caused issues on R-devel. In addition users should set custom themes by themselves. - Explicitly return value in `getNestedTuneResultsOptPathDf()` (#2754) diff --git a/cran-comments.md b/cran-comments.md deleted file mode 100644 index 0f494aee6f..0000000000 --- a/cran-comments.md +++ /dev/null @@ -1,29 +0,0 @@ -mlr 2.19.1 - -## Cran Repository Policy - -- [x] Reviewed CRP last edited 2022-07-26. - -See changes at https://github.com/eddelbuettel/crp/compare/master@%7B2020-10-29%7D...master@%7B2022-07-26%7D - -## R CMD check results - -- [x] Checked locally, R 4.2.1 -- [x] Checked on CI system, R 4.2.1 -- [x] Checked on win-builder, R devel - -Check the boxes above after successful execution and remove this line. Then run `fledge::release()`. - -## Current CRAN check results - -- [x] Checked on 2022-09-08, problems found: https://cran.r-project.org/web/checks/check_results_mlr.html -- [x] NOTE: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-patched-linux-x86_64, r-release-linux-x86_64 -- [x] NOTE: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-patched-linux-x86_64, r-release-linux-x86_64, r-release-macos-x86_64 -- [x] NOTE: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-devel-windows-x86_64 -- [x] NOTE: r-devel-linux-x86_64-fedora-clang, r-release-macos-arm64, r-oldrel-macos-arm64 -- [x] NOTE: r-devel-windows-x86_64, r-release-windows-x86_64 -- [x] NOTE: r-release-macos-arm64 -- [x] NOTE: r-release-macos-x86_64 -- [x] NOTE: r-oldrel-macos-arm64, r-oldrel-macos-x86_64 - -Check results at: https://cran.r-project.org/web/checks/check_results_mlr.html diff --git a/tic.R b/tic.R deleted file mode 100644 index 0ccb38f078..0000000000 --- a/tic.R +++ /dev/null @@ -1,23 +0,0 @@ -if (Sys.info()[["sysname"]] != "Windows") { - get_stage("script") %>% - add_code_step(RWeka::WPM("refresh-cache")) %>% - add_code_step(RWeka::WPM("install-package", "XMeans")) -} - -# R CMD Check -do_package_checks(error_on = "warning", codecov = FALSE) - -# pkgdown -if (ci_on_ghactions() && ci_has_env("BUILD_PKGDOWN")) { - get_stage("before_deploy") %>% - add_step(step_install_github("mlr-org/mlr3pkgdowntemplate")) %>% - add_step(step_install_cran("GGally")) - do_pkgdown() -} - -if (ci_is_env("CODECOV", "true")) { - get_stage("after_success") %>% - add_code_step(RWeka::WPM("refresh-cache")) %>% - add_code_step(RWeka::WPM("install-package", "XMeans")) %>% - add_code_step(covr::codecov()) -} From 39e95b5b03c646a584879f690d7d691441f4c390 Mon Sep 17 00:00:00 2001 From: mb706 Date: Tue, 11 Jun 2024 18:26:18 +0200 Subject: [PATCH 4/4] remove links to mmpfs --- R/generatePartialDependence.R | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/R/generatePartialDependence.R b/R/generatePartialDependence.R index 63ec4cf2e6..94f421c7b2 100644 --- a/R/generatePartialDependence.R +++ b/R/generatePartialDependence.R @@ -8,6 +8,9 @@ #' estimating E_(x_c)(f(x_s, x_c)). The conditional expectation of f at observation i is estimated similarly. #' Additionally, partial derivatives of the marginalized function w.r.t. the features can be computed. #' +#' This function requires the `mmpf` package to be installed. It is currently not on CRAN, but can +#' be installed through GitHub using `devtools::install_github('zmjones/mmpf/pkg')`. +#' #' @family partial_dependence #' @family generate_plot_data #' @aliases PartialDependenceData @@ -65,7 +68,7 @@ #' The second element of `n` gives the size of the sample to be drawn without replacement from the `input` data. #' Setting `n[2]` less than the number of rows in the `input` will decrease computation time. #' The default for `n[1]` is 10, and the default for `n[2]` is the number of rows in the `input`. -#' @param ... additional arguments to be passed to [mmpf::marginalPrediction]. +#' @param ... additional arguments to be passed to `mmpf`'s `marginalPrediction`. #' @return [PartialDependenceData]. A named list, which contains the partial dependence, #' input data, target, features, task description, and other arguments controlling the type of #' partial dependences made.