Skip to content

Commit 9a57d55

Browse files
Merge branch 'master' into develop
Signed-off-by: Johannes Mueller <[email protected]>
2 parents e971770 + 31c59b6 commit 9a57d55

File tree

11 files changed

+488
-111
lines changed

11 files changed

+488
-111
lines changed

CHANGELOG.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,17 @@
33
In this file noteworthy changes of new releases of pyLife are documented since
44
2.0.0.
55

6-
## unreleased
6+
## pylife-2.1.2
7+
8+
### New features
9+
10+
* New method `LoadCollective.histogram()` (#107)
711

812
### Improvements
913

1014
* Sanitize checks for Wöhler analysis (#108)
15+
* Error messages when odbclient gets unsupported element types (#64)
16+
* Improved documentation
1117

1218
### Bugfixes
1319

README.md

+9-6
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,15 @@ based on pyLife code.
3131

3232
## Status
3333

34-
pyLife-2.1.1 has been released. That means that for the time being we hope
35-
that we will not introduce *breaking* changes. That does not mean that the
36-
release is stable finished and perfect. We will do small improvements,
37-
especially with respect to documentation in the upcoming months and release
38-
them as 2.1.x releases. Once we have noticeable feature additions we will come
39-
up with a 2.x.0 release. No ETA about that.
34+
pyLife-2.1.x is the current release the you get by default. We are doing small
35+
improvements, in the pyLife-2.1.x branch (`master`) while developing the more
36+
vast features in the 2.2.x branch (`develop`).
37+
38+
The main new features of the 2.2.x branch is about FKM functionality. As that
39+
is quite a comprehensive addition we would need some time to get it right
40+
before we can release it as default release.
41+
42+
Once 2.2.x is released we will probably stick to a one branch development.
4043

4144
## Contents
4245

setup.cfg

+4-1
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,18 @@ extras =
118118
# Comment those flags to avoid this py.test issue.
119119
addopts =
120120
--cov src/pylife --cov-append -m "not slow_acceptance and not demos"
121+
--doctest-modules
122+
--ignore=src/pylife/materialdata/woehler/bayesian.py
121123

122124
norecursedirs =
123125
dist
124126
build
125127
.tox
126-
testpaths = tests
128+
testpaths = tests src/pylife
127129
markers =
128130
slow_acceptance: long running acceptance test (not run by default)
129131
demos: demo notebooks by testbook
132+
doctest_optionflags = NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL
130133

131134
[bdist_wheel]
132135
# Use this option if your package is pure-python

src/pylife/core/pylifesignal.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -273,10 +273,11 @@ def __init__(self, obj):
273273
def bar(df):
274274
return pd.DataFrame({'baz': df['foo'] + df['bar']})
275275
276-
>>> df = pd.DataFrame({'foo': [1.0, 2.0], 'bar': [-1.0, -2.0]})
277-
>>> df.foo.bar()
278-
baz
279-
0 0.0
280-
1 0.0
276+
df = pd.DataFrame({'foo': [1.0, 2.0], 'bar': [-1.0, -2.0]})
277+
df.foo.bar()
278+
279+
baz
280+
0 0.0
281+
1 0.0
281282
"""
282283
return cls._register_method(method_name)

src/pylife/materialdata/woehler/bayesian.py

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
__author__ = "Mustapha Kassem"
3535
__maintainer__ = "Johannes Mueller"
3636

37+
3738
raise NotImplementedError(
3839
"pyLife's Bayesian Wöhler analyzer has been shutdown. "
3940
"See documentation for details."

src/pylife/mesh/meshsignal.py

+30-16
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,25 @@
3030
--------
3131
Read in a mesh from a vmap file:
3232
33-
34-
>>> df = (vm = pylife.vmap.VMAPImport('demos/plate_with_hole.vmap')
35-
.make_mesh('1', 'STATE-2')
36-
.join_variable('STRESS_CAUCHY')
37-
.join_variable('DISPLACEMENT')
38-
.to_frame())
33+
>>> from pylife.vmap import VMAPImport
34+
>>> df = (
35+
... VMAPImport('demos/plate_with_hole.vmap')
36+
... .make_mesh('1', 'STATE-2')
37+
... .join_coordinates()
38+
... .join_variable('STRESS_CAUCHY')
39+
... .join_variable('DISPLACEMENT')
40+
... .to_frame()
41+
... )
3942
>>> df.head()
40-
x y z S11 S22 S33 S12 S13 S23 dx dy dz
41-
element_id node_id
42-
1 1734 14.897208 5.269875 0.0 27.080811 6.927080 0.0 -13.687358 0.0 0.0 0.005345 0.000015 0.0
43-
1582 14.555333 5.355806 0.0 28.319006 1.178649 0.0 -10.732705 0.0 0.0 0.005285 0.000003 0.0
44-
1596 14.630658 4.908741 0.0 47.701195 5.512213 0.0 -17.866833 0.0 0.0 0.005376 0.000019 0.0
45-
4923 14.726271 5.312840 0.0 27.699907 4.052865 0.0 -12.210032 0.0 0.0 0.005315 0.000009 0.0
46-
4924 14.592996 5.132274 0.0 38.010101 3.345431 0.0 -14.299768 0.0 0.0 0.005326 0.000013 0.0
43+
x y z ... dx dy dz
44+
element_id node_id ...
45+
1 1734 14.897208 5.269875 0.0 ... 0.005345 0.000015 0.0
46+
1582 14.555333 5.355806 0.0 ... 0.005285 0.000003 0.0
47+
1596 14.630658 4.908741 0.0 ... 0.005376 0.000019 0.0
48+
4923 14.726271 5.312840 0.0 ... 0.005315 0.000009 0.0
49+
4924 14.592996 5.132274 0.0 ... 0.005326 0.000013 0.0
50+
<BLANKLINE>
51+
[5 rows x 12 columns]
4752
4853
Get the coordinates of the mesh.
4954
@@ -210,10 +215,19 @@ def vtk_data(self):
210215
Example
211216
-------
212217
>>> import pyvista as pv
213-
>>> grid = pv.UnstructuredGrid(*our_mesh.mesh.vtk_data())
218+
>>> from pylife.vmap import VMAPImport
219+
>>> df = (
220+
... VMAPImport('demos/plate_with_hole.vmap')
221+
... .make_mesh('1', 'STATE-2')
222+
... .join_coordinates()
223+
... .join_variable('STRESS_CAUCHY')
224+
... .to_frame()
225+
... )
226+
227+
>>> grid = pv.UnstructuredGrid(*df.mesh.vtk_data())
214228
>>> plotter = pv.Plotter(window_size=[1920, 1080])
215-
>>> plotter.add_mesh(grid, scalars=our_mesh.groupby('element_id')['val'].mean().to_numpy())
216-
>>> plotter.show()
229+
>>> plotter.add_mesh(grid, scalars=df.groupby('element_id')['S11'].mean().to_numpy()) # doctest: +SKIP
230+
>>> plotter.show() # doctest: +SKIP
217231
218232
Note the `*` that needs to be added when calling ``pv.UnstructuredGrid()``.
219233
"""

src/pylife/strength/meanstress.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ def from_dict(cls, segments_dict):
5959
6060
Example
6161
-------
62-
>>> hd = MST.HaighDiagram.from_dict({
63-
>>> (1.0, np.inf): 0.0,
64-
>>> (-np.inf, 0.0): 0.5,
65-
>>> (0.0, 1.0): 0.167
66-
>>> })
62+
>>> hd = HaighDiagram.from_dict({
63+
... (1.0, np.inf): 0.0,
64+
... (-np.inf, 0.0): 0.5,
65+
... (0.0, 1.0): 0.167
66+
... })
6767
6868
sets up a FKM Goodman like Haigh diagram.
6969
"""

0 commit comments

Comments
 (0)