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: implement dicebox setup 09a7074b12e46d0554b2c4f73b6a8b672d0b4428 I am 2021-10-30 15:12:33
schemes: small fix 934b2269e5b08930e23fd67df07234251b123153 I am 2021-10-30 15:11:39
qt_gui: prepare setup Goal setup dialog e53197a0b5d5a994dddbcbfb02042c5383f79ec7 Aleksei Gerasimov 2021-10-29 16:47:09
schemes: add conventional functions for tn schemes 9a32048dc342604291f1b7d17efc71be755d3810 Aleksei Gerasimov 2021-10-29 16:45:24
reader: make Reader callable 5cdd55d11ff846f9116fb0e00f54a7830ef3c276 Aleksei Gerasimov 2021-10-27 16:30:05
make WellMet standalone runnable 1fe983d633d7194a64cf6928044082936790ce4d Aleksei Gerasimov 2021-10-27 16:21:51
qt_gui: prepare qt_box_functions module c500fcd20e7b296262a0566d04aabb7bd1ae9cfa Aleksei Gerasimov 2021-10-25 15:39:56
shapeshare: keep empty file to reserve the name b11f17e13dafc3d58db5ad9f101c0126e0bfd871 Aleksei Gerasimov 2021-10-21 14:48:03
delete sball_old :( 792d9d83fde0f38e7396162788ec8aa922b0fd0c Aleksei Gerasimov 2021-10-21 14:47:06
whitebox: add Z_sum, Z_prod, small clean up faec934bb03c20906c9091fc196cc0daf824b54f Aleksei Gerasimov 2021-10-21 13:48:07
g_models: add neverfall, add sign parameter to Z_prod 129abf19da15a5dfcb5a02614d92a233f914d146 Aleksei Gerasimov 2021-10-21 13:45:47
mplot: add one more qhull plot 32e7003aac4887bd83bfff640093f755b4f6cffe I am 2021-09-14 11:42:56
mplot: add ESREL-related figures cba805ba8e7f3c2337027eec6e760aa9234dfdc2 I am 2021-09-12 10:17:21
mplot.mart: allow set up fill keyword cf94410513091b5f96e0e17e8de2f7a3feee1a03 I am 2021-09-12 10:15:55
mplot: add qhull&density figure a36fb606e9f425742925aa4953c0ae07d6b51409 I am 2021-09-10 15:17:58
qt_plot: send sliced sample box to matplotlib fda486b90c56e77bc88b38d0d94d08a751277cfb I am 2021-09-10 15:01:55
mplot: include Axes3d patch 8f5dc7f04b6c804b5ec169ec7b744a8618b3bb69 I am 2021-09-10 11:05:20
rework mplot module considerably 5343602c63032f6f7fd06701b0883eaabb4fc6c1 I am 2021-09-09 13:24:45
convex_hull: reduce max R to that not overflows everything everytime 2108df698e4d45bfae9d9882d4b4cc62340b03cc Aleksei Gerasimov 2021-07-21 13:56:41
sball: make Sball a little bit more scipy.stats-compatible 9414aceedf826e7fc6e35c722b2eecee81dead1e Aleksei Gerasimov 2021-07-21 13:40:28
Commit 09a7074b12e46d0554b2c4f73b6a8b672d0b4428 - qt_gui: implement dicebox setup
Author: I am
Author date (UTC): 2021-10-30 15:12
Committer name: I am
Committer date (UTC): 2021-10-30 15:12
Parent(s): 934b2269e5b08930e23fd67df07234251b123153
Signer:
Signing key:
Signing status: N
Tree: 6e985399dd05bc31b38d5e1c43f8ec57a6eb5b6a
File Lines added Lines deleted
qt_gui/gui_startup.py 1 14
qt_gui/qt_box_functions.py 3 0
qt_gui/qt_dicebox.py 74 38
File qt_gui/gui_startup.py changed (mode: 100644) (index 1f799ec..5faf82c)
... ... wt.samplebox.sampled_plan = CandyBox(wt.f())
23 23 #č ponechá původní samplebox #č ponechá původní samplebox
24 24 gui.read_box(wt) gui.read_box(wt)
25 25
26 #
27 #schema = schemes.get_all_tn_simplex_schemes(wt.nvar)
28 #
29
30 #
31 #stm_filename = "store/%s_%sD_stm" % (wt.gm_signature, wt.nvar)
32 #
33 #bx = Goal(sample_box, scheme=schema['Grundmann-Möller(dim=2, 5)'],\
34 # tri_space='G', tree_space=None, potential='q_psee', q=0.5, p_norm=2, \
35 # kechato_space='U', shell_budget=1000, outer_budget=100,\
36 # LHS_correction=False, stm_filename=stm_filename)
37 #
38 #wt.sample_box = bx
39 #
26 gui.setup_dicebox(wt)
40 27
41 28 qt_gui.QtGuiPlot2D(wt) qt_gui.QtGuiPlot2D(wt)
File qt_gui/qt_box_functions.py changed (mode: 100644) (index b79ed6c..567f953)
3 3
4 4 import sys import sys
5 5 from . import qt_testcases from . import qt_testcases
6 from . import qt_dicebox
6 7 from .. import reader from .. import reader
7 8 import pyqtgraph as pg import pyqtgraph as pg
8 9 from pyqtgraph.Qt import QtGui, QtCore from pyqtgraph.Qt import QtGui, QtCore
 
... ... def read_box(wt):
38 39 #č Reader sám zavolá SampleBox #č Reader sám zavolá SampleBox
39 40 wt.sample_box = reader.Reader(filename, wt.samplebox.sampled_plan) wt.sample_box = reader.Reader(filename, wt.samplebox.sampled_plan)
40 41
42 def setup_dicebox(wt):
43 qt_dicebox.SetupDiceBoxWidget(wt)
41 44
42 45
File qt_gui/qt_dicebox.py changed (mode: 100644) (index af6121d..ddb43bb)
1 1 import sys import sys
2 2 import numpy as np import numpy as np
3 from .. import schemes
3 4 from ..dicebox import Goal from ..dicebox import Goal
4 5 import pyqtgraph as pg import pyqtgraph as pg
5 6 from pyqtgraph.Qt import QtGui, QtCore, QtWidgets from pyqtgraph.Qt import QtGui, QtCore, QtWidgets
 
... ... from pyqtgraph.Qt import QtGui, QtCore, QtWidgets
7 8 spaces = ['R', 'aR', 'Rn', 'aRn', 'P', 'GK', 'G', 'aG', 'U', 'aU'] spaces = ['R', 'aR', 'Rn', 'aRn', 'P', 'GK', 'G', 'aG', 'U', 'aU']
8 9
9 10 class GoalWidget(pg.parametertree.ParameterTree): class GoalWidget(pg.parametertree.ParameterTree):
10 def __init__(self, wt, parent=None):
11 def __init__(self, wt, parent=None):
11 12 self.box = wt self.box = wt
12 13 super().__init__(parent=parent, showHeader=False) super().__init__(parent=parent, showHeader=False)
13 14 self._set_param() self._set_param()
14 15 self.setParameters(self.param, showTop=False) self.setParameters(self.param, showTop=False)
15
16
16 17 def _set_param(self): def _set_param(self):
17 18 params = list() params = list()
18 if self.box.nvar < 6:
19 self.schemes =
20 params.append({'name': 'scheme', 'type': 'list', \
21 'values': schemes, 'value': schemes[0]})
22
19 tschemes = schemes.get_tn_keys(self.box.nvar)
20 params.append({'name': 'scheme', 'type': 'list', \
21 'title': "cubature scheme", \
22 'values': tschemes, 'value': tschemes[0]})
23 params.append({'name': 'degree', 'type': 'int', \
24 'title': "degree",\
25 'limits': (1, float('inf')), 'value': 5, 'default': 5,\
26 'tip': "Used only with Grundmann-Möller and Silvester cubaturas"})
23 27
24 28 params.append({'name': 'tri_space', 'type': 'list', 'value': 'G', \ params.append({'name': 'tri_space', 'type': 'list', 'value': 'G', \
25 'title': "triangulation space", 'values': spaces})
26 params.append({'name': 'tree_space', 'type': 'list', 'value': 'G', \
27 'title': "potential space", 'values': spaces+['None'], \
29 'title': "triangulation space", 'values': spaces})
30 params.append({'name': 'tree_space', 'type': 'list', 'value': 'None', \
31 'title': "potential space", 'values': spaces+['None'], \
28 32 'tip': """Space where distances (and densities) are 'tip': """Space where distances (and densities) are
29 33 calculated. 'None' means triangulation space will be used"""}) calculated. 'None' means triangulation space will be used"""})
30 34 params.append({'name': 'kechato_space', 'type': 'list', 'value': 'U', \ params.append({'name': 'kechato_space', 'type': 'list', 'value': 'U', \
31 'title': "kechato space", 'values': spaces, \
35 'title': "kechato space", 'values': spaces, \
32 36 'tip': "Only used with ksee potential"}) 'tip': "Only used with ksee potential"})
33 params.append({'name': 'potential', 'type': 'list', 'value': 'q_psee', \
34 'title': "potential", \
35 'values': ['q_psee', 'psee', 'fee', 'fee2' 'ksee', 'dd']})
36 q = np.log(self.box.nvar) / self.box.nvar**2
37 params.append({'name': 'q', 'type': 'float', \
37 params.append({'name': 'potential', 'type': 'list', 'value': 'q_psee', \
38 'title': "potential", \
39 'values': ['q_psee', 'psee', 'fee', 'fee2' 'ksee', 'dd']})
40 q = np.log(self.box.nvar) / self.box.nvar**2
41 params.append({'name': 'q', 'type': 'float', \
38 42 'title': "q", \ 'title': "q", \
39 43 'limits': (0, 1), 'value': q, 'default': q,\ 'limits': (0, 1), 'value': q, 'default': q,\
40 44 'tip': "Only used with q_psee potential"}) 'tip': "Only used with q_psee potential"})
41 45 params.append({'name': 'p_norm', 'type': 'float', \ params.append({'name': 'p_norm', 'type': 'float', \
42 46 'title': "p norm", \ 'title': "p norm", \
43 'limits': (0, 1), 'value': q, 'default': q,\
47 'limits': (1, float('inf')), 'value': 2, 'default': np.inf,
44 48 'tip': "Space metric - used for distance calculations"}) 'tip': "Space metric - used for distance calculations"})
45
46 49 params.append({'name': 'shell_budget', 'type': 'int', \ params.append({'name': 'shell_budget', 'type': 'int', \
47 'title': "shell budget" \
50 'title': "shell budget", \
48 51 'limits': (1, float('inf')), 'value': 1000, 'default': 1000,\ 'limits': (1, float('inf')), 'value': 1000, 'default': 1000,\
49 52 'tip': "Number of annulus candidates"}) 'tip': "Number of annulus candidates"})
50 53
51 54 params.append({'name': 'outer_budget', 'type': 'int', \ params.append({'name': 'outer_budget', 'type': 'int', \
52 'title': "Outer budget" \
55 'title': "Outer budget", \
53 56 'limits': (1, float('inf')), 'value': 100, 'default': 100,\ 'limits': (1, float('inf')), 'value': 100, 'default': 100,\
54 57 'tip': "Number of candidates nodes outside of circumscribed d-ball"}) 'tip': "Number of candidates nodes outside of circumscribed d-ball"})
55 58
56 params.append({'name': 'LHS_correction', 'title': "LHS-like placement",\
57 'type': 'bool', 'value': False })
59 params.append({'name': 'LHS_correction', \
60 'title': "LHS-like nodes placement",\
61 'type': 'bool', 'value': False })
58 62
59 63 ### Create tree of Parameter objects ### Create tree of Parameter objects
60 64 # I don't know why that signals do not work for me # I don't know why that signals do not work for me
 
... ... class GoalWidget(pg.parametertree.ParameterTree):
64 68 #self.param.sigValueChanging.connect(self.param_changing) #self.param.sigValueChanging.connect(self.param_changing)
65 69 self.param = pg.parametertree.Parameter.create(name='params', type='group', children=params) self.param = pg.parametertree.Parameter.create(name='params', type='group', children=params)
66 70
67 def extract_selected_item(self):
68 item = self.currentItem()
69 if item is None:
70 return getattr(self.module, self.module.__all__[0])()
71 #č branima sa rekurzii
72 #оӵ рекурзилы пезьдэт!
73 self.param_values = self.param.getValues()
74
75 def __getattr__(self, attr):
76 #č na teoreticky možnou rěkurziju vykašleme
77 #оӵ рекурзия уз луы
78 return self.param_values[attr][0]
79
80 def setup_box(self):
81 #č to je důležité! __getatr__ odsaď bere hodnoty
82 self.param_values = self.param.getValues()
83
84 scheme = schemes.get_tn_scheme(self.scheme, self.box.nvar, self.degree)
85
86 if self.tree_space == 'None':
87 tree_space = None
71 88 else: else:
72 item_str = self.currentItem().text()
73 return getattr(self.module, item_str)()
74
89 tree_space = self.tree_space
90
91 try:
92 stm_filename = self.box.filename + '_stm'
93 except AttributeError:
94 stm_filename = None
95
96 # do the thing
97 self.box.sample_box = Goal(
98 self.box.sample_box, #č rekurze)
99 scheme,
100 tri_space=self.tri_space,
101 tree_space=tree_space,
102 kechato_space=self.kechato_space,
103 potential=self.potential,
104 q=self.q,
105 p_norm=self.p_norm,
106 shell_budget=self.shell_budget,
107 outer_budget=self.outer_budget,
108 LHS_correction=self.LHS_correction,
109 stm_filename=stm_filename,
110 )
111
75 112
76 113 class SetupDiceBoxWidget(pg.LayoutWidget): class SetupDiceBoxWidget(pg.LayoutWidget):
77 114 def __init__(self, wt, parent=None): def __init__(self, wt, parent=None):
78 self.box = wt
115 self.box = wt
79 116 #č nejdřív vytvořiť apku #č nejdřív vytvořiť apku
80 117 self.app = pg.mkQApp("WellMet") self.app = pg.mkQApp("WellMet")
81 118 # #
 
... ... class SetupDiceBoxWidget(pg.LayoutWidget):
102 139 self.addWidget(self.btn_choose, row=1, col=1) self.addWidget(self.btn_choose, row=1, col=1)
103 140 self.btn_choose.clicked.connect(self.create) self.btn_choose.clicked.connect(self.create)
104 141
105 def exit(self):
142 def skip(self):
106 143 self.app.quit() self.app.quit()
107 sys.exit()
108 144
109 145 def create(self): def create(self):
110 146 tab_index = self.tabs.currentIndex() tab_index = self.tabs.currentIndex()
111 147 if tab_index == 0: if tab_index == 0:
112 self.box = self.tab_2d_papers.extract_selected_item()
148 self.goal.setup_box()
113 149 elif tab_index == 1: elif tab_index == 1:
114 self.box = self.tab_2d.extract_selected_item()
150 self.tab_2d.extract_selected_item()
115 151 else: else:
116 152 raise raise
117 153 self.app.quit() self.app.quit()
 
... ... class SetupDiceBoxWidget(pg.LayoutWidget):
121 157 self.tabs = QtWidgets.QTabWidget(self) self.tabs = QtWidgets.QTabWidget(self)
122 158
123 159 # Add tabs # Add tabs
124 self.tab_2d_papers = TestCasesListWidget(testcases_2D_papers, self)
125 self.tabs.addTab(self.tab_2d_papers,"Well-known 2D testcases")
160 self.goal = GoalWidget(self.box, self)
161 self.tabs.addTab(self.goal,"Goal")
126 162
127 self.tab_2d = TestCasesListWidget(testcases_2D, self)
128 self.tabs.addTab(self.tab_2d,"2D testcases")
163 #self.tab_2d = TestCasesListWidget(testcases_2D, self)
164 #self.tabs.addTab(self.tab_2d,"2D testcases")
129 165
130 166
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