Skip to content

Make scikit-learn an optional dependency #113

Description

@amol-

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions