← Back to all sparks
M

mlr3misc

DEVOPS
Velocity0.0

Helper functions and utility classes shared across the mlr3 ecosystem

The mlr3 utility belt has spent a year rebuilding how errors travel

mlr3error-handlingencapsulationutility-functionsr-package
Current state
mlr3misc holds the helper functions the rest of mlr3 is built on — dictionaries, callbacks, assertions, and encapsulate() for running code with its conditions captured. The last six releases are one sustained project on that last piece: returning condition objects instead of strings, respecting .seed and .opts under the evaluate method, supporting parent conditions on Mlr3Error, and short-circuiting when .timeout is zero rather than silently disabling enforcement. A mirai encapsulation method arrived along the way.
Where it's heading
The direction is making failures inspectable rather than merely reported. Storing conditions as objects lets callers branch on error class, which is why warningf() and stopf() gained a class argument and the mlr3warning and mlr3error classes; removing the msg column from encapsulate logs was the breaking change that followed from committing to that representation. Utility functions also keep migrating inward from other mlr3 packages, as the checkmate operators moved from mlr3pipelines show.
Prediction
With conditions now carrying class and parentage, the natural follow-on is the calling packages using that structure — typed error handling in mlr3 and mlr3tuning rather than further work here.

Recent moves

  1. 2mo ago

    mlr3misc 0.22.0 fixes a silently disabled encapsulate timeout

    encapsulate() now short-circuits when .timeout is 0 and returns an immediate timeout log entry instead of silently disabling enforcement, register_namespace_callback() wraps user callbacks, and as_short_string() prints factor values. The timeout fix removes a case where a stated limit quietly did nothing.

    View source ↗
  2. 5mo ago

    mlr3misc 0.21.0 makes encapsulate methods behave consistently

    encapsulate() with the evaluate method now respects .seed and .opts and stops storing output, matching the other encapsulation methods, while log messages become condition objects and Mlr3Error gains parent-condition storage. Consistency across encapsulation backends plus the groundwork for structured error chains.

    View source ↗
  3. 5mo ago

    mlr3misc 0.20.0 drops the msg column from encapsulate logs

    The msg column is removed from encapsulate logs — a breaking change following from conditions being stored as objects — alongside a new warn_deprecated() helper, an unnest() fix for vector-valued elements, and discard() no longer stripping attributes.

    View source ↗
  4. 11mo ago

    mlr3misc 0.19.0 returns condition objects from encapsulate()

    encapsulate() starts returning the specific condition objects alongside its logs, with several new error-handling functions. This is the release the subsequent error-handling work builds on.

    View source ↗
  5. 1y ago

    mlr3misc 0.18.0 adds mirai as an encapsulation method

    Adds mirai as an encapsulation method for encapsulate(). Another execution backend for isolated evaluation, not a change to what encapsulation means.

    View source ↗
  6. 1y ago

    mlr3misc 0.17.0 adds condition classes to warningf() and stopf()

    warningf() and stopf() gain a class argument and attach mlr3warning and mlr3error classes, the %check&&% and %check||% operators move here from mlr3pipelines, and as_callbacks() returns a list named by callback id. The condition classes are the seed of the structured error handling that follows.

    View source ↗