A lightweight ergonomics python library
Project description
pyergo
pyergo is a lightweight Python package for ergonomics research, with an emphasis on
mechanistic models of cumulative damage arising from repeated or sustained loading.
The package is designed to support:
- reproducible fatigue and injury-risk modelling,
- transparent links between analytic theory and numerical simulation,
- ergonomic and biomechanical research workflows where clarity and extensibility matter.
At present, pyergo focuses on cumulative damage models derived from the fatigue and
mechanobiology literature. The longer-term vision is a broader ecosystem of ergonomics
and exposure-modelling tools built on the same principles.
Installation
At the moment, installation is source-based:
git clone https://github.com/your-org/pyergo.git
cd pyergo
pip install -e .
A PyPI release may follow once the API stabilizes.
A Primer on Cumulative Damage Models
Many ergonomic risk metrics are based on cumulative load, such as total force exposure or integrated joint moments. While useful, cumulative load is not the same as cumulative damage.
Cumulative damage models instead describe how tissue integrity evolves over time as a function of applied load, often via a differential equation of the form:
[ \frac{dD}{dN} = f(D, F) ]
where:
- (D \in [0,1]) is cumulative damage (with (D=1) indicating failure),
- (F) is the applied force or load,
- (N) is the number of cycles or repetitions.
Such models naturally capture:
- nonlinear load sensitivity,
- history dependence,
- threshold-like behavior near failure,
- differences between short-term tolerance and long-term fatigue.
Implemented Damage Models
All damage models inherit from a common base class:
from pyergo.damage_models.base import DamageModel
Miner–Palmgren
from pyergo.damage_models.miner_palmgren import MinerPalmgren
A classic linear damage accumulation rule, often written as:
[ \frac{dD}{dN} = \frac{1}{N^*(F)} ]
where (N^*(F)) is an empirical S–N curve.
This model is simple and interpretable, but does not capture nonlinear degradation or load–damage interactions.
Barrett–Callaghan Model
from pyergo.damage_models.barrett_callaghan import BarrettCallaghan
This model implements a nonlinear cumulative damage law derived from a Tobolsky–Eyring–type rate process:
[ \frac{dQ}{dN} = -A Q \exp\left(\frac{B F}{Q}\right), \quad D = 1 - Q ]
Key features:
- analytic S–N curve via the exponential integral,
- well-defined ultimate and instantaneous tolerances,
- threshold-like behavior near catastrophic failure,
- clear distinction between cumulative load and cumulative damage.
This model is described and analyzed in detail in the associated paper (see below).
LiFFT
from pyergo.damage_models.lifft import LiFFT
An implementation of the LiFFT cumulative damage model originally introduced by Gallagher et al. (2017). In this framework, damage accumulates exponentially with load relative to an ultimate tolerance.
The LiFFT model can be interpreted as a special case of a Miner–Palmgren rule with an exponential S–N curve, and is included here for comparison and compatibility with existing ergonomic tools.
Simulation Interface
All models support a common simulation interface:
damage = model.simulate(
force_timeseries,
initstate=0.0,
dt=1.0,
method="rk4",
)
Features:
- Euler or RK4 time integration,
- automatic clipping at failure (
D = 1), - reproducible and testable numerical behavior.
For constant loading, analytic expressions for cycles to failure are also available where applicable.
Units System
pyergo includes a minimal, lightweight units system designed for numerical ergonomics
workflows.
from pyergo import Units, UnitsError
Example usage:
force = 2.0 * Units.kN
time = 5.0 * Units.minute
speed = 3.0 * Units.m / Units.s
Key design goals:
- quantities evaluate to plain floats in the current base unit system,
- base units (length, time, mass) can be changed globally,
- no runtime overhead from tracking units during numerical computation.
This approach keeps simulations fast while preserving clarity at model boundaries.
Citation
If you use the Barrett–Callaghan damage model or related analyses, please cite:
Barrett, J. M., & Callaghan, J. P.
A mechanistic model of cumulative damage under repetitive loading.
Journal of Biomechanics, 2025.
https://www.sciencedirect.com/science/article/pii/S0925753525003248
A BibTeX entry will be added here in a future release.
Scope and Philosophy
pyergo is intentionally:
- mechanistic, not purely empirical,
- explicit, not heuristic-heavy,
- numerically conservative, favoring clarity over cleverness.
The goal is not to replace existing ergonomic tools, but to provide a transparent foundation for research, comparison, and theory-driven model development.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyergo-0.1.3.tar.gz.
File metadata
- Download URL: pyergo-0.1.3.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c31423f77ffa1890fa4407dc9339625d40fe87662996ca8692e605e7a06b271b
|
|
| MD5 |
a32d1d39fb9427ea2aff5523d532b656
|
|
| BLAKE2b-256 |
ce713e527b538b5b7b7ec325808aa5512c8d9e0b15b562a2a6f77f09e2e32bce
|
File details
Details for the file pyergo-0.1.3-py3-none-any.whl.
File metadata
- Download URL: pyergo-0.1.3-py3-none-any.whl
- Upload date:
- Size: 12.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e4596ba593de2ba4ea5d3578ac106e5dfe4853ba5bf3e01887c24b9b9cba1c7
|
|
| MD5 |
db87e67537c20bdf92b3ce51363a2c9b
|
|
| BLAKE2b-256 |
3b8d1bc37cbaf04a4855ecc55c2fd2911da9831ca01af7c17717da35612c4860
|