{"id":4655,"library":"numpy-rms","title":"NumPy RMS","description":"numpy-rms is a fast Python library designed for calculating the Root Mean Square (RMS) of NumPy arrays. It leverages C implementations with SIMD acceleration (AVX on x86-64, NEON on ARM) to provide significant performance benefits, especially for 1-dimensional and 2-dimensional C-contiguous float32 arrays. The current version is 0.6.0, with a fairly active release cadence.","status":"active","version":"0.6.0","language":"en","source_language":"en","source_url":"https://github.com/nomonosound/numpy-rms","tags":["numpy","rms","signal processing","performance","SIMD","audio"],"install":[{"cmd":"pip install numpy-rms","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"Core functionality relies on NumPy arrays and its C API.","package":"numpy","optional":false}],"imports":[{"note":"The primary RMS function is typically accessed via the top-level `numpy_rms` module, rather than direct import.","wrong":"from numpy_rms import rms","symbol":"rms","correct":"import numpy_rms\nrms_value = numpy_rms.rms(arr, window_size=10)"}],"quickstart":{"code":"import numpy_rms\nimport numpy as np\n\narr = np.arange(40, dtype=np.float32)\nrms_series = numpy_rms.rms(arr, window_size=10)\nprint(f\"Original array shape: {arr.shape}\")\nprint(f\"RMS series shape: {rms_series.shape}\")\nprint(f\"First few RMS values: {rms_series[:5]}\")","lang":"python","description":"This quickstart demonstrates how to import `numpy_rms` and calculate a series of RMS values for a 1D NumPy array with a specified window size. Ensure your input array is `float32` for optimal performance."},"warnings":[{"fix":"Ensure input arrays are `np.float32` and, if performance is critical, check array contiguity using `array.flags['C_CONTIGUOUS']`.","message":"The library is specifically optimized for C-contiguous 1-dimensional and 2-dimensional NumPy arrays of `float32` dtype. Using other data types (e.g., `float64`) or non-contiguous array layouts might lead to reduced performance or unexpected behavior compared to its advertised speed.","severity":"gotcha","affected_versions":"All versions"},{"fix":"After upgrading NumPy to a major new version, always check for a `numpy-rms` release compatible with that NumPy version. Reinstalling `numpy-rms` (e.g., `pip install --upgrade --force-reinstall numpy-rms`) might resolve some ABI issues by forcing a rebuild against the current NumPy.","message":"As `numpy-rms` is implemented in C and interacts with NumPy's C API, major NumPy version updates (e.g., NumPy 2.0 and above) can introduce Application Binary Interface (ABI) incompatibilities. This may require `numpy-rms` to be rebuilt or updated by its maintainers to ensure compatibility, potentially causing `ImportError` or runtime issues if using an older `numpy-rms` binary with a new NumPy version.","severity":"gotcha","affected_versions":"All versions (especially with NumPy 2.0+)"},{"fix":"Review the `CHANGELOG.md` or release notes before updating `numpy-rms` to new minor versions, and ensure your code is adequately tested.","message":"The project is currently classified with a 'Development Status :: 3 - Alpha' on PyPI. This indicates that while functional, the API may not be entirely stable and could undergo breaking changes in future minor releases, even if semver is generally followed.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}