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)
shapeshare, dicebox: let's try new names 4adeaac518cc1bd304e966c9502b19a72ec50c39 Олёш 2020-10-01 18:30:52
IS_stat: cycle fix in ISSI.delete_event_data() aa7667add8d6ebf9338d33a23c769681340c7742 Олёш 2020-09-30 23:22:41
simplex: novej bombastickej... ok, I mean, new elegant Shull object 28375fa49a07057f09f1afeb8d4916b0f1bc87ac Олёш 2020-09-30 23:18:25
blackbox, simplex: WIP f66479b0e3f8ce8866466a263cd80ba227098c82 Олёш 2020-09-29 00:57:33
blackbox, simplex: WIP 255033055fd2db7ab1445618cfe476c14b527d22 Олёш 2020-09-28 19:58:06
simplex: helper functions are prepared df48adbb92dd80421d0ec4e6c087db7919cda7c7 Олёш 2020-09-28 17:42:24
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
Commit 4adeaac518cc1bd304e966c9502b19a72ec50c39 - shapeshare, dicebox: let's try new names
Author: Олёш
Author date (UTC): 2020-10-01 18:30
Committer name: Олёш
Committer date (UTC): 2020-10-01 18:30
Parent(s): aa7667add8d6ebf9338d33a23c769681340c7742
Signer:
Signing key:
Signing status: N
Tree: 65aee660271c855c89a066b5a9161ede7c1d1a65
File Lines added Lines deleted
dicebox.py 44 42
shapeshare.py 0 0
File dicebox.py copied from file blackbox.py (similarity 97%) (mode: 100644) (index 251ec1a..ecdf0b0)
2 2 # coding: utf-8 # coding: utf-8
3 3
4 4 """ """
5 Zde leží BlackBox (tuším, bude jeden)
6 BlackBox pěčlivě ukladá věškerá data,
5
6 Zde leží DiceBox (tuším, bude jeden)
7 DiceBox pěčlivě ukladá věškerá data,
7 8 věškeré sady vzorků, průběžné odhady a tak. věškeré sady vzorků, průběžné odhady a tak.
8 Nejsem už jistý, zda BlackBox je šťastný nazev, neboť
9 Nejsem už jistý, zda DiceBox je šťastný nazev, neboť
9 10 teďkom je to spíše jen krabička pro krámy teďkom je to spíše jen krabička pro krámy
10 11 """ """
11 12
 
... ... from scipy import optimize # for BlackSimpleX
24 25 import inspect # for ._log() function import inspect # for ._log() function
25 26
26 27 from .samplebox import SampleBox # for candidates packing from .samplebox import SampleBox # for candidates packing
27 from . import simplex as six # probably calling it "six" wasn't so good idea
28 28 from . import simplex as sx from . import simplex as sx
29 29 from . import lukiskon as lk from . import lukiskon as lk
30 30
 
... ... class GuessBox:
102 102 print('GuessBox is in air mode') print('GuessBox is in air mode')
103 103
104 104
105 class BlackBox:
105 class DiceBox:
106 106 """ """
107 BlackBox pěčlivě ukladá věškerá data,
107 DiceBox pěčlivě ukladá věškerá data,
108 108 věškeré sady vzorků (well, no yet), průběžné odhady a tak. věškeré sady vzorků (well, no yet), průběžné odhady a tak.
109 Nejsem už jistý, zda BlackBox je šťastný nazev, neboť
109 Nejsem už jistý, zda DiceBox je šťastný nazev, neboť
110 110 teďkom je to spíše jen krabička pro krámy teďkom je to spíše jen krabička pro krámy
111
112 .sampled_plan object
113 .Z = g_values
114 .failsi
115
116 Souřadnice primárně z prostoru modelu, ty co jsme rovnou
117 posilali do g_modelu!
118
119 111 """ """
120 112 def __init__(bx, sample_box): def __init__(bx, sample_box):
121 113 bx.sample_box = sample_box bx.sample_box = sample_box
 
... ... class BlackBox:
127 119 bx.candidates = sample_box.sampled_plan() bx.candidates = sample_box.sampled_plan()
128 120
129 121 # nové uložiště odhadů zadám explicitně, aby se pak # nové uložiště odhadů zadám explicitně, aby se pak
130 # odhady v stm kodu přířazovaly zprávné krabice
122 # odhady v stm kodu přířazovaly správné krabičce
131 123 bx.estimations = [] bx.estimations = []
132 # má bejt GuessBox součástí BlackBoxu?
124 # má bejt GuessBox součástí DiceBoxu?
133 125 try: try:
134 126 bx.guessbox = GuessBox(sample_box.filename, flush=20) bx.guessbox = GuessBox(sample_box.filename, flush=20)
135 127 except: except:
 
... ... class BlackBox:
137 129 bx.regen() bx.regen()
138 130
139 131 def __repr__(bx): def __repr__(bx):
140 return "%s(%s)"%('BlackBox', repr(bx.sample_box))
132 return "%s(%s)"%('DiceBox', repr(bx.sample_box))
141 133
142 134 def __str__(bx): def __str__(bx):
143 return str('BlackBox ' + bx.sample_box)
135 return str('DiceBox ' + bx.sample_box)
144 136
145 137 def __len__(bx): def __len__(bx):
146 138 return bx.sample_box.nsim return bx.sample_box.nsim
 
... ... class BlackBox:
157 149 # stačí vratit sample_box # stačí vratit sample_box
158 150 return bx.sample_box[slice] return bx.sample_box[slice]
159 151
160 def __getattr__(bx, attr):
161 if attr == 'blackbox':
162 return bx
152 def __getattr__(dx, attr):
153 if attr == 'dicebox':
154 return dx
163 155
164 156 # branime sa rekurzii # branime sa rekurzii
165 157 # defend against recursion # defend against recursion
 
... ... class BlackBox:
239 231 print("\t"*indent, inspect.currentframe().f_back.f_code.co_name + ":", *msg) print("\t"*indent, inspect.currentframe().f_back.f_code.co_name + ":", *msg)
240 232
241 233
242 # The BlackBox Observer
234 # The DiceBox Observer
243 235 def _logger(self, *args, msg="", indent=0, **kwargs): def _logger(self, *args, msg="", indent=0, **kwargs):
244 236 print(self.__class__.__name__ + ":" + msg, *args, kwargs) print(self.__class__.__name__ + ":" + msg, *args, kwargs)
245 237
 
... ... class BlackBox:
255 247
256 248
257 249
258 class Censoring(BlackBox):
250 class Censoring(DiceBox):
259 251 def __init__(bx, sample_object, tri_space='Rn'): def __init__(bx, sample_object, tri_space='Rn'):
260 252 bx.tri_space = tri_space bx.tri_space = tri_space
261 253 super().__init__(sample_object) super().__init__(sample_object)
 
... ... class MinEnergyCensoredSampling(Censoring):
736 728 # už mě to dědění nebaví # už mě to dědění nebaví
737 729 # без поллитры не разберёшься, что этот слоёный пирог делает # без поллитры не разберёшься, что этот слоёный пирог делает
738 730 def __init__(bx, sample_object, tri_space='Rn', tree_space=None,\ 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):
731 sampling_space=None, kechato_space='U', potencial='psee',\
732 p_norm=2, budget=1000, simplex_budget=100, LHS_correction=False):
733
741 734
742 bx.sball = sball.Sball(sample_object.nvar)
743 bx.base_r = bx.sball.get_r(0.5)
744 735
745 736 if tree_space is None: if tree_space is None:
746 737 bx.tree_space = tri_space bx.tree_space = tri_space
 
... ... class MinEnergyCensoredSampling(Censoring):
751 742 bx.sampling_space = tri_space bx.sampling_space = tri_space
752 743 else: else:
753 744 bx.sampling_space = sampling_space bx.sampling_space = sampling_space
745
746
754 747
755 748 bx.kechato_space = kechato_space bx.kechato_space = kechato_space
756 749 # pro simplexy. Chcu ukladat jejich míry # pro simplexy. Chcu ukladat jejich míry
 
... ... class MinEnergyCensoredSampling(Censoring):
760 753 bx.simplex_budget = simplex_budget bx.simplex_budget = simplex_budget
761 754 bx.p_norm = p_norm bx.p_norm = p_norm
762 755 bx.potencial = potencial bx.potencial = potencial
756 bx.LHS_correction = LHS_correction
763 757
764 758 # for current candidates # for current candidates
765 759 # kandidaty musí být 'judged' a 'assessed' # kandidaty musí být 'judged' a 'assessed'
 
... ... class MinEnergyCensoredSampling(Censoring):
783 777 """ """
784 778 # super TRYES to create .tri triangulation # super TRYES to create .tri triangulation
785 779 super().regen() super().regen()
786 # zás mám vyhodit odhady?
787 bx.siss = IS_stat.ISSI()
780
788 781 # kind of interface to CandidatesWidget # kind of interface to CandidatesWidget
789 782 bx.candidates_index = dict() bx.candidates_index = dict()
790 783
791 # needed for potencial calculation
792 sampled_plan_tree = getattr(bx.sample_box, bx.tree_space)
793 bx.tree = spatial.cKDTree(sampled_plan_tree)
794 784
785 if bx.nsim > 0:
786 # needed for potencial calculation
787 sampled_plan_tree = getattr(bx.sample_box, bx.tree_space)
788 bx.tree = spatial.cKDTree(sampled_plan_tree)
795 789
796 790 bx._regen_outside() bx._regen_outside()
797 791 bx._regen_inside() bx._regen_inside()
 
... ... class MinEnergyCensoredSampling(Censoring):
800 794
801 795 def _regen_outside(bx): def _regen_outside(bx):
802 796 # function reserved for childs # function reserved for childs
803 pass
797 pass
798
804 799
805 800
806 801 def _regen_inside(bx): def _regen_inside(bx):
807 802 if "tri" in dir(bx): if "tri" in dir(bx):
808 # tri - Deloneho triangulace
803 #č tri - Deloneho triangulace
804 bx.sball = sball.Sball(bx.nvar)
805 bx.base_r = bx.sball.get_r(0.5)
806
807 #č odhady
808 bx.siss = IS_stat.ISSI()
809
809 810 bx.simplex_events = bx.get_events() bx.simplex_events = bx.get_events()
810 811 bx.estimate_outside() bx.estimate_outside()
811 812 for simplex_id in range(bx.tri.nsimplex): for simplex_id in range(bx.tri.nsimplex):
 
... ... class MinEnergyCensoredSampling(Censoring):
819 820 bx.assess_candidates(candidates) bx.assess_candidates(candidates)
820 821 # uložíme # uložíme
821 822 bx.candidates_index[-1] = candidates bx.candidates_index[-1] = candidates
822
823
823 824
824 825
825 826
 
... ... class OptimizedCensoredSampling(MinEnergyCensoredSampling):
1254 1255 def _regen_outside(bx): def _regen_outside(bx):
1255 1256 if bx.nsim >= bx.nvar + 1: if bx.nsim >= bx.nvar + 1:
1256 1257 try: try:
1257 bx.convex_hull = spatial.ConvexHull(getattr(bx.sampled_plan, bx.tri_space), incremental=True)
1258 bx.shull = sx.Shull(bx.f_model, bx.budget, bx.tri_space, bx.sampling_space, powerset_correction=False)
1259 bx.siss = bx.shull.oiss
1258 1260 bx.estimate_outside() bx.estimate_outside()
1259 1261 #č a máme hotovo #č a máme hotovo
1260 1262 return # Ok, go away return # Ok, go away
 
... ... class OptimizedCensoredSampling(MinEnergyCensoredSampling):
1417 1419
1418 1420
1419 1421 #č řeším problém, že při načítaní ze souboru #č řeším problém, že při načítaní ze souboru
1420 #č blackbox nemá adekvatní odhad Brno-venkova
1422 #č DiceBox nemá adekvatní odhad Brno-venkova
1421 1423 while len(candidates) < 2: while len(candidates) < 2:
1422 1424 p_out = p_out/2 p_out = p_out/2
1423 1425 bx._logger(msg="suppose p_out="+str(p_out)) bx._logger(msg="suppose p_out="+str(p_out))
 
... ... class FastSimpleX(OptimizedCensoredSampling):
1703 1705
1704 1706 #č alternativní název je #č alternativní název je
1705 1707 #:) UltimateFastOptimizationOptimizedMinDistanceEnergyAdaptiveCensoringSampling #:) UltimateFastOptimizationOptimizedMinDistanceEnergyAdaptiveCensoringSampling
1706 class BlackSimpleX(OptimizedCensoredSampling):
1708 class DiceSimpleX(OptimizedCensoredSampling):
1707 1709
1708 1710 #č rozdil je v chybejicích odhadéch #č rozdil je v chybejicích odhadéch
1709 1711 def _handle_changed_triangulation(bx, input_sample): def _handle_changed_triangulation(bx, input_sample):
 
... ... class BlackSimpleX(OptimizedCensoredSampling):
1890 1892
1891 1893
1892 1894 #♥♥♥♥♥♥ #♥♥♥♥♥♥
1893 # BlackBoxiCheck
1894 class KechatoLukiskon(BlackBox):
1895 # DiceBoxiCheck
1896 class KechatoLukiskon(DiceBox):
1895 1897 def __init__(kl, sample_object, model_space='Rn', sampling_space=None, kechato_space='Rn', p_norm=1, gradient=None, budget=20000): def __init__(kl, sample_object, model_space='Rn', sampling_space=None, kechato_space='Rn', p_norm=1, gradient=None, budget=20000):
1896 1898 kl.model_space = model_space kl.model_space = model_space
1897 1899 kl.sampling_space = sampling_space kl.sampling_space = sampling_space
 
... ... class KechatoLukiskon(BlackBox):
1955 1957
1956 1958
1957 1959 #♥♥♥♥♥♥♥♥♥♥♥♥ #♥♥♥♥♥♥♥♥♥♥♥♥
1958 class KechatoTwoPointLukiskon(BlackBox):
1960 class KechatoTwoPointLukiskon(DiceBox):
1959 1961 def __init__(kl, sample_object, model_space='Rn', sampling_space=None, kechato_space='Rn', p_norm=1, gradient=None, budget=20000): def __init__(kl, sample_object, model_space='Rn', sampling_space=None, kechato_space='Rn', p_norm=1, gradient=None, budget=20000):
1960 1962 kl.model_space = model_space kl.model_space = model_space
1961 1963 kl.sampling_space = sampling_space kl.sampling_space = sampling_space
File shapeshare.py copied from file whitebox.py (similarity 100%)
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