Cython-compiled estimators for sktime.
This package hosts ahead-of-time compiled implementations of sktime algorithms,
isolating the C-compilation and binary-wheel complexity from the main sktime
package. Estimators here expose a plain numpy-in/numpy-out compute layer with
no sktime runtime dependency; sktime keeps thin BaseTransformer /
BaseEstimator wrappers that delegate to this package.
Why a separate package: compiled extensions need a C toolchain, per-platform
wheels, and cibuildwheel release machinery. Keeping that here lets sktime
stay pure-Python while still offering compiled, numba-free fast paths.
| Estimator | Compute API | Notes |
|---|---|---|
| MiniRocket (univariate and multivariate) | rocket.rocket_fit / rocket_transform |
numba-free; 2D or 3D NumPy input; equivalent to MiniRocket / MiniRocketMultivariate, no JIT warmup |
| Multivariate MultiRocket | sktime_cython.transformations.rocket.multirocket_fit / multirocket_transform |
numba-free; equivalent to MultiRocketMultivariate, no JIT warmup |
Logic for further sktime cython based estimators should be added in this package,
for a recipe, see the extension guide below.
Runtime dependency: numpy only.
Requires a C compiler and Python 3.10+. Run from the project root.
# editable install with the dev extra (pulls sktime + numba for equivalence
# tests, plus pre-commit); compiles the Cython extensions via build isolation
uv pip install -e ".[dev]" # or: pip install -e ".[dev]"
# install the git pre-commit hooks ONCE — this is what stops CI lint failures
pre-commit install
# run the tests
python -m pytest sktime_cython -vAfter editing a .pyx, recompile with pip install -e . again (or make build).
make shortcuts (auto-detect uv, falling back to pip/python):
make install, make build, make test, make clean.
CI runs the pre-commit hooks and fails if they reformat anything. Running
pre-commit install (above) auto-runs them on every git commit. To check the
whole tree on demand:
pre-commit run --all-filesThis runs ruff check (lint) and ruff format. If ruff format reports "files
were modified", it already fixed them — git add the changes and commit again.
test.yml(push / PR tomain): acode-qualityjob running the pre-commit hooks, plus a matrix that builds the Cython extensions and runs pytest across Python 3.10–3.14 on Linux, macOS, and Windows.release.yml(on GitHub release): builds binary wheels withcibuildwheelfor all platforms, builds an sdist (with.pyxsources), and publishes to PyPI via trusted publishing.
- Drop the kernel
.pyx(and optional.pyistub) in a subfolder of the package. The package structure mirrors that ofsktime, files should be added paralleling its primary import location insktime - Register the kernel as an
Extensioninsetup.py. - Add a numpy compute-layer module
sktime_cython/<name>.pyexposing the estimator's public functions. Keep them in the submodule — do not re-export at the top level (avoids name collisions across estimators). - Add tests in a subfolder
tests, in the same folder as the kernel.
Cython kernels and python layers should be added in a parallel location as in the
sktime package.
Example for minirocket:
sktime_cython/
transformations/
rocket/
__init__.py # public compute-layer exports
_minirocket.py # numpy fit/transform layer
_minirocket_multivariate_cython.pyx # compiled kernels
_minirocket_multivariate_cython.pyi # type stubs
tests/
__init__.py
test_minirocket.py # tests
BSD 3-Clause License — see LICENSE.