Registry / data / kim-convergence

kim-convergence

JSON →
library0.0.3pypypi✓ verified 83d ago

kim-convergence is a Python library designed to assist in the automatic detection of equilibration and control of run lengths in simulations or data streams. It provides tools to determine when a time series of data has reached a steady state or converged. The current version is 0.0.3, with releases happening infrequently as major improvements or compatibility updates are needed.

pip install kim-convergence
INSTALL
IMPORT
SIG · KIM-CONVERGENCE
K
kim-convergence
datapythonv0.0.3
Install
7.8s avg
Import
Disk
233MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.0.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 233.9MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 7.8s · import 0.000s · 225MB
233MB installed
● package 233MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CRError
from kim_convergence import CRError
from kim_convergence import ConvergenceDetector
HeidelbergerWelch
from kim_convergence import HeidelbergerWelch
from kim_convergence import ConvergenceDetector
MSER_m
from kim_convergence import MSER_m
from kim_convergence import ConvergenceDetector

This quickstart demonstrates how to use `ConvergenceDetector` to identify the point at which a time series of data converges. It initializes a detector with 'rmse' criteria, a window size, and a threshold, then applies it to a sample 2D NumPy array.

import numpy as np from kim_convergence import ConvergenceDetector # Generate some example converging data (e.g., from a simulation) np.random.seed(42) time_series_data = np.concatenate([ np.random.rand(50, 2) + np.array([10.0, 20.0]), # Initial transient np.random.rand(50, 2) * 0.1 + np.array([10.5, 20.5]) # Converged state ]) # Initialize the detector with desired criteria # 'rmse' (Root Mean Square Error) is a common choice detector = ConvergenceDetector( criteria='rmse', window_size=10, # Number of data points in the comparison windows threshold=0.1 # Maximum allowed difference for convergence ) # Detect convergence convergence_step = detector.detect_convergence(time_series_data) if convergence_step is not None: print(f"Convergence detected at step: {convergence_step}") print(f"Data considered converged from index: {convergence_step}") else: print("Convergence not detected within the given time series.")
Debug
Known issues
breakingOlder versions of kim-convergence (< 0.0.3) are not compatible with NumPy versions 2.0 and later due to changes in NumPy's internal API (e.g., `np.NINF` removal).
fix
Upgrade kim-convergence to version 0.0.3 or higher: `pip install --upgrade kim-convergence`.
affects: < 0.0.3
gotchaThe `detect_convergence` method expects a 2D NumPy array for the `time_series` input. Passing a 1D array or a list of lists will result in a `ValueError` or unexpected behavior.
fix
Ensure your input data is a 2D NumPy array. For a single variable time series, use `np.array(your_1d_list).reshape(-1, 1)` to convert it to a 2D array with a single column.
affects: All versions
Upgrade
Version history
0.0.3latest on PyPI · released Jul 28, 2025
Audit
Dependencies
numpyrequiredCore numerical operations and array handling.
scipyrequiredUsed for statistical tests like Levene's test if specified as a convergence criterion.
Agent activity
5 hits · last 30 days
node
4
Resources
kim-convergence — pip install kim-convergence · libregistry