How microprediction/timemachines works
Project type and purpose
• This is an open-source Python library (“timemachines”) providing a uniform, pure-function API for univariate time-series forecasting.
• It wraps many external forecasting engines (“skaters”)—e.g. statsmodels, Prophet, Darts—behind a consistent interface for benchmarking, ensemble, composition, etc.
High-level architectural components
a. Core API layer
• entrypoint module (timemachines/skating.py)
• interface contract for all skaters: f(y, s, k, a, t, e, r) → (xt, xt_std, s′)
b. Skater inclusion layer
• timemachines/inclusion: adapters that import and configure external packages
• each inclusion module registers functions and default hyper-parameters
c. Skater implementations
• timemachines/skaters: subpackages per engine (ats, bats, divine, dlm, darts, etc.)
• factory modules (…factory.py) and collections (all<engine>skaters.py)
d. Supporting toolkits
• timemachines/skatertools: batch processing, combining forecasts, sampling, tuning, visualization
e. Examples & documentation
• examples/: runnable demos organized by use-case
• docs/: static site source, assets, articles
f. Tests & CI
• tests/: per-engine and core tests ensuring integration and correctness
• .github/workflows/, .travis.yml: automated testing across external dependencies
g. Packaging
• setup.py, requirements.txt, INSTALL.md
• CONTRIBUTION guides, license, README
Relationships & data flow
• User code → Core API (skating.py)
• Core API calls one or more skater implementations
• Each skater module imports its inclusion adapter to interface with the external library
• Outputs propagated back to the user
• Skatertools can wrap sets of skaters for ensembling, tuning, evaluation
• CI pipelines trigger tests across all external backends
Architectural patterns & design principles
• Plugin/adaptor pattern: each external package is wrapped by an inclusion module
• Stateless functional API: each call passes in state, returns new state
• Factory pattern: central registry of available skaters, dynamically instantiated
• Separation of concerns: core interface, inclusion adapters, skater logic, utilities, tests, docs
Details
• Don’t omit the dynamic factory/registry in timemachines/skaters/allskaters.py
• Functional-stateless pattern (state in → state out)
• How new inclusion modules drop into timemachines/inclusion for plugin discovery