Skip to content

feat: promote get_estimator to the headline exporter (roadmap 2.2) - #45

Merged
rxavier merged 1 commit into
mainfrom
roadmap/2.2-get-estimator-exporter
Jul 31, 2026
Merged

feat: promote get_estimator to the headline exporter (roadmap 2.2)#45
rxavier merged 1 commit into
mainfrom
roadmap/2.2-get-estimator-exporter

Conversation

@rxavier

@rxavier rxavier commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Summary

Roadmap 2.2 — promote get_estimator to the headline exporter: the supported way to leave Poniard with a plain scikit-learn object.

Changes

  • Docstring: get_estimator now leads with the exporter contract — returns a plain sklearn.pipeline.Pipeline (or bare estimator with include_preprocessor=False) with no poniard references; documents retrain=True + X/y for a fitted, ready-to-predict pipeline.
  • README: new "Exporting a model (leaving Poniard)" section right after Quick start.
  • Tests (tests/test_get_estimator.py):
    • exported pipeline is a plain sklearn.pipeline.Pipeline;
    • include_preprocessor=False returns a bare estimator;
    • retrain=True without X/y raises;
    • pickle round-trip: the exported pipeline is pickled, then loaded in a subprocess where poniard imports are blocked (via a builtins.__import__ guard, robust even if poniard is pip-installed) and PYTHONPATH is stripped — asserting it unpickles as a Pipeline and predicts. This is the real definition of "you can delete poniard when you're done."

Full suite: 143 passed; ruff clean.

- document get_estimator as the supported way to leave Poniard: it
  returns a plain sklearn Pipeline (or bare estimator) with no poniard
  references, retrainable on X/y.
- add README section 'Exporting a model (leaving Poniard)'.
- add tests: plain sklearn Pipeline, bare estimator without preprocessor,
  retrain requires X/y, and a pickle round-trip in a subprocess where
  poniard imports are blocked and PYTHONPATH is stripped.
@rxavier
rxavier merged commit e0bb0ff into main Jul 31, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant