Repository navigation
Stage 1: base preprocessor contract, docs cleanup and license - #1
Merged
Merged
Conversation
.claude/settings.json is a per-developer file and is no longer tracked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
README already pointed to a LICENSE file that did not exist. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Drop README_preprocessing_toolkit_EN.md, an identical copy of README.md. - Add a v0.1 in-development status note and mark the quick start as the planned API. - Install from source (not on PyPI yet) with the real repository URL and fix the broken Octacity link. - Limit the listed options to the v0.1 scope (no label encoding, no robust scaler; robust is already on the v0.2 roadmap). - Format the quick start example so ruff format --check passes in CI. - Mention the oldest-dependency CI row in CONTRIBUTING. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes out stage 1: the shared
BasePreprocessorcontract, its tests and CI. After this lands, the blocks (imputer, encoder, scaler) andPipelinecan be built in parallel on top of it.Where the code is
BasePreprocessor, its tests and the CI workflow were pushed tomaindirectly before this PR existed, so they do not show up in this diff. Review them here:bf783a9...a8c1191: everything the base commit added (
src/preprocessing_toolkit/base.py,tests/test_base.py,.github/workflows/ci.yml,pyproject.toml,CONTRIBUTING.md).That push also turned CI red on
main:ruff format --checkfailed on the README example code, so the tests never ran. This PR fixes that.What this PR changes
.claude/settings.json(per-developer local settings) is no longer tracked and is now in.gitignore, together with common Python build and cache directories.LICENSEthat the README already linked to.README_preprocessing_toolkit_EN.mdwas an identical copy ofREADME.mdand is removed.onehotandordinalwithhandle_unknown; the scaler offersstandardandminmax. Label encoding is dropped androbuststays on the v0.2 roadmap.Design decisions in
BasePreprocessorCompatible with scikit-learn, but no dependency on it. Runtime dependencies are only
numpyandpandas. Compatibility comes from following scikit-learn's conventions, not from importing it:get_params/set_paramsread the parameters from the__init__signature;__sklearn_is_fitted__reports whether the block is fitted;__sklearn_tags__describes the block as an unsupervised transformer. It imports scikit-learn inside the method, and only scikit-learn ≥ 1.6 calls it. Its docstring notes that it must be updated if scikit-learn changes theTagsstructure.Tests run blocks through
clone,cross_val_scoreandGridSearchCV. A CI row on Python 3.10 with scikit-learn 1.3 (before the tags API existed) checks that blocks also work without tags.Template method. The public
fit/transform/fit_transformmethods run the shared checks. Subclasses implement only_fitand_transform.__init__must store its arguments unchanged and must not use*args/**kwargs; the class raises an error if it does. Everything a block learns in_fitgoes into attributes ending in_.Column policy. Input must be a pandas
DataFramewithout duplicate column names.transformrequires exactly the columns seen infit. Missing and unexpected columns are reported together in one error. Columns in a different order are put back into the fit order.A failed fit leaves the block unfitted.
fitclears the fitted state before it starts. If_fitraises, or the input is rejected, the block reports itself as not fitted andtransformraisesNotFittedError. It never keeps using a half-updated state.NotFittedErrorsubclasses bothValueErrorandAttributeError, like scikit-learn's.English only. Code, docstrings, error messages, commits and PRs are in English, as
CONTRIBUTING.mdrequires.Verification
pytest: 32 passed (30 test functions; one is parametrized over 3 inputs). Ran on Python 3.13.5 with scikit-learn 1.9.1, pandas 3.0.6 and numpy 2.5.4.ruff check .andruff format --check .(ruff 0.17.1): clean.🤖 Generated with Claude Code