The numerical engine behind cultivars: primitives, state-space substrates, estimators, samplers and result records, published as its own distribution and pinned exactly by every cultivars release.
| Distribution | |
| Quality | |
| Packaging | |
| License | |
| Usage | |
| Parent project |
This is not the package to install for modelling. Install
cultivars. It depends on the one engine release it was built against and brings it along. Installcultivars-enginedirectly only to work on the engine, or to build on its internals with an exact pin of your own.
What it is
cultivars ships as two distributions. cultivars holds the public models, results and tests. cultivars-engine (import name cultivars_engine) holds what sits beneath them: about 42,000 lines of numerical primitives and model machinery that the public classes subclass, call and re-export, plus three small public modules that both layers share.
| Module | Status | Contents |
|---|---|---|
cultivars_engine._core |
Private | 21 modules of primitives that know nothing about any model: input validators, matrix and lag-polynomial routines, estimators, single-draw sampling primitives, stationarity transforms and reparameterizations, spectra, wavelets, scoring rules, the value objects behind every summary, structural protocols, and package-wide defaults |
cultivars_engine._internals |
Private | 31 modules of model machinery: the linear-Gaussian and nonlinear state-space substrates with their filters and smoothers, the Hamilton filter and Kim smoother, optimizer objectives, solvers, priors, simulators, fit, posterior and result records, the protected base classes the public models subclass, and the mixins results take behavior from |
cultivars_engine.exceptions |
Public | CultivarsError and its three subclasses DimensionError, SpecificationError and NumericalError, with StabilityWarning and ExperimentalWarning |
cultivars_engine.summary |
Public | SummaryTable, the record every summary() returns, and InformationCriteria |
cultivars_engine.typing |
Public | The 19 aliases for categorical arguments (Trend, Method, Identification, Penalty and the rest) |
The dependency runs one way. Engine code imports nothing from cultivars.
How it relates to cultivars
- One engine release per cultivars release.
cultivarsdeclarescultivars-engine==X.Y.Z, never a range. - The pin is exact because the boundary is private. Of the 380 names
cultivars1.0.0a6 imports from the engine, 360 are underscore-private. Private names carry no compatibility promise, so any engine release can break any cultivars release other than the one that pins it. - The two version numbers are independent. An engine release does not imply a cultivars release, and the engine's version says nothing about cultivars' API.
| cultivars | cultivars-engine |
|---|---|
| 1.0.0a8 | 0.0.5 |
| 1.0.0a7 | 0.0.4 |
| 1.0.0a6 | 0.0.3 |
| 1.0.0a5 and earlier | None. The engine was the cultivars.engine subpackage |
Engine releases 0.0.1 and 0.0.2 were never pinned by a cultivars release.
Stability
| Surface | Guarantee |
|---|---|
exceptions, summary, typing |
Public. cultivars.exceptions, cultivars.summary and cultivars.typing re-export these modules, and the classes are the same objects under either import path. Their stability follows cultivars' policy. Import them from cultivars. |
_core, _internals |
None. Names, signatures and behavior can change in any release, including a patch release. Code that imports from them must pin the engine exactly, as cultivars does. |
Because the classes are defined here, a traceback or a repr names cultivars_engine.exceptions.SpecificationError even when the import said cultivars.exceptions. An except clause written against either path catches the same exception.
Installation
Requires Python 3.12 or later.
For modelling, install cultivars and let it choose the engine:
pip install --pre cultivars
To install the engine on its own, pin it:
pip install "cultivars-engine==0.0.3"
pip install "cultivars-engine[pandas]==0.0.3" # or [polars]
With uv:
uv add "cultivars-engine==0.0.3"
Do not install a different engine version beside an installed cultivars. The resolver will refuse, and forcing it leaves a cultivars that imports names the engine no longer has.
The engine's own code imports numpy and scipy, and pandas or polars only for the to_pandas() and to_polars() conveniences. Releases up to 0.0.3 also declared fedfred and matplotlib, which the engine never imported. Both requirements are removed in the development tree, so an install of the next release brings in numpy and scipy alone.
A quick check
The public modules work without cultivars installed:
>>> from cultivars_engine.exceptions import CultivarsError, SpecificationError
>>> issubclass(SpecificationError, CultivarsError), issubclass(SpecificationError, ValueError)
(True, True)
>>> from cultivars_engine.summary import InformationCriteria, SummaryTable
>>> ic = InformationCriteria.from_likelihood(llf=-120.5, nobs=200, n_params=4)
>>> round(ic.aic, 2), round(ic.bic, 2), round(ic.hqic, 2)
(249.0, 262.19, 254.34)
>>> table = SummaryTable(
... title="AR(1)",
... metadata=(("nobs", "200"), ("method", "conditional least squares")),
... columns=("", "coef", "std err"),
... rows=(("phi", "0.512", "0.061"),),
... notes=("Standard errors assume homoskedastic errors.",),
... )
>>> print(table.to_text())
AR(1)
================================================================================
nobs: 200 method: conditional least squares
--------------------------------------------------------------------------------
coef std err
phi 0.512 0.061
================================================================================
Standard errors assume homoskedastic errors.
Documentation
The engine reference is not published yet. It will be built from this repository and deployed once per release to https://nikhilxsunder.github.io/cultivars-engine/<version>/, and the cultivars site links to the reference for the engine release it pins.
Until then:
- Every module, class and function carries a Google-style docstring, readable with
help()or an editor hover. - The models built on the engine are documented at https://nikhilxsunder.github.io/cultivars/stable/ (stable) and https://nikhilxsunder.github.io/cultivars/dev/ (development).
Where to report an issue
| What you saw | Where it goes |
|---|---|
A wrong number, an error or confusing behavior from a model, result or test in cultivars |
cultivars issues |
A defect you have traced to a file under src/cultivars_engine, or a typing or docstring error there |
cultivars-engine issues |
| A security vulnerability in either package | Privately, as described in SECURITY.md |
If you are not sure, file it against cultivars. Issues are moved between the two trackers as needed, and the labels and milestones match.
Development
git clone https://github.com/nikhilxsunder/cultivars-engine.git
cd cultivars-engine
uv sync --all-groups
uv run pre-commit install
uv run ruff check src && uv run ruff format --check src
uv run mypy src
The engine has no test tree of its own yet. CI runs its docstring examples, and the public models exercise it through cultivars' own examples, so a change here should also be run against a cultivars checkout before it is proposed. CONTRIBUTING.md gives the commands, the layering rules for _core and _internals, and what a change that crosses the package boundary has to include. ROADMAP.md lists the test, documentation and CI work scheduled for this repository.
Citation
The engine is part of cultivars and is not cited separately. If cultivars contributes to published work, cite the concept DOI, which resolves to the latest release:
@software{sunder_cultivars,
author = {Sunder, Nikhil and Bernardin, John},
title = {cultivars: Research-grade time series econometrics for Python},
year = {2026},
doi = {10.5281/zenodo.23028870},
url = {https://github.com/nikhilxsunder/cultivars}
}
License
MIT. See LICENSE.
Metadata
Release files for cultivars-engine 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cultivars_engine-0.0.5.tar.gz | 645.7 kB | Without provenance | Details for cultivars_engine-0.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cultivars_engine-0.0.5-py3-none-any.whl | Python 3 | none | any | Details for cultivars_engine-0.0.5-py3-none-any.whl |
Total release size: 1.1 MB
Release files / cultivars_engine-0.0.5.tar.gz
| Download URL | cultivars_engine-0.0.5.tar.gz |
|---|---|
| Size | 645.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8bfa04643ba01da6e9967dc0ddb2591ee88e72b4bd1645d73df0a066d1be1ae7
|
|
BLAKE2b-256 checksum How to use checksums |
12479862ae0ff67d3fc3adc1d5167c77f13f2d4faa3ae959c40b99ec53d984b8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / cultivars_engine-0.0.5-py3-none-any.whl
| Download URL | cultivars_engine-0.0.5-py3-none-any.whl |
|---|---|
| Size | 496.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e5ba67f3d1e08d58997303cb3b3ab8b1de155645944521ec93012895d54f59db
|
|
BLAKE2b-256 checksum How to use checksums |
3fe5f4a94cd932d630e60861006dcc0eb18f8bb2c9bb72964e6d453e183e7c72
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for cultivars-engine 0.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.