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)
qt_gui.qt_dicebox: add Razitko box tab, simplify setup widget e502adfa6458c63f18b81410c0a923aeee610641 I am 2022-04-11 05:41:07
dicebox: backport assess_candidates() to Chrt 62628b5b5f0f2da1f37c504175e4b7678ff94e8e I am 2022-04-11 05:39:40
dicebox.Goal: add chee and chee2 potentials 1b7e1af9932a9761652b57f2445daa7612f8f09e I am 2022-04-11 00:34:30
ghull.Ghull: fix NaN in get_r() method 654d4d32ebf8d14f88bc78dbee27567e9aa9564e I am 2022-04-10 16:06:24
estimation: nahradit zastaralou hlavičku 00b7aa07abc3072261da2cc7ba775d5228eefdf7 I am 2022-04-04 03:34:36
testcases.testcases_2D: add more nataf ceses ff4873afb1722500e3faed3c7a7f2552496b6e08 I am 2022-04-02 18:48:42
dicebox.Goal._handle_candidates: trigger cache update 80d401d5c4aaab0894d92e6df5390aff12738880 I am 2022-03-30 22:11:24
mplot.mfigs: add G_U_distortion plot 6ed034375dfd042706a91a368c9483270095e75c I am 2022-03-20 14:42:50
mplot.mart: add number_points function dab89bdb9e5190600aa394c9b65cfa24d162be0e I am 2022-03-20 14:42:23
testcases:testcases_nD: add hyperplane_pf3 87176287101b0a15a86c7999ba9626674400d225 I am 2022-03-20 14:41:26
testcases:gaussian_2D: add pf estimation for sinshilds case 889b5aebae164ea3fb1f9375ae58d1afa4687696 I am 2022-03-17 20:42:13
mplot: add rbf_density_plot() 62ce990cb9418418879d0f5e084a26043b5bfdeb I am 2022-03-04 03:00:32
misc: little changes to the rbf class 058a0401db09f4e9e68af72c987c3b879077864d I am 2022-03-03 22:53:48
mplot.maxes: rbf, one more try 8303470585507772e8170504989835f04a7828b9 I am 2022-03-02 22:13:08
mplot.maxes: add rbf_plot 3485da2191b2f64fac76813d072a6b6f6e2fba71 I am 2022-03-02 03:35:27
mplot.maxes: add rbf plot bd5055adced9e0d8887fa213baa0ff9f9e038ba4 I am 2022-03-02 02:17:18
misc: add small class for rbf surrogate model f8beecf63302ceae6d3462ed279b796b54149bdf I am 2022-03-02 02:16:01
testcases: pf_exact fix for suspension 3d case 0f3318cac398c9195e0b21a6f13edc9475156b0d I am 2022-03-02 02:14:55
g_models.CosExp2D: add pf_expression() method 3ebf3098bcff1a73a649059b1539d622d58b7439 I am 2022-02-06 19:38:37
mplot.mfigs.double_diagram(): do not share x axis. User can set up limits itself after all e74145928c028479070af2fe766d55f180828cdf I am 2022-02-06 05:02:59
Commit e502adfa6458c63f18b81410c0a923aeee610641 - qt_gui.qt_dicebox: add Razitko box tab, simplify setup widget
Author: I am
Author date (UTC): 2022-04-11 05:41
Committer name: I am
Committer date (UTC): 2022-04-11 05:41
Parent(s): 62628b5b5f0f2da1f37c504175e4b7678ff94e8e
Signer:
Signing key:
Signing status: N
Tree: 0416b2bcc1e062bc3e7721b2c460eb97af8c5618
File Lines added Lines deleted
qt_gui/qt_dicebox.py 133 19
File qt_gui/qt_dicebox.py changed (mode: 100644) (index 9639b40..2db43f3)
1 1 import sys import sys
2 2 import numpy as np import numpy as np
3 3 from .. import schemes from .. import schemes
4 from ..dicebox import Goal, DiceBox
4 from ..dicebox import Goal, Razitko, DiceBox
5 5 import pyqtgraph as pg import pyqtgraph as pg
6 6 from pyqtgraph.Qt import QtGui, QtCore, QtWidgets from pyqtgraph.Qt import QtGui, QtCore, QtWidgets
7 7
8 8 spaces = ['R', 'aR', 'Rn', 'aRn', 'P', 'GK', 'G', 'aG', 'U', 'aU'] spaces = ['R', 'aR', 'Rn', 'aRn', 'P', 'GK', 'G', 'aG', 'U', 'aU']
9 potentials = ['q_psee', 'psee', 'fee', 'fee2', 'ksee', 'chee', 'chee2', 'dd']
9 10
10 11 class DumbDiceBoxWidget(QtWidgets.QWidget): class DumbDiceBoxWidget(QtWidgets.QWidget):
11 12 def __init__(self, wt, parent=None): def __init__(self, wt, parent=None):
 
... ... class DumbDiceBoxWidget(QtWidgets.QWidget):
16 17 # do the thing # do the thing
17 18 self.box.sample_box = DiceBox(self.box.sample_box) self.box.sample_box = DiceBox(self.box.sample_box)
18 19
20
21 class RazitkoWidget(pg.parametertree.ParameterTree):
22 def __init__(self, wt, parent=None):
23 self.box = wt
24 super().__init__(parent=parent, showHeader=False)
25 self._set_param()
26 self.setParameters(self.param, showTop=False)
27
28 def _set_param(self):
29 params = list()
30 tschemes = schemes.get_tn_keys(self.box.nvar)
31 params.append({'name': 'scheme', 'type': 'list', \
32 'title': "cubature scheme", \
33 'values': tschemes, 'value': tschemes[0]})
34 params.append({'name': 'degree', 'type': 'int', \
35 'title': "degree",\
36 'limits': (0, float('inf')), 'value': 5, 'default': 5,\
37 'tip': "Used only with Grundmann-Möller and Silvester cubaturas"})
38
39 params.append({'name': 'tri_space', 'type': 'list', 'value': 'G', \
40 'title': "triangulation space", 'values': spaces})
41 params.append({'name': 'tree_space', 'type': 'list', 'value': 'None', \
42 'title': "tree (potential) space", 'values': spaces+['None'], \
43 'tip': """Space where distances (and densities) are
44 calculated. 'None' means triangulation space will be used"""})
45 params.append({'name': 'sampling_space', 'type': 'list', 'value': 'None', \
46 'title': "sampling space", 'values': spaces+['None'], \
47 'tip': """Space where convex hull is being integrated.
48 'None' means triangulation space will be used"""})
49 params.append({'name': 'kechato_space', 'type': 'list', 'value': 'U', \
50 'title': "kechato space", 'values': spaces, \
51 'tip': "Only used with ksee potential"})
52 params.append({'name': 'potential', 'type': 'list', 'value': 'q_psee', \
53 'title': "potential", \
54 'values': potentials})
55 q = np.log(self.box.nvar) / self.box.nvar**2
56 params.append({'name': 'q', 'type': 'float', \
57 'title': "q", \
58 'limits': (0, 1), 'value': q, 'default': q,\
59 'tip': "Only used with q_psee potential"})
60 params.append({'name': 'p_norm', 'type': 'float', \
61 'title': "p norm", \
62 'limits': (1, float('inf')), 'value': 2, 'default': np.inf,
63 'tip': "Space metric - used for distance calculations"})
64 params.append({'name': 'budget', 'type': 'int', \
65 'title': "Shull budget", \
66 'limits': (1, float('inf')), 'value': 1000, 'default': 1000,\
67 'tip': "Number of nodes for outside integration"})
68 params.append({'name': 'LHS_correction', \
69 'title': "LHS-like nodes placement",\
70 'type': 'bool', 'value': False })
71
72 ### Create tree of Parameter objects
73 # I don't know why that signals do not work for me
74 # Only sigTreeStateChanged works, but I don't want to struggle with it
75 # May be I'll report the issue
76 #self.param.sigValueChanged.connect(self.param_changed)
77 #self.param.sigValueChanging.connect(self.param_changing)
78 self.param = pg.parametertree.Parameter.create(name='params', type='group', children=params)
79
80 #č branima sa rekurzii
81 #оӵ рекурзилы пезьдэт!
82 self.param_values = self.param.getValues()
83
84 def __getattr__(self, attr):
85 #č na teoreticky možnou rěkurziju vykašleme
86 #оӵ рекурзия уз луы
87 return self.param_values[attr][0]
88
89 def setup_box(self):
90 #č to je důležité! __getatr__ odsaď bere hodnoty
91 self.param_values = self.param.getValues()
92
93 scheme = schemes.get_tn_scheme(self.scheme, self.box.nvar, self.degree)
94
95 if self.tree_space == 'None':
96 tree_space = None
97 else:
98 tree_space = self.tree_space
99
100 if self.sampling_space == 'None':
101 sampling_space = None
102 else:
103 sampling_space = self.sampling_space
104
105 # try:
106 # stm_filename = self.box.filename + '_stm'
107 # except AttributeError:
108 # stm_filename = None
109
110 # do the thing
111 self.box.sample_box = Razitko(
112 self.box.sample_box, #č rekurze)
113 scheme,
114 tri_space=self.tri_space,
115 tree_space=tree_space,
116 sampling_space=sampling_space,
117 kechato_space=self.kechato_space,
118 potential=self.potential,
119 q=self.q,
120 p_norm=self.p_norm,
121 budget=self.budget,
122 LHS_correction=self.LHS_correction,
123 #stm_filename=stm_filename,
124 design=None
125 )
126
127
128
129
19 130 class GoalWidget(pg.parametertree.ParameterTree): class GoalWidget(pg.parametertree.ParameterTree):
20 131 def __init__(self, wt, parent=None): def __init__(self, wt, parent=None):
21 132 self.box = wt self.box = wt
 
... ... class GoalWidget(pg.parametertree.ParameterTree):
45 156 'tip': "Only used with ksee potential"}) 'tip': "Only used with ksee potential"})
46 157 params.append({'name': 'potential', 'type': 'list', 'value': 'q_psee', \ params.append({'name': 'potential', 'type': 'list', 'value': 'q_psee', \
47 158 'title': "potential", \ 'title': "potential", \
48 'values': ['q_psee', 'psee', 'fee', 'fee2', 'ksee', 'chee', 'chee2', 'dd']})
159 'values': potentials})
49 160 q = np.log(self.box.nvar) / self.box.nvar**2 q = np.log(self.box.nvar) / self.box.nvar**2
50 161 params.append({'name': 'q', 'type': 'float', \ params.append({'name': 'q', 'type': 'float', \
51 162 'title': "q", \ 'title': "q", \
 
... ... class SetupDiceBoxWidget(pg.LayoutWidget):
138 249 self.setWindowTitle("Set up sequential algorithm") self.setWindowTitle("Set up sequential algorithm")
139 250
140 251 self.setup_tabs() self.setup_tabs()
141 self.addWidget(self.tabs, row=0, col=0, rowspan=1, colspan=2)
252 self.addWidget(self.tab_widget, row=0, col=0, rowspan=1, colspan=2)
142 253
143 254 self.btn_skip = QtGui.QPushButton('Skip') self.btn_skip = QtGui.QPushButton('Skip')
144 255 self.addWidget(self.btn_skip, row=1, col=0) self.addWidget(self.btn_skip, row=1, col=0)
 
... ... class SetupDiceBoxWidget(pg.LayoutWidget):
152 263 self.app.quit() self.app.quit()
153 264
154 265 def create(self): def create(self):
155 tab_index = self.tabs.currentIndex()
156 if tab_index == 0:
157 self.goal.setup_box()
158 elif tab_index == 1:
159 self.dice_box.setup_box()
160 else:
161 raise
266 tab_index = self.tab_widget.currentIndex()
267 self.tabs[tab_index].setup_box()
162 268 self.app.quit() self.app.quit()
163 269
164 270 def setup_tabs(self): def setup_tabs(self):
165 271 # Initialize tab screen # Initialize tab screen
166 self.tabs = QtWidgets.QTabWidget(self)
272 self.tab_widget = QtWidgets.QTabWidget(self)
273 #č šlo by to, samozřejmně, i přes Qt
274 #č ale stejně musíme reference explicitně ukladat
275 #č aby je nám Python nehodil
276 self.tabs = []
167 277
168 # Add tabs
169 self.goal = GoalWidget(self.box, self)
170 self.tabs.addTab(self.goal, "Goal")
278 # Add tab
279 box_widget = GoalWidget(self.box, self)
280 self.tab_widget.addTab(box_widget, "Goal")
281 self.tabs.append(box_widget)
171 282
172 # Add tabs
173 self.dice_box = DumbDiceBoxWidget(self.box, self)
174 self.tabs.addTab(self.dice_box, "Dumb DiceBox")
283 # Add tab
284 box_widget = RazitkoWidget(self.box, self)
285 self.tab_widget.addTab(box_widget, "Razitko")
286 self.tabs.append(box_widget)
175 287
176 #self.tab_2d = TestCasesListWidget(testcases_2D, self)
177 #self.tabs.addTab(self.tab_2d,"2D testcases")
288 # Add tab
289 box_widget = DumbDiceBoxWidget(self.box, self)
290 self.tab_widget.addTab(box_widget, "Dumb DiceBox")
291 self.tabs.append(box_widget)
178 292
179 293
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