iam-git / WellMet (public) (License: MIT) (since 2021-08-31) (hash sha1)
WellMet is pure Python framework for spatial structural reliability analysis. Or, more specifically, for "failure probability estimation and detection of failure surfaces by adaptive sequential decomposition of the design domain".
List of commits:
Subject Hash Author Date (UTC)
add release metadata 78cf1298b7a8deb990139ea0a7e6f0fa82adf72a I am 2023-06-06 21:38:43
testcases: hotfix 34c9e54a40496fa4ff400aac0e8b299e2c312b04 I am 2023-05-31 17:26:27
qt_gui.qt_testcases: use more concise language 2fbba5ff7b94da07bbb80d21362fcf68ba590be5 I am 2023-05-31 17:01:35
testcases: clean up a little bit 979a70e10cda4786ef17d03217f5a57cd86a6ae9 I am 2023-05-31 16:57:49
g_models: fix quartic name, add parabola b80e98134d7a5c91ad9e44ad9b58e76ac0a3bb64 I am 2023-05-31 16:54:39
qt_gui.qt_gui: little tweaks 73c027858135753f99d2eabb3f080e936c4ff18d I am 2023-05-30 16:53:59
reader forgets Udmurt, learns English instead :'( 640ac860613b0d93fc037490c3a02da251eb8aca I am 2023-05-30 15:23:31
testcases: add __init__ file 0b942cd9028c3c5baea43aff61526b75c2f3ee43 I am 2023-05-28 14:04:55
mplot: add quiver plots a32b3d850fef99d6798b778140867416e17c16db I am 2023-03-30 13:21:30
mplot.mart: add simplex_vectors() function 7a90003e40bd459d2a3ef45a4867dfa392bd3fc8 I am 2023-03-30 13:20:10
simplex: use shares instead of probabilities in sinsitivity analysis 75ff4258b95fd568d1b4d163cdc04d40952e0029 I am 2023-03-16 18:46:44
whitebox.get_sensitivities: mask nans and infinities 1a754c51b3a1ef535e86b5b4cb6b75fe9e90840f I am 2023-03-14 22:33:52
simplex.SeparationAxis: fix previous commit 61abd70e69d2fecd74535738c96e74a634af0ad1 I am 2023-03-12 16:49:22
simplex.SeparationAxis: print linprog solution in case of an unexpected status af1aaac1dce3fbc51dc48418685d948a27cf72c6 I am 2023-03-12 15:18:07
g_models: add hyperbola LSF 5f6df35b4280a11c0df1d3cd110250305805ce66 I am 2023-03-12 15:07:20
simplex._Sense: implement piece of postprocessing to get unique vectors 4088852e703947643a8388b2ba8839a694211566 I am 2023-03-10 17:22:29
simplex.SeparationAxis: in case of an unexpected linprog status print result message too 1c9346233693533afb07022c78308b3be6ea9ec7 I am 2023-03-10 15:40:06
whitebox: implement method to .get_sensitivities() from 2D boundary 5729723cfe5c93658c3739fbfec384e135b44073 I am 2023-03-09 22:14:27
simplex.SeparationAxis: make an perfectionism-driven change 8278c48915c326e7731f1934732550c5b9c18e64 I am 2023-03-09 21:51:18
simplex.SeparationAxis: little fix for an hypotetical issue 838e476387c31f9c6847cf7ae8a2a01514038a03 I am 2023-03-09 15:19:48
Commit 78cf1298b7a8deb990139ea0a7e6f0fa82adf72a - add release metadata
Author: I am
Author date (UTC): 2023-06-06 21:38
Committer name: I am
Committer date (UTC): 2023-06-06 21:38
Parent(s): 34c9e54a40496fa4ff400aac0e8b299e2c312b04
Signer:
Signing key:
Signing status: N
Tree: c8f47bb83becfa7e336a861c6ad10c6b7cf128fb
File Lines added Lines deleted
README.md 166 4
cli_example.py 73 0
gui_example.py 46 0
pyproject.toml 3 0
setup.cfg 36 0
setup.py 4 0
File README.md changed (mode: 100644) (index b94faa2..c9a2ecc)
1 1 WellMet is pure Python framework for spatial structural reliability analysis. Or, more specifically, for "failure probability estimation and detection of failure surfaces by adaptive sequential decomposition of the design domain". WellMet is pure Python framework for spatial structural reliability analysis. Or, more specifically, for "failure probability estimation and detection of failure surfaces by adaptive sequential decomposition of the design domain".
2 2
3 Main dependencies are numpy+scipy, pandas, quadpy.
4 Qt frontend requires pyqtgraph.
3 # Installation
4 ## For users of conda-based distributions
5 Anaconda users are encouraged to manually install WellMet's dependencies:
6 ```
7 conda install -c anaconda scipy
8 conda install -c anaconda matplotlib
9 conda install -c anaconda pandas
10 conda install -c anaconda mpmath
11 conda install -c anaconda pyqtgraph
5 12
6 To run graphical frontend with predefined reliability problems type in shell: python -m wellmet
13 conda install -c conda-forge quadpy
14 ```
15 pyopengl for 3D view (optionally):
16 ```
17 conda install -c anaconda pyopengl
18 ```
7 19
8 The software has been developed as part of an internal academic project no. FAST-K-21-6943 sponsored by the Czech Ministry of Education, Youth and Sports and also by project named ``Quality Internal Grants of BUT (KInG BUT)'', Reg. No. CZ.02.2.69/0.0/0.0/19\_073/0016948, which is financed from the OP RDE.
20 Finally, install WellMet from PyPI:
21 ```
22 pip install wellmet
23 ```
24
25 ## For other users
26 Install WellMet from PyPI:
27 ```
28 pip install wellmet
29 ```
30
31 WellMet relies on ```quadpy``` for simplex integration. However, quadpy became a closed source software and requires licence fee now.
32 One probably could install official quadpy package and obtain a licence in order to support Nico Schloemer.
33 However, WellMet has never been tested with commertial quadpy versions.
34 So, we separately share the last GPL version:
35 ```
36 pip install quadpy-gpl
37 ```
38
39
40 # How to use:
41 ## A. To run GUI with predefined benchmark problems:
42 1. Type in shell: ```python -m wellmet```
43 2. Choose problem to solve, choose (optionally) filename to store samples and estimations, set up the algorithm.
44 3. Press "Batch run..." button and type desired number of LSF calls.
45
46 ## B. To test the algorithm on your own problem use the following code:
47 ```
48 import numpy as np
49 import scipy.stats as stats
50
51 from wellmet.qt_gui import qt_box_functions as gui
52 from wellmet import whitebox
53 from wellmet.samplebox import SampleBox
54 from wellmet import f_models
55
56
57 # 1. Set up probability distribution
58 # Standard Gaussian variables, 2D
59 #f = f_models.SNorm(2)
60 # Just normal variables
61 f = f_models.Norm(mean=[-1, 0], std=[2, 1])
62 # Independent non-Gaussian variables
63 #f = f_models.UnCorD((stats.gumbel_r, stats.uniform))
64 # Correlated non-Gaussian marginals
65 #f = f_models.Nataf((stats.gumbel_r, stats.weibull_min(c=1.5)), [[1,0.8], [0.8,1]])
66
67 # 2. Define LSF function
68 def my_problem(input_sample):
69 # get real (physical) space coordinates
70 # X is a numpy array with shape (nsim, ndim)
71 # the algorithm normally sends (1, ndim) sample
72 X = input_sample.R
73 # LSF
74 g = X[:, 0] - X[:, 1] + 3
75 # we should return an instance of SampleBox class
76 # this instance stores coordinates along with LSF calculation result
77 return SampleBox(input_sample, g, "my_problem")
78
79 # 3. Put them together
80 wt = whitebox.WhiteBox(f, my_problem)
81
82 # choose filename to store samples and estimations
83 gui.read_box(wt)
84 # setup algorithm
85 gui.setup_dicebox(wt)
86
87 # start GUI
88 gui.show_box(wt)
89 ```
90
91 ## C. The same without GUI:
92 ```
93 import numpy as np
94 import scipy.stats as stats
95
96 from wellmet.samplebox import SampleBox
97 from wellmet import f_models
98
99
100 # 1. Set up probability distribution
101 # Standard Gaussian variables, 2D
102 #f = f_models.SNorm(2)
103 # Just normal variables
104 f = f_models.Norm(mean=[-1, 0], std=[2, 1])
105 # Independent non-Gaussian variables
106 #f = f_models.UnCorD((stats.gumbel_r, stats.uniform))
107 # Correlated:
108 # Nataf model with correlations of the respective _Gaussian_ marginals
109 #f = f_models.Nataf((stats.gumbel_r, stats.weibull_min(c=1.5)), [[1,0.8], [0.8,1]])
110
111 # 2. Define LSF function
112 def my_problem(input_sample):
113 # get real (physical) space coordinates
114 # X is a numpy array with shape (nsim, ndim)
115 # the algorithm normally sends (1, ndim) sample
116 X = input_sample.R
117 # LSF
118 g = X[:, 0] - X[:, 1] + 3
119 # we should return an instance of SampleBox class
120 # it stores coordinates along with LSF calculation result
121 # with kind of signature
122 return SampleBox(input_sample, g, "my_problem")
123
124
125
126
127
128
129 # 3. Prepare storage
130 # no need to store anything
131 #sample_box = SampleBox(f)
132
133 # keep samples and estimations continiously stored
134 from wellmet import reader
135 sample_box = reader.Reader("meow_problem", f)
136
137 # 4. Setup the algorithm
138 from wellmet.dicebox.circumtri import CirQTri
139 import quadpy
140
141 scheme = quadpy.tn.stroud_tn_3_6b(sample_box.nvar)
142 convex_hull_degree = 5 # degreee of Grundmann-Moeller cubature scheme
143 q = 1 # should be > 0. Greater values slightly enforces exploration
144 screening_rate = 0 # 10 means to sacrifice every tenth sample for screening
145 box = CirQTri(sample_box, scheme, convex_hull_degree, q, screening_rate)
146
147
148 # 5. Here we go!
149 for i in range(20):
150 # ask where to sample the next point
151 # next_node is an f_model instance
152 next_node = box()
153 # call LSF
154 new_sample = my_problem(next_node)
155 # put calculation result to the box
156 box.add_sample(new_sample)
157
158 print(box.get_pf_estimation())
159 sensitivities_results = box.Tri.perform_sensitivity_analysis()
160 print(sensitivities_results.sensitivities)
161 ```
162
163
164
165
166
167
168
169
170 This software has been developed under internal academic project no. FAST-K-21-6943 "Quality Internal Grants of BUT (KInG BUT)'' supported by the Czech Operational Programme ``Research, Development and Education'' (CZ.02.2.69/0.0/0.0/19\_073/0016948, managed by the Czech Ministry of Education.
File cli_example.py added (mode: 100644) (index 0000000..6cd17c9)
1 #!/usr/bin/env python
2 # coding: utf-8
3
4 import numpy as np
5 import scipy.stats as stats
6
7 from wellmet.samplebox import SampleBox
8 from wellmet import f_models
9
10
11 # 1. Set up probability distribution
12 # Standard Gaussian variables, 2D
13 #f = f_models.SNorm(2)
14 # Just normal variables
15 f = f_models.Norm(mean=[-1, 0], std=[2, 1])
16 # Independent non-Gaussian variables
17 #f = f_models.UnCorD((stats.gumbel_r, stats.uniform))
18 # Correlated:
19 # Nataf model with correlations of the respective _Gaussian_ marginals
20 #f = f_models.Nataf((stats.gumbel_r, stats.weibull_min(c=1.5)), [[1,0.8], [0.8,1]])
21
22 # 2. Define LSF function
23 def my_problem(input_sample):
24 # get real (physical) space coordinates
25 # X is a numpy array with shape (nsim, ndim)
26 # the algorithm normally sends (1, ndim) sample
27 X = input_sample.R
28 # LSF
29 g = X[:, 0] - X[:, 1] + 3
30 # we should return an instance of SampleBox class
31 # it stores coordinates along with LSF calculation result
32 # with kind of signature
33 return SampleBox(input_sample, g, "my_problem")
34
35
36
37
38
39
40 # 3. Prepare storage
41 # no need to store anything
42 #sample_box = SampleBox(f)
43
44 # keep samples and estimations continiously stored
45 from wellmet import reader
46 sample_box = reader.Reader("meow_problem", f)
47
48 # 4. Setup the algorithm
49 from wellmet.dicebox.circumtri import CirQTri
50 import quadpy
51
52 scheme = quadpy.tn.stroud_tn_3_6b(sample_box.nvar)
53 convex_hull_degree = 5 # degreee of Grundmann-Möller cubature scheme
54 q = 1 # should be > 0. Greater values slightly enforces exploration
55 screening_rate = 0 # 10 means to sacrifice every tenth sample for screening
56 box = CirQTri(sample_box, scheme, convex_hull_degree, q, screening_rate)
57
58
59 # 5. Here we go!
60 for i in range(20):
61 # ask where to sample the next point
62 # next_node is an f_model instance
63 next_node = box()
64 # call LSF
65 new_sample = my_problem(next_node)
66 # put calculation result to the box
67 box.add_sample(new_sample)
68
69 print(box.get_pf_estimation())
70 sensitivities_results = box.Tri.perform_sensitivity_analysis()
71 print(sensitivities_results.sensitivities)
72
73
File gui_example.py added (mode: 100644) (index 0000000..52ad825)
1 #!/usr/bin/env python
2 # coding: utf-8
3
4 import numpy as np
5 import scipy.stats as stats
6
7 from wellmet.qt_gui import qt_box_functions as gui
8 from wellmet import whitebox
9 from wellmet.samplebox import SampleBox
10 from wellmet import f_models
11
12
13 # 1. Set up probability distribution
14 # Standard Gaussian variables, 2D
15 #f = f_models.SNorm(2)
16 # Just normal variables
17 f = f_models.Norm(mean=[-1, 0], std=[2, 1])
18 # Independent non-Gaussian variables
19 #f = f_models.UnCorD((stats.gumbel_r, stats.uniform))
20 # Correlated non-Gaussian marginals
21 #f = f_models.Nataf((stats.gumbel_r, stats.weibull_min(c=1.5)), [[1,0.8], [0.8,1]])
22
23 # 2. Define LSF function
24 def my_problem(input_sample):
25 # get real (physical) space coordinates
26 # X is a numpy array with shape (nsim, ndim)
27 # the algorithm normally sends (1, ndim) sample
28 X = input_sample.R
29 # LSF
30 g = X[:, 0] - X[:, 1] + 3
31 # we should return an instance of SampleBox class
32 # this instance stores coordinates along with LSF calculation result
33 return SampleBox(input_sample, g, "my_problem")
34
35 # 3. Put them together
36 wt = whitebox.WhiteBox(f, my_problem)
37
38 # choose filename to store samples and estimations
39 gui.read_box(wt)
40 # algorithm setup
41 gui.setup_dicebox(wt)
42
43 # start GUI
44 gui.show_box(wt)
45
46
File pyproject.toml added (mode: 100644) (index 0000000..fed528d)
1 [build-system]
2 requires = ["setuptools"]
3 build-backend = "setuptools.build_meta"
File setup.cfg added (mode: 100644) (index 0000000..7f9286a)
1 [metadata]
2 name = wellmet
3 version = 0.9.7.1
4 author = Gerasimov Aleksei
5 author_email = ger-alex@seznam.cz
6 description = a pure Python framework for spatial structural reliability analysis
7 url = https://rocketgit.com/iam-git/WellMet
8 long_description = file: README.md
9 long_description_content_type = text/markdown
10 license = MIT
11 classifiers =
12 Topic :: Scientific/Engineering
13 Intended Audience :: Science/Research
14 Programming Language :: Python :: 3
15 License :: OSI Approved :: MIT License
16 Operating System :: OS Independent
17
18 keywords =
19 failure probability
20 Monte Carlo
21 surrogate model
22 response surface
23
24
25 [options]
26 packages = find:
27 install_requires =
28 numpy
29 scipy
30 mpmath
31 pandas
32 matplotlib
33 PyQt5
34 pyqtgraph>=0.13.1
35 python_requires = >=3.8
36
File setup.py added (mode: 100644) (index 0000000..ee2a480)
1 from setuptools import setup, find_packages
2
3 setup()
4
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/iam-git/WellMet

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/iam-git/WellMet

Clone this repository using git:
git clone git://git.rocketgit.com/user/iam-git/WellMet

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main