Skip to content

Integrating Ecosystem

Michel Lang edited this page Nov 11, 2019 · 3 revisions

This page lists all the points necessary when integrating a new mlr3 extension package.

Dependencies

Be convervative with dependencies. Do not import additional packages for their convenient helper functions. Everything that can be reasonably solved with base R or data.table() should be solved with R or data.table(). All third-party packages that only required by a not substantial subset of your package should go into Suggests and loaded (not attached!) on-demand via mlr3misc::require_namespaces()/base::requireNamespace().

Also make sure to check out the functions mlr3misc provides.

Unit Tests

checkmate comes with a phlethora of expectation functions, and mlr3 implements even more for most objects in mlr3. The later are shipped with mlr3 (c.f. this directory) and can be sourced with the following line:

lapply(list.files(system.file("testthat", package = "mlr3"), pattern = "^helper.*\\.[rR]$", full.names = TRUE), source)

This should usually be safe to place into inst/testthat/helper.R.

Doc

CI

It is easiest to call tic::use_tic() first and then

  • Overwrite the created .travis.yml file with the contents of .travis.yml
  • Add TRAVIS_ACCESS_TOKEN as an env variable to the Travis repo so that mlr3book builds are automatically triggered. To do so, install the travis system library, log in with travis login --org --auto and run travis token. Store the displayed token as the env variable mentioned above

Web presence

  • Add the repo to the Netlify DNS list using the scheme <pkg-name.mlr.org.com. You can simply follow the already existing entries.
  • Set a CNAME file in the Github repo under "Settings -> Github pages" pointing the new custom domain just created via Netlify

Installing/Updating