{"id":46013,"library":"rainflow","title":"Rainflow","description":"Implementation of the ASTM E1049-85 rainflow cycle counting algorithm for fatigue analysis. Current version: 3.2.0, requires Python >=3.7. Releases are infrequent, no major changes recently.","status":"active","version":"3.2.0","language":"python","source_language":"en","source_url":"https://github.com/iamlikeme/rainflow","tags":["fatigue","rainflow","cycle counting","asmt"],"install":[{"cmd":"pip install rainflow","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Numerical dependency for array operations","package":"numpy","optional":false}],"imports":[{"note":"The main function is not a class.","wrong":"from rainflow import Rainflow","symbol":"count_cycles","correct":"from rainflow import count_cycles"}],"quickstart":{"code":"import numpy as np\nfrom rainflow import count_cycles\n\n# Example signal\nsignal = np.array([0, 1, -1, 2, -2, 3, -3, 2, -2, 1, -1, 0])\ncycles = count_cycles(signal)\nprint(cycles)","lang":"python","description":"Count rainflow cycles from a 1D array of turning points."},"warnings":[{"fix":"Use `extract_turning_points()` to preprocess data if needed.","message":"Input should be a sequence of turning points (peaks and valleys), not a raw time series. The algorithm expects extrema only.","severity":"gotcha","affected_versions":"all"},{"fix":"Check your fatigue analysis literature: ASTM E1049 defines the range as the difference between peak and valley (full range). rainflow returns half the range (amplitude).","message":"The `count_cycles` function returns cycles as a list of tuples (range, mean, count). The range is half the actual stress range (amplitude) if you're used to other conventions.","severity":"gotcha","affected_versions":"all"},{"fix":"Replace `from rainflow import cycle_count` with `from rainflow import count_cycles`.","message":"`rainflow.cycle_count` function was deprecated in v3.0 and removed in v3.1. Use `count_cycles` instead.","severity":"deprecated","affected_versions":">=3.0,<3.1"}],"env_vars":null,"search_vec":"'-85':7 '3.2.0':17 '3.7':20 'algorithm':11 'analysi':14 'asmt':32 'astm':5 'chang':26 'count':10,31 'current':15 'cycl':9,30 'e1049':6 'fatigu':13,28 'implement':2 'infrequ':23 'major':25 'python':19 'rainflow':1,8,29 'recent':27 'releas':21 'requir':18 'version':16","created_at":"2026-06-07T12:57:50.750968+00:00","updated_at":"2026-06-07T12:57:50.750968+00:00","problems":[{"fix":"Use `from rainflow import count_cycles` or `from rainflow import extract_turning_points`.","cause":"The library does not export a class named Rainflow; only functions are available.","error":"AttributeError: module 'rainflow' has no attribute 'Rainflow'"},{"fix":"Use `count_cycles` instead.","cause":"`cycle_count` was removed in v3.1.","error":"ImportError: cannot import name 'cycle_count' from 'rainflow'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/iamlikeme/rainflow","github":"https://github.com/iamlikeme/rainflow","docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["analytics"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}