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)
blackbox: .regen() refactoring 4064e769a19cc853028701853ff29de53782b08c Олёш 2020-09-27 01:24:34
blackbox: little refactoring c3669a2889c1b7056113c70d0b7bb1bb9aaa6593 Олёш 2020-09-26 15:13:48
IS_stat.ISSI: ZeroDivisionError fix 981eb1025f4059497172a0c6b71bee3fb9516a14 Олёш 2020-09-15 22:26:36
blackbox: BlackSimpleX is ready 683da8add2bafd4da2352b2e8fdabdb416daa02e Олёш 2020-09-15 22:25:00
blackbox: simplex optimalization WIP d81905dc1b143b6b6cbf8148a08469fe6227fea5 Олёш 2020-09-15 17:31:50
qt_plot: equal aspect option added 3c1325528bf84d42252a6e68e9649c38bbf2aa98 I am 2020-09-10 00:51:41
qt_plot: QSplitter is applied for estimation widgets 3f8733dbc62b341e1e53bb68ec044229beb86ff7 I am 2020-09-10 00:09:05
IS_stat: little fix in ISSI.get_estimations() 419c963e3188a6286af1f13fe9d69893c3036630 I am 2020-09-09 18:49:28
gl_plot: changes from qt_plot backported f6267793c711e877587ba1208b5a7638925e186d Alex 2020-09-09 17:47:48
plot: switch to refactored qt_plot 0c0c50c06cc3b135a85d825cf5cf31f83f84216d Олёш 2020-09-09 16:39:40
qt_plot: finally refactored and Simplex Graph updated b81f6c276ab9153ac86c26fe2c47cd6b4504d1db Олёш 2020-09-09 16:33:49
qt_plot: just playing 068010ed53213845fa29fc49b18a6edf65fe0c08 Олёш 2020-09-08 22:27:09
qt_plot: FastSimplexEstimationWidget is ready 07210b295638e9022589630bc1fb2a9b7ba5bae6 Олёш 2020-09-08 19:33:31
qt_plot: WIP simplex widget 9c801dee251d9ba17cae0c254df8ca9a2fb88753 Олёш 2020-09-07 22:59:23
qt_plot: polishing (mainly, triangulation) a4d9fd7f841f9f56ee6ff0725315e988b0a683b5 Олёш 2020-09-05 01:53:06
qt_plot: refactoring, WIP 0dffc07efa9557f5660b0be669b4e42ff7b049e8 Олёш 2020-09-04 23:21:58
estimation: fast_simplex_estimation added 28c2325972df8335b80d4a79ac4468363e0b2917 Олёш 2020-09-03 15:52:48
estimation: little enhancement 694db9ebd144ee5e0fba0b068e8c73b5e06a4b98 Олёш 2020-09-02 01:14:20
estimation: new simlex_estimation added be2a9b65df74e9c3d4c03d30530d50796604f431 Олёш 2020-09-01 23:23:22
f_models: little refactoring, performance boost is not almost visible, though a34473ad2ef19973c69bde8b8c6aa29eb1614399 Олёш 2020-08-23 21:52:43
Commit 4064e769a19cc853028701853ff29de53782b08c - blackbox: .regen() refactoring
Author: Олёш
Author date (UTC): 2020-09-27 01:24
Committer name: Олёш
Committer date (UTC): 2020-09-27 01:24
Parent(s): c3669a2889c1b7056113c70d0b7bb1bb9aaa6593
Signer:
Signing key:
Signing status: N
Tree: 1dd8a427141c51d1b6764186cb3152e0793281e1
File Lines added Lines deleted
blackbox.py 71 39
File blackbox.py changed (mode: 100644) (index 55465d3..db9cde3)
... ... class Censoring(BlackBox):
284 284
285 285 def regen(bx): def regen(bx):
286 286 super().regen() super().regen()
287 # chcu zachytit spadnuti QHull na začatku, kdy ještě není dostatek teček.
288 # Jinak je třeba nechat QHull spadnout
287 #č chcu zachytit spadnuti QHull na začatku, kdy ještě není dostatek teček.
288 #č Jinak je třeba nechat QHull spadnout
289 289 if bx.nsim > 2*bx.nvar + 3: if bx.nsim > 2*bx.nvar + 3:
290 290 # tady je to OK # tady je to OK
291 291 bx.tri = spatial.Delaunay(getattr(bx.sampled_plan, bx.tri_space), incremental=True) bx.tri = spatial.Delaunay(getattr(bx.sampled_plan, bx.tri_space), incremental=True)
 
... ... class Censoring(BlackBox):
299 299 else: # lze přípustit chybu triangulace else: # lze přípustit chybu triangulace
300 300 try: try:
301 301 bx.tri = spatial.Delaunay(getattr(bx.sampled_plan, bx.tri_space), incremental=True) bx.tri = spatial.Delaunay(getattr(bx.sampled_plan, bx.tri_space), incremental=True)
302 if len(bx.tri.coplanar):
303 #print('triangulace v pořádku není')
304 bx._logger(msg='triangulation is coplanar')
305 else:
306 #print('triangulace je v pořádku')
307 bx._logger(msg='triangulation is OK')
302 308 except: except:
303 309 bx._logger(msg='triangulation failed') bx._logger(msg='triangulation failed')
304 310
305
306 # pokud tecek nestaci na vytvareni aspon jedneho simplexu - pokrcim rameny
307 try:
308 # tady je to OK
309 bx.tri = spatial.Delaunay(getattr(bx.sampled_plan, bx.tri_space), incremental=True)
310 if len(bx.tri.coplanar): # pokud triangulace je v pořadku
311 #print('triangulace v pořádku není')
312 bx._log('triangulation is coplanar')
313 else:
314 #print('triangulace je v pořádku')
315 bx._log('triangulation is OK')
316 except:
317 # kdyby neco - berem kramle
318 bx._log('triangulation failed')
319 311
320 312
321 313 # tato metoda je vlastně pro MinEnergyCensoredSampling # tato metoda je vlastně pro MinEnergyCensoredSampling
 
... ... class AdaptiveCensoring(Censoring):
743 735 class MinEnergyCensoredSampling(Censoring): class MinEnergyCensoredSampling(Censoring):
744 736 # už mě to dědění nebaví # už mě to dědění nebaví
745 737 # без поллитры не разберёшься, что этот слоёный пирог делает # без поллитры не разберёшься, что этот слоёный пирог делает
746 def __init__(bx, sample_object, tri_space='Rn', tree_space=None, sampling_space=None, kechato_space='U', \
747 potencial='ksee', p_norm=2, budget=1000, simplex_budget=100):
738 def __init__(bx, sample_object, tri_space='Rn', tree_space=None,\
739 sampling_space=None, kechato_space='U', \
740 potencial='ksee', p_norm=2, budget=1000, simplex_budget=100):
748 741
749 742 bx.sball = sball.Sball(sample_object.nvar) bx.sball = sball.Sball(sample_object.nvar)
750 743 bx.base_r = bx.sball.get_r(0.5) bx.base_r = bx.sball.get_r(0.5)
 
... ... class MinEnergyCensoredSampling(Censoring):
788 781 regen() recreates data structures of the box. regen() recreates data structures of the box.
789 782 It shouldn't be called without reason, changed distribution, settings or so. It shouldn't be called without reason, changed distribution, settings or so.
790 783 """ """
784 # super TRYES to create .tri triangulation
791 785 super().regen() super().regen()
792 786 # zás mám vyhodit odhady? # zás mám vyhodit odhady?
793 787 bx.siss = IS_stat.ISSI() bx.siss = IS_stat.ISSI()
788 # kind of interface to CandidatesWidget
794 789 bx.candidates_index = dict() bx.candidates_index = dict()
795 790
791 # needed for potencial calculation
796 792 sampled_plan_tree = getattr(bx.sample_box, bx.tree_space) sampled_plan_tree = getattr(bx.sample_box, bx.tree_space)
797 793 bx.tree = spatial.cKDTree(sampled_plan_tree) bx.tree = spatial.cKDTree(sampled_plan_tree)
798 794
795
796 bx._regen_outside()
797 bx._regen_inside()
798
799
800
801 def _regen_outside(bx):
802 # function reserved for childs
803 pass
804
805
806 def _regen_inside(bx):
799 807 if "tri" in dir(bx): if "tri" in dir(bx):
800 808 # tri - Deloneho triangulace # tri - Deloneho triangulace
801 809 bx.simplex_events = bx.get_events() bx.simplex_events = bx.get_events()
 
... ... class MinEnergyCensoredSampling(Censoring):
804 812 # zde jen počítame # zde jen počítame
805 813 bx.estimate_simplex(simplex_id) bx.estimate_simplex(simplex_id)
806 814
807
808 815 elif bx.nsim > 0: # požaduji, aby nějaké těčíčky byly vždy pritomné elif bx.nsim > 0: # požaduji, aby nějaké těčíčky byly vždy pritomné
809
810 candidates = IS_stat.IS(bx.f, bx.h, space_from_h='R', space_to_f=bx.sampling_space, Nsim=bx.budget)
811 # nevím co tam bylo za h-ko, ale nechť IM zůstane 1
812 implicit_multiplicator = 1
813
814 # teoreticky lze
815 #bx.siss.add_IS_serie(candidates.w, candidates.simplex, implicit_multiplicator)
816
816 #č IS nesmí modifikovat f-ko,
817 #č a vidím, že tam je to v pořádku
818 candidates = IS_stat.IS(bx.f_model, bx.h, space_from_h='R', space_to_f=bx.sampling_space, Nsim=bx.budget)
817 819 bx.assess_candidates(candidates) bx.assess_candidates(candidates)
818 820 # uložíme # uložíme
819 821 bx.candidates_index[-1] = candidates bx.candidates_index[-1] = candidates
820
821
822
823
822
823
824
824 825
825 826
826 827 def export_estimation(bx): def export_estimation(bx):
 
... ... class MinEnergyCensoredSampling(Censoring):
1250 1251 class OptimizedCensoredSampling(MinEnergyCensoredSampling): class OptimizedCensoredSampling(MinEnergyCensoredSampling):
1251 1252
1252 1253
1253 def regen(bx):
1254 """
1255 regen() recreates data structures of the box.
1256 It shouldn't be called without reason, changed distribution, settings or so.
1257 """
1254 def _regen_outside(bx):
1258 1255 if bx.nsim >= bx.nvar + 1: if bx.nsim >= bx.nvar + 1:
1259 1256 try: try:
1260 1257 bx.convex_hull = spatial.ConvexHull(getattr(bx.sampled_plan, bx.tri_space), incremental=True) bx.convex_hull = spatial.ConvexHull(getattr(bx.sampled_plan, bx.tri_space), incremental=True)
1258 bx.estimate_outside()
1259 #č a máme hotovo
1260 return # Ok, go away
1261 1261 except BaseException as e: except BaseException as e:
1262 1262 msg = "error of creating ConvexHull " msg = "error of creating ConvexHull "
1263 1263 error_msg = bx.__class__.__name__ + ": " + msg + repr(e) error_msg = bx.__class__.__name__ + ": " + msg + repr(e)
1264 1264 bx._logger(msg=error_msg) bx._logger(msg=error_msg)
1265
1266 # nothing happened? We are still here?
1267 # we need to generate at least something
1268 if bx.nsim > 0: #č požaduji, aby nějaké těčíčky byly vždy pritomné
1269
1270 #č IS nesmí modifikovat f-ko,
1271 #č a vidím, že tam je to v pořádku
1272 candidates = IS_stat.IS(bx.f_model, bx.h, space_from_h='R', space_to_f=bx.sampling_space, Nsim=bx.budget)
1265 1273
1266 super().regen()
1274 bx.assess_candidates(candidates)
1275 # uložíme
1276 bx.candidates_index[-1] = candidates
1267 1277
1268 1278
1269 1279
1280 def _regen_inside(bx):
1281 #č .tri nemusí vůbec existovat
1282 if "tri" in dir(bx):
1283 #č tri - Deloneho triangulace
1284 bx.simplex_events = bx.get_events()
1285 for simplex_id in range(bx.tri.nsimplex):
1286 # zde jen počítame
1287 bx.estimate_simplex(simplex_id)
1288
1289
1270 1290
1271 1291
1272 1292
 
... ... class OptimizedCensoredSampling(MinEnergyCensoredSampling):
1359 1379
1360 1380
1361 1381 def estimate_outside(bx): def estimate_outside(bx):
1362 # předpokládám, že triangulece jíž existuje
1382 # předpokládám, že convex_hull jíž existuje
1363 1383
1364 1384 # -1 = 'out', 0=success, 1=failure, 2=mix # -1 = 'out', 0=success, 1=failure, 2=mix
1365 1385 #current outside probability estimation #current outside probability estimation
 
... ... class OptimizedCensoredSampling(MinEnergyCensoredSampling):
1444 1464
1445 1465
1446 1466 class FastSimpleX(OptimizedCensoredSampling): class FastSimpleX(OptimizedCensoredSampling):
1447
1467
1468
1469 def _regen_inside(bx):
1470 #č .tri nemusí vůbec existovat
1471 if "tri" in dir(bx):
1472 #č tri - Deloneho triangulace
1473 bx.simplex_events = bx.get_events()
1474 for simplex_id in range(bx.tri.nsimplex):
1475 # zde jen počítame
1476 bx.estimate_simplex(simplex_id)
1477
1478
1479
1448 1480
1449 1481 def estimate_simplex(bx, simplex_id): def estimate_simplex(bx, simplex_id):
1450 1482 """ """
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