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)
whitebox: add four betas class 57a25000259e74f1ac28bb1bac6b0cc01dd5201c I am 2022-01-18 21:43:00
whitebox: introduce Gaussian_Z_prod_2D class with respective exact solution 13e592f107918d4cc3daaeec1f08e38779a943aa I am 2022-01-18 18:51:23
mplot: polish maxes and mfigs dfb9193da5fcb633fbe58fb39ff7b4432de4a5c5 I am 2022-01-18 00:44:56
testcases: add gaussian_2D module c5e279c08bba39bdd82c79d15d00241c786c795d I am 2022-01-18 00:06:36
qt_gui.qt_testcases: simplify code for the unparametrized testcases 60b7678186738107b3346beae7fb0744570d60fc I am 2022-01-18 00:05:34
mplot.mart: move setup_labels to mart module 9d7783a3a9905a72c51b4fec76e367dffdbc4563 I am 2022-01-17 17:33:16
mplot.__init__: set up small non zero padding (0.01) f0d23235b109c4224599eb0426ad0d9ee8b2a9b8 I am 2022-01-17 17:31:44
mplot: raster candidates, polishing 63d6d00dfe7affc8ed3d05161fd4a5b50db62207 I am 2022-01-17 16:34:05
mplot: more figures 3a7f54e09cd78a2fc2ff50d7cf5c142f04ffdc28 I am 2022-01-09 00:42:33
testcases: add proxy_prod 2D testcase edb11ab54bcf677757974f133d2d66816b701ade I am 2022-01-09 00:41:27
stm_df: fix proxy, pandas nějak nám šťourá v našich boolean maticích 1d9f360edfc03932a08dff8aad97f189b155e708 I am 2022-01-09 00:39:24
mplot.maxes: a little bit more to labels d989a2d1b69b116a14f7ff81776f5f75d80cfea0 I am 2022-01-06 17:48:57
mplot.figs: add double and triple triangulations plots 091361cc326239b552078c489f9f164ccda4f54b I am 2022-01-06 16:17:50
mplot.maxes: aspoň nějak nastavit popísky os 50e8e467c24d73d9522166183275deab547243f8 I am 2022-01-06 16:16:36
mplot.maxes: add labels to candidates plot f8aa0f271a8d30cb7d79206290409f862c406a51 I am 2022-01-06 12:14:48
mplot.maxes: add candidates sampling (rejection-like) plot 5a15e10a9a462dd409e0627528bcb8910df77c7e I am 2022-01-06 09:40:38
mplot.maxes: add candidates plot 11e156edc351ca84fde742edf7ea1d85c3b0bc38 I am 2022-01-06 08:15:43
mplot.maxes: polish tri plots a little bit 9a4e0a18061e2d9f48c0c32c200bd1a408ceb77f I am 2022-01-05 13:15:00
mplot.mart: add plot_points() function 2c799e22d9f45b825a7f8a795ce6b9fe5fbd9c76 I am 2022-01-05 13:14:12
mplot.maxes: add convergence diagrams 813b1e8e9dd9d1e51951c51234910cdf2281cde8 I am 2022-01-05 09:07:18
Commit 57a25000259e74f1ac28bb1bac6b0cc01dd5201c - whitebox: add four betas class
Author: I am
Author date (UTC): 2022-01-18 21:43
Committer name: I am
Committer date (UTC): 2022-01-18 21:43
Parent(s): 13e592f107918d4cc3daaeec1f08e38779a943aa
Signer:
Signing key:
Signing status: N
Tree: 7d537409fd74d8202e31ff76cb21b0b04b8fa5d9
File Lines added Lines deleted
testcases/gaussian_2D.py 55 32
whitebox.py 37 1
File testcases/gaussian_2D.py changed (mode: 100644) (index 248a233..16490c9)
... ... of different Gaussian 2D problems
9 9 import numpy as np import numpy as np
10 10 from .. import g_models as gm from .. import g_models as gm
11 11 from .. import f_models from .. import f_models
12 from ..whitebox import WhiteBox
12 from .. import samplebox #č pro proxy_prod
13 from ..whitebox import WhiteBox, Gaussian_Z_prod_2D, Gaussian_ProdFourBetas_2D
13 14
14 15 __all__ = [] __all__ = []
15 16
 
... ... def min_logistic():
91 92 add('prod_1') add('prod_1')
92 93 add('prod_5') add('prod_5')
93 94 def prod_1(): def prod_1():
94 return WhiteBox(f, gm.Z_prod(const=1))
95 return Gaussian_Z_prod_2D(const=1)
95 96 def prod_5(): def prod_5():
96 return WhiteBox(f, gm.Z_prod(const=5))
97 return Gaussian_Z_prod_2D(const=-5)
97 98
98 gm_z_prod = gm.Z_prod(const=5)
99 99
100 def proxy_prod(input_sample):
101 # očekávam, že get_R_coordinates mně vrátí 2D pole
102 sample = gm.get_R_coordinates(input_sample, 2)
103 x, y = sample.T
100
101 class ProxyProd:
102 def __init__(self, const=0):
103 self.const = const
104 #assert (const * sign) > 0
105 #self.sign = sign
106 self.true_gm = gm.Z_prod(const=const, sign=np.sign(self.const))
107 # wrap
108 self.get_2D_R_boundary = self.true_gm.get_2D_R_boundary
104 109
105 # osudná podmínka
106 mask = np.atleast_1d(np.sign(x)==np.sign(y)).astype(bool)
107 #č mrdáme na kontrolu. současný startup candybox vytvoří vždycky
108 input_sample.candybox.proxy = mask
109 sweet_sample = input_sample
110 #sweet_sample = CandyBox(input_sample, proxy=mask)
111
112 # zatím, pro jednoduchost, předpokladáme,
113 # že dostaváme vzorky po jednom
114 if np.all(mask):
115 # nevíme vůbec, co to je za funkci
116 # ale veříme, že víme co tam bude
117 g = np.full(len(sweet_sample), 1)
118 # s praznejm podpísem odmítá
119 return samplebox.SampleBox(sweet_sample, g, 'proxy_prod')
110 # sign
111 def __repr__(self):
112 return 'ProxyProd(const=%s)' % repr(self.const)
113
114 def __call__(self, input_sample):
115 #č očekávam, že get_R_coordinates mně vrátí 2D pole
116 sample = gm.get_R_coordinates(input_sample, 2)
117 x, y = sample.T
120 118
121 else: # deme počítat, bez b
122 true_sample = gm_z_prod(sweet_sample)
123 # padelame pospís
124 true_sample.gm_signature = 'proxy_prod'
125 return true_sample
119 #č osudná podmínka
120 mask = np.atleast_1d(np.sign(x)==(np.sign(y)*np.sign(self.const)))
121 #č mrdáme na kontrolu. současný startup candybox vytvoří vždycky
122 input_sample.candybox.proxy = mask
123 sweet_sample = input_sample
124 #sweet_sample = CandyBox(input_sample, proxy=mask)
125
126 #č zatím, pro jednoduchost, předpokladáme,
127 #č že dostaváme vzorky po jednom
128 if np.all(mask):
129 #č nevíme vůbec, co to je za funkci
130 #č ale veříme, že víme co tam bude
131 g = np.full(len(sweet_sample), 1)
132 #č s praznejm podpísem odmítá
133 return samplebox.SampleBox(sweet_sample, g, repr(self))
134
135 else: #č deme počítat, bez b
136 true_sample = self.true_gm(sweet_sample)
137 #č padelame pospís
138 true_sample.gm_signature = repr(self)
139 return true_sample
140
141
142 def _proxy_prod(const):
143 wt = Gaussian_Z_prod_2D(const=const)
144 wt.gm = ProxyProd(const)
145 #č padelame pospís
146 wt.samplebox.gm_signature = repr(wt.gm)
147 return wt
126 148
127 # wrap
128 proxy_prod.get_2D_R_boundary = gm_z_prod.get_2D_R_boundary
149 add('proxy_prod_1')
150 def proxy_prod_1():
151 return _proxy_prod(1)
129 152
130 153 add('proxy_prod_5') add('proxy_prod_5')
131 154 def proxy_prod_5(): def proxy_prod_5():
132 return WhiteBox(f, proxy_prod)
155 return _proxy_prod(-5)
133 156
134 157
135 158 """ """
 
... ... def sin_shields():
170 193 # beta == sqrt(30) # beta == sqrt(30)
171 194 add('prod_four_betas') add('prod_four_betas')
172 195 def prod_four_betas(): def prod_four_betas():
173 return WhiteBox(f, gm.Prod_FourBetas(beta=np.sqrt(30)))
196 return Gaussian_ProdFourBetas_2D(beta=np.sqrt(30))
174 197
175 198
176 199
File whitebox.py changed (mode: 100644) (index a7f4909..05cfad7)
... ... class Gaussian_Z_prod_2D(WhiteBox):
352 352 return 'Gaussian_Z_prod_2D' return 'Gaussian_Z_prod_2D'
353 353
354 354 def __repr__(wt): def __repr__(wt):
355 return 'Gaussian_Z_prod_2D(sign=%s, const=%s)' % (wt.sign, wt.const)
355 return 'Gaussian_Z_prod_2D(const=%s)' % wt.const
356
357 #č já jsem si najednou uvědomil, že v tomto modulu
358 #č mám náprosto hrozný mix Camel- a snailcas'u.
359 #č Výmluvím z toho tak, podtržitko odděluje rozdělení a nazev g-modelu
360 class Gaussian_ProdFourBetas_2D(WhiteBox):
361 def __init__(self, beta=2):
362 """
363 Breitung RESS 182 (2019) p. 99
364 """
365 assert beta > 0
366 self.beta = beta
367 self.const = self.beta**2/2
368
369 self.gm = g_models.Prod_FourBetas(self.beta)
370 self.f = f_models.SNorm(2)
371 #č na začatku nemáme vzorky - pouze rozdělení a podpís
372 self.sample_box = SampleBox(self.f(), gm_signature=self.gm_signature)
373 #č Rozdělení transformovaného náhodného čísla je zadano jako
374 # special.kn(0, np.abs(x)) / np.pi # Breitung RESS 182 (2019) p. 99
375 # kn(n, x) Modified Bessel function of the second kind of integer order n
376 # modstruve(v, x) Modified Struve function of order v at x
377 #č Odvození pf_exact z Maple
378 const = np.abs(self.const)
379 StruveL0 = special.modstruve(0, const)
380 StruveL1 = special.modstruve(1, const)
381 BesselK0 = special.kn(0, const)
382 BesselK1 = special.kn(1, const)
383 self.pf_exact = const * (1/const - (StruveL1 * BesselK0 + StruveL0 * BesselK1 + 2/np.pi * BesselK0))
384 self.pf_exact_method = 'exact (Bessel) solution'
385
386
387 def __str__(wt):
388 return 'Gaussian_ProdFourBetas_2D'
389
390 def __repr__(wt):
391 return 'Gaussian_ProdFourBetas_2D(beta=%s)' % wt.beta
356 392
357 393
358 394 class Lognormal_Z_prod(WhiteBox): #č ověřím to moje odvození... class Lognormal_Z_prod(WhiteBox): #č ověřím to moje odvození...
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