coreforecast 0.0.20


pip install coreforecast

  Latest version

Released: Nov 03, 2026


Meta
Author: Jose Morales
Requires Python: >=3.11

Classifiers

Development Status
  • 3 - Alpha

Intended Audience
  • Science/Research

License
  • OSI Approved :: Apache Software License

Natural Language
  • English

Programming Language
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13
  • Python :: 3.14
  • Python :: 3.15
  • Python :: Free Threading :: 2 - Beta

Motivation

At Nixtla we have implemented several libraries to deal with time series data. We often have to apply some transformation over all of the series, which can prove time consuming even for simple operations like performing some kind of scaling.

We've used numba to speed up our expensive computations, however that comes with other issues such as cold starts and more dependencies (LLVM). That's why we developed this library, which implements several operators in C++ to transform time series data (or other kind of data that can be thought of as independent groups), with the possibility to use multithreading to get the best performance possible.

You probably won't need to use this library directly but rather use one of our higher level libraries like mlforecast, which will use this library under the hood. If you're interested on using this library directly (only depends on numpy) you should continue reading.

Installation

PyPI

pip install coreforecast

conda-forge

conda install -c conda-forge coreforecast

Minimal example

The base data structure is the "grouped array" which holds two numpy 1d arrays:

  • data: values of the series.
  • indptr: series boundaries such that data[indptr[i] : indptr[i + 1]] returns the i-th series. For example, if you have two series of sizes 5 and 10 the indptr would be [0, 5, 15].
import numpy as np
from coreforecast.grouped_array import GroupedArray

data = np.arange(10)
indptr = np.array([0, 3, 10])
ga = GroupedArray(data, indptr)

Once you have this structure you can run any of the provided transformations, for example:

from coreforecast.lag_transforms import ExpandingMean
from coreforecast.scalers import LocalStandardScaler

exp_mean = ExpandingMean(lag=1).transform(ga)
scaler = LocalStandardScaler().fit(ga)
standardized = scaler.transform(ga)

Multithreading

Every GroupedArray operation can split the groups across threads with num_threads, e.g. GroupedArray(data, indptr, num_threads=4). Each call starts its own threads, so calling it from several Python threads at once runs num_threads threads per call.

coreforecast also runs without the GIL on free-threaded Python (3.14t and later). A GroupedArray can be shared across threads as long as none of them modifies data or indptr while another one is using it. Setting num_threads is safe at any time; calls already running keep the thread count they started with. Transformations and scalers store what they learn in fit and transform, so give each thread its own instance.

Single-array functions

We've also implemented some functions that work on single arrays, you can refer to the following pages:

Wheel compatibility matrix

Platform CPython 3.11 CPython 3.12 CPython 3.13 CPython 3.14 CPython 3.15 CPython (additional flags: t) 3.14 CPython (additional flags: t) 3.15
macosx_10_13_x86_64
macosx_10_15_x86_64
macosx_10_9_x86_64
macosx_11_0_arm64
manylinux_2_27_aarch64
manylinux_2_27_x86_64
manylinux_2_28_aarch64
manylinux_2_28_x86_64
win_amd64
win_arm64

Files in release

coreforecast-0.0.20-cp311-cp311-macosx_10_9_x86_64.whl (280.1KiB)
coreforecast-0.0.20-cp311-cp311-macosx_11_0_arm64.whl (265.9KiB)
coreforecast-0.0.20-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (331.7KiB)
coreforecast-0.0.20-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (363.6KiB)
coreforecast-0.0.20-cp311-cp311-win_amd64.whl (440.0KiB)
coreforecast-0.0.20-cp311-cp311-win_arm64.whl (607.3KiB)
coreforecast-0.0.20-cp312-cp312-macosx_10_13_x86_64.whl (283.6KiB)
coreforecast-0.0.20-cp312-cp312-macosx_11_0_arm64.whl (267.1KiB)
coreforecast-0.0.20-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (332.3KiB)
coreforecast-0.0.20-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (364.2KiB)
coreforecast-0.0.20-cp312-cp312-win_amd64.whl (443.3KiB)
coreforecast-0.0.20-cp312-cp312-win_arm64.whl (611.9KiB)
coreforecast-0.0.20-cp313-cp313-macosx_10_13_x86_64.whl (283.6KiB)
coreforecast-0.0.20-cp313-cp313-macosx_11_0_arm64.whl (267.1KiB)
coreforecast-0.0.20-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (332.3KiB)
coreforecast-0.0.20-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (364.3KiB)
coreforecast-0.0.20-cp313-cp313-win_amd64.whl (443.3KiB)
coreforecast-0.0.20-cp313-cp313-win_arm64.whl (611.9KiB)
coreforecast-0.0.20-cp314-cp314-macosx_10_15_x86_64.whl (284.2KiB)
coreforecast-0.0.20-cp314-cp314-macosx_11_0_arm64.whl (268.0KiB)
coreforecast-0.0.20-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (333.5KiB)
coreforecast-0.0.20-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (364.9KiB)
coreforecast-0.0.20-cp314-cp314-win_amd64.whl (457.4KiB)
coreforecast-0.0.20-cp314-cp314-win_arm64.whl (629.2KiB)
coreforecast-0.0.20-cp314-cp314t-macosx_10_15_x86_64.whl (294.0KiB)
coreforecast-0.0.20-cp314-cp314t-macosx_11_0_arm64.whl (283.0KiB)
coreforecast-0.0.20-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (336.8KiB)
coreforecast-0.0.20-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (368.0KiB)
coreforecast-0.0.20-cp314-cp314t-win_amd64.whl (467.2KiB)
coreforecast-0.0.20-cp314-cp314t-win_arm64.whl (640.0KiB)
coreforecast-0.0.20-cp315-cp315-macosx_10_15_x86_64.whl (284.2KiB)
coreforecast-0.0.20-cp315-cp315-macosx_11_0_arm64.whl (268.0KiB)
coreforecast-0.0.20-cp315-cp315-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (333.5KiB)
coreforecast-0.0.20-cp315-cp315-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (364.9KiB)
coreforecast-0.0.20-cp315-cp315-win_amd64.whl (457.4KiB)
coreforecast-0.0.20-cp315-cp315-win_arm64.whl (629.1KiB)
coreforecast-0.0.20-cp315-cp315t-macosx_10_15_x86_64.whl (294.0KiB)
coreforecast-0.0.20-cp315-cp315t-macosx_11_0_arm64.whl (282.9KiB)
coreforecast-0.0.20-cp315-cp315t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (335.9KiB)
coreforecast-0.0.20-cp315-cp315t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (368.8KiB)
coreforecast-0.0.20-cp315-cp315t-win_amd64.whl (467.1KiB)
coreforecast-0.0.20-cp315-cp315t-win_arm64.whl (640.0KiB)
coreforecast-0.0.20.tar.gz (165.4KiB)
Extras: None
Dependencies:
numpy (>=1.20.0)