Fast fatigue cycle-counting algorithms implemented in modern C++ with Python bindings.
Warning
This project is under active development. Its public API is not yet stable, and it has not been independently validated or certified for safety-critical engineering use.
fatigue-cycle-counting seeks to deliver clear, efficient, and well-tested implementations of the ASTM E1049-85 fatigue
cycle-counting methods.
The numerical core is written in C++20, with Python bindings provided through pybind11. The native implementation is being developed as a reusable library rather than embedding the counting logic directly within the Python interface.
The project is intended for engineers, researchers, and developers who need cycle-counting functionality without placing the performance-critical implementation in Python.
The principal design objectives are:
- correct and explicitly described algorithm behaviour;
- a small, typed Python interface;
- a reusable native C++ core;
- predictable memory use and minimal unnecessary copying;
- comprehensive tests against independently derived reference cases; and
- reproducible source builds and binary wheels across supported platforms.
The package is currently in early development. Packaging, native-module loading, typing infrastructure, and the build system are in place, but the public counting API is not yet stable.
The planned scope includes:
- level-crossing counting;
- restricted level-crossing counting;
- peak counting;
- simple-range counting;
- range-pair counting;
- rainflow counting; and
- simple rainflow counting.
Supporting preprocessing operations, including the removal of consecutive duplicate values and the identification of reversals, will be implemented where required by the counting methods.
The scope, interfaces, and returned data structures may change during development. Production systems should not rely upon the current API without pinning an exact release and independently checking its behaviour.
The project is intended as an independent implementation of cycle-counting methods described in the engineering literature and associated with ASTM E1049-85, Standard Practices for Cycle Counting in Fatigue Analysis.
ASTM International does not sponsor, approve or endorse this project. This repository does not reproduce the standard, and it is not a substitute for obtaining and reading the applicable edition from ASTM International.
Planned validation includes:
- independently derived examples with analytically verifiable results;
- comparison between native and Python-facing behaviour;
- edge cases, including empty, constant, repeated-value, and minimal-length series;
- malformed-input and non-finite-value handling;
- conservation and consistency properties where applicable; and
- cross-platform testing across supported compilers and Python versions.
Published tests demonstrate only the cases that have been tested. Test coverage does not establish that the software is suitable for a particular engineering assessment or that its behaviour is identical to every interpretation or implementation of the referenced methods.
Fatigue assessment can influence safety-critical decisions. Cycle counts produced by this software must be reviewed and independently validated by a suitably qualified person before being used for design, integrity management, remaining-life assessment, or any other decision where incorrect results could cause injury, loss of life, environmental damage, property damage, or financial loss.
Users are responsible for:
- selecting an appropriate counting method;
- understanding the assumptions and limitations of the selected method;
- confirming input units, sign conventions, preprocessing, and sampling quality;
- validating results against applicable standards, procedures, and independent calculations;
- determining whether the software is suitable for the intended application; and
- complying with all applicable engineering, legal, and regulatory requirements.
This notice supplements, but does not replace, the warranty and liability disclaimer in the licence.
Original project code is licensed under the permissive BSD 2-Clause License.
The Python extension contains pybind11 code under the BSD 3-Clause License. Its copyright notice and full licence text
are provided in THIRD_PARTY_LICENSES.
Commercial use, modification, and redistribution are permitted subject to the applicable licence notices and
conditions. See LICENSE and THIRD_PARTY_LICENSES for the complete terms.
Copyright (c) 2026 Jack James Dawson.