Skip to content

Commit b8a60e5

Browse files
Small docs improvement
Signed-off-by: Johannes Mueller <johannes.mueller4@de.bosch.com>
1 parent ec65159 commit b8a60e5

File tree

2 files changed

+43
-10
lines changed

2 files changed

+43
-10
lines changed

INSTALLATION.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ on how to do that. The newly created environment must be activated.
2525

2626
The following command lines should do it
2727
```
28-
conda create -n pylife-env python=3.11 --yes
28+
conda create -n pylife-env python=3.12 --yes
2929
conda activate pylife-env
3030
```
3131

@@ -41,7 +41,7 @@ That's not recommended. If you really want to do that, you probably know how to
4141
do it.
4242

4343

44-
### pip install
44+
### Install the pyLife package
4545

4646
The simplest way to install pyLife is just using the pip package
4747
```
@@ -75,7 +75,7 @@ Create an environment – usually a good idea to use a prefixed environment in
7575
your pyLife working directory and activate it.
7676

7777
```
78-
conda create -p .venv python=3.11 pip --yes
78+
conda create -p .venv python=3.12 pip --yes
7979
conda activate ./.venv
8080
```
8181

@@ -94,7 +94,7 @@ pytest
9494

9595
If it creates an output ending like below, the installation was successful.
9696
```
97-
================ 228 passed, 1 deselected, 13 warnings in 30.45s ===============
97+
================ 1171 passed, 7 skipped, 6 deselected, 3 warnings in 23.06s ===============
9898
```
9999

100100
There might be some `DeprecationWarning`s. Ignore them for now.

demos/load_collective.ipynb

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"source": [
88
"# Load Collectives and Load Histograms\n",
99
"\n",
10-
"From the load (stress) side pyLife provides the classes `LoadCollective` and `LoadHistogram` to deal with load collectives. `LoadCollective` contains individal hysteresis loops whereas `LoadHistogram` contains a 2D-histogram of classes of hysteresis loops and the number of cycles with which they occur."
10+
"From the load (stress) side pyLife provides the classes [`LoadCollective`](https://pylife.readthedocs.io/en/stable/stress/load_collective.html) and [`LoadHistogram`](https://pylife.readthedocs.io/en/stable/stress/load_histogram.html) to deal with load collectives. `LoadCollective` contains individal hysteresis loops whereas `LoadHistogram` contains a 2D-histogram of classes of hysteresis loops and the number of cycles with which they occur."
1111
]
1212
},
1313
{
@@ -93,7 +93,7 @@
9393
"id": "31b400a3",
9494
"metadata": {},
9595
"source": [
96-
"As you can see, the rainflow analysis found five histresis loops, three from 1.0 to -1.0 and two from -2.0 to 2.0. Alternatively you can ask the recorder for a load histogram:"
96+
"As you can see, the rainflow analysis found five hystresis loops, three from 1.0 to -1.0 and two from -2.0 to 2.0. Alternatively you can ask the recorder for a load histogram:"
9797
]
9898
},
9999
{
@@ -293,12 +293,36 @@
293293
"plt.pcolormesh(X, Y, numpy_hist)"
294294
]
295295
},
296+
{
297+
"cell_type": "markdown",
298+
"id": "cf99a42b-3075-42e5-87c3-2d99ab55a681",
299+
"metadata": {},
300+
"source": [
301+
"In order to use this load histogram for a damage calculation we can perform a mean stress transformation to transorm all the hysteresis loops to one given R-value."
302+
]
303+
},
304+
{
305+
"cell_type": "code",
306+
"execution_count": null,
307+
"id": "a0d06dfd-2dd9-4689-b230-67c102220e31",
308+
"metadata": {},
309+
"outputs": [],
310+
"source": [
311+
"meanstress_sensitivity = pd.Series({\n",
312+
" 'M': 0.3,\n",
313+
" 'M2': 0.2\n",
314+
"})\n",
315+
"\n",
316+
"transformed_histogram = histogram.meanstress_transform.fkm_goodman(meanstress_sensitivity, R_goal=-1)\n",
317+
"transformed_histogram.to_pandas()"
318+
]
319+
},
296320
{
297321
"cell_type": "markdown",
298322
"id": "0f505f1a",
299323
"metadata": {},
300324
"source": [
301-
"We can also plot the cumulated version of the histogram. Therefor we put the amplitude and the cycles into a dataframe."
325+
"We can also plot the cumulated version of the histogram. Therefore we put the amplitude and the cycles into a dataframe."
302326
]
303327
},
304328
{
@@ -309,8 +333,8 @@
309333
"outputs": [],
310334
"source": [
311335
"df = pd.DataFrame({\n",
312-
" 'cycles': histogram.load_collective.cycles, \n",
313-
" 'amplitude': histogram.load_collective.amplitude, \n",
336+
" 'cycles': transformed_histogram.cycles, \n",
337+
" 'amplitude': transformed_histogram.amplitude, \n",
314338
"}).sort_values('amplitude', ascending=False)"
315339
]
316340
},
@@ -332,6 +356,14 @@
332356
"plt.plot(np.cumsum(df.cycles), df.amplitude)\n",
333357
"plt.loglog()"
334358
]
359+
},
360+
{
361+
"cell_type": "markdown",
362+
"id": "7d3e056d-7579-4fca-bc40-5687f3779eb1",
363+
"metadata": {},
364+
"source": [
365+
" "
366+
]
335367
}
336368
],
337369
"metadata": {
@@ -349,7 +381,8 @@
349381
"mimetype": "text/x-python",
350382
"name": "python",
351383
"nbconvert_exporter": "python",
352-
"pygments_lexer": "ipython3"
384+
"pygments_lexer": "ipython3",
385+
"version": "3.12.4"
353386
}
354387
},
355388
"nbformat": 4,

0 commit comments

Comments
 (0)