Skip to content

Commit

Permalink
Correct README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Janiszewski committed Dec 6, 2016
2 parents e3a32bd + 7f7eceb commit 8e96175
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ Rainflow is a Python implementation of the rainflow cycle counting algorythm
for fatigue analysis according to ASTM E1049-85. No dependencies beside Python's
standard library. Supports both Python 2 and 3.

Basic usage
-----------
Let's generate a sample time series of some load (here we create a numpy array
but any iterable of numbers would work):
Usage
-----
Let's generate a sample time series of some load. Here we create a numpy array but any iterable of numbers would work:
```python
>>> import numpy as np
>>> x = np.linspace(0, 4, 200)
Expand All @@ -19,15 +18,15 @@ Function `count_cycles` returns a sorted list of the load ranges and the corresp
number of cycles:
```python
>>> import rainflow
>>> cycles = rainflow.extract_cycles(y)
>>> rainflow.count_cycles(y)
[(0.11022406179686783, 1.0), (0.11316419853821802, 0.5), (0.20607635324664902, 1.0),
(0.2148070281383265, 0.5), (0.36749670533564682, 0.5), (0.4389628182518176, 0.5),
(0.48294318988133728, 0.5), (0.52799626197601901, 0.5), (0.78150280937784777, 0.5),
(1.102640610792428, 0.5)]
```
Not interested in all the decimals? Use *ndigits*:
```python
>>> cycles = rainflow.extract_cycles(y, ndigits=2)
>>> rainflow.count_cycles(y, ndigits=2)
[(0.11, 1.5), (0.21, 1.5), (0.37, 0.5), (0.44, 0.5), (0.48, 0.5), (0.53, 0.5),
(0.78, 0.5), (1.1, 0.5)]
```

0 comments on commit 8e96175

Please sign in to comment.