posit-dev / posit-dev/orbital

Make scikit-learn an optional dependency

Open
#113 0 comments 1 reaction 1 assignee View on GitHub

@amol- is already working on this.

Since Jul 28, 2026.

Dominant language
Python
Stars
120
Forks
9
Avg merge
11d 6m
Merged PRs (30d)
2

Description

Goal

Turn scikit-learn (and skl2onnx) into an optional dependency, mirroring how PyTorch support works: users who only need parse_pytorch_model can install orbital without pulling scikit-learn/skl2onnx.

Done when:

  • A PyTorch-only install does not include scikit-learn/skl2onnx.
  • import orbital works without scikit-learn installed; calling parse_pipeline (or other sklearn-only entry points) without it raises a clear ImportError pointing to the extra to install (e.g. pip install orbital[sklearn]).
  • Decide and document what a bare pip install orbital provides (keep sklearn for backward compatibility vs. fully optional extras for both frameworks).

Why

PyTorch users currently pay for dependencies they never use: scikit-learn, skl2onnx, and packaging are unconditional core deps. Symmetric treatment of both frameworks keeps installs lean and the dependency story coherent.

References

  • pyproject.toml (dependencies: scikit-learn, skl2onnx, packaging — the latter noted as required by skl2onnx converters)
  • src/orbital/ast.py (module-level skl2onnx/sklearn.pipeline imports, parse_pipeline)
  • src/orbital/types.py (wraps skl2onnx.common.data_types — types are shared by all parse paths, so this import is the hard knot)
  • Branch nnet (not yet on main): parse_pytorch_model lazy-import pattern and the pytorch extra — the model to replicate

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.