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)
f_models: little refactoring, performance boost is not almost visible, though a34473ad2ef19973c69bde8b8c6aa29eb1614399 Олёш 2020-08-23 21:52:43
candybox: little fix 65cbd8d0fdbfd80cfa46d2fd7d87d2226b7b2c12 Олёш 2020-08-22 23:50:26
f_models, SNorm: little fix at .add_sample, a little bit better performance 49e808b07d199e8c97d7dfcda24428e8c2a081ec Олёш 2020-08-22 23:48:09
blackbox, OptimizedCensoredSampling: little refactoring, a little better performance 9825bf5531f52acb2af3bdc3b10b4c8c67101300 Олёш 2020-08-22 23:45:44
g_models: four_branch_2D refactored into the class FourBranch2D 5c60519a95121530e97e0a452b2c4ab8926c46fd I am 2020-08-21 21:45:14
LHS turned off, new test function 'Sball' 22057718d681144478dc5ea2b4e94c60394eb4c9 Miroslav Vořechovský 2020-08-13 15:53:55
gl_plot: ready 4c52875c06ecd32dddbbcb9d3638033ece5fb34b Alex 2020-08-11 01:42:53
gl_plot: SimplexEstimationWidget now almost works d25a5a4048d55090c53d63368882f3ae4027236f Alex 2020-08-10 23:34:29
gl_plot: už je to hustý ebcbd27e880f61bece09e126617cf46554f3a41d Alex 2020-08-10 18:26:44
gl_plot: WIP e9032c2b108b42630e8ae894ab9badf4ac4d2064 Alex 2020-08-10 07:27:45
gl_plot: WIP b746a2b7f175681bafbbabb4de8eaae673afdf9b Alex 2020-08-10 01:28:45
blackbox: optimized MinEnergy 6fc8e8bdf4ef1bfd2ae2a02a9b1231310794c0f2 Олёш 2020-08-08 00:09:10
blackbox: MinEnergyCensoredSampling: čístění -2 52ee13ca64742637edf6d05fd8c704f7bfd91cbe Олёш 2020-08-07 03:18:11
blackbox: MinEnergyCensoredSampling: candidates reworked to be more transparent 75018f40179a33136230a58bc03da52951e51f55 Олёш 2020-08-07 01:07:07
blackbox: little fix of p_outside in MinEnergyBlaBlaCensoringSampling f9defafad5f773f7715ed652a69434d5f06c48a3 Олёш 2020-08-06 22:10:32
qt_plot: CandidatesWidget added 1ae7241fe13df91c6df48324cd55774e8243c812 Олёш 2020-08-06 18:38:51
blackbox: KechatoTwoPointLukiskon added 2f2bb89e4a57742a7caf34375d5ce1b237d482c7 Олёш 2020-08-06 10:49:57
candybox: SettingWithCopyWarning disabled ac6951c3e667d3ba1cd128b1596955284439d53e Олёш 2020-08-06 10:46:10
blackbox: MinEnergyCensoredSampling is ready ba76383a0723c364aa44b79df51a320c0b8361cd Олёш 2020-08-04 10:12:25
blackbox: KechatoLukiskon comed back! 01237377ef931193951b7446561c88b4e10c0dae Олёш 2020-08-04 00:56:09
Commit a34473ad2ef19973c69bde8b8c6aa29eb1614399 - f_models: little refactoring, performance boost is not almost visible, though
Author: Олёш
Author date (UTC): 2020-08-23 21:52
Committer name: Олёш
Committer date (UTC): 2020-08-23 21:52
Parent(s): 65cbd8d0fdbfd80cfa46d2fd7d87d2226b7b2c12
Signer:
Signing key:
Signing status: N
Tree: 75de12592d3a63a89c42770f0af5f99efc498019
File Lines added Lines deleted
f_models.py 82 55
File f_models.py changed (mode: 100644) (index 374c3af..e5853e8)
... ... class SNorm:
186 186
187 187
188 188 def add_sample(f, sample, space='R'): def add_sample(f, sample, space='R'):
189 """
190 Adds coordinates from input sample
191 """
192 newdata = f._parse_sample(sample, space)
193 f._data = np.vstack((f._data, newdata))
194
195
196 #č tohle už není "drobná pomucka"
197 #č to je jedná z funkcí, která běží 30% času
198 def new_sample(f, sample=None, space='R'):
199 """
200 Returns new f_model object with the same distribution and with coordinates from 'sample' taken
201 """
202 f_copy = copy.copy(f)
203 if sample is None:
204 f_copy._data = np.empty((0, f_copy._data.shape[1]), dtype=float)
205 else:
206 f_copy._data = np.atleast_2d(f._parse_sample(sample, space))
207 return f_copy
208
209
210 def _parse_sample(f, input_sample, space='R'):
189 211 # does sample is exactly me? # does sample is exactly me?
190 if f.__repr__() == sample.__repr__():
191 newdata = sample._data
212 if f.__repr__() == input_sample.__repr__():
213 newdata = input_sample._data
192 214
193 # new piece of code "alpha"-related
194 215 else: else:
216 try: # does sample is another f_model object?
217 sample = getattr(input_sample, space)
218 except AttributeError:
219 # no, it is just coordinates array
220 sample = input_sample
221
222 # new piece of code "alpha"-related
195 223 if space in ('aR', 'aRn', 'aGK', 'aG', 'aP', 'aU'): if space in ('aR', 'aRn', 'aGK', 'aG', 'aP', 'aU'):
196 # does sample is another f_model object?
197 try:
198 sample = getattr(sample, space) / f.alpha
199 except AttributeError:
200 sample = sample / f.alpha
224 sample = sample / f.alpha
201 225 space = space[1:] space = space[1:]
202 226
203 227 if space in ('R', 'Rn', 'GK', 'G'): if space in ('R', 'Rn', 'GK', 'G'):
204 # does sample is another f_model object?
205 try:
206 sample_R = getattr(sample, space)
207 except AttributeError:
208 # no
209 sample_R = sample
228 sample_R = sample
210 229 sample_P = stats.norm.cdf(sample_R) sample_P = stats.norm.cdf(sample_R)
211 230
212 231 pdfs_R = stats.norm.pdf(sample_R) pdfs_R = stats.norm.pdf(sample_R)
 
... ... class SNorm:
217 236 newdata = np.hstack((sample_R, sample_P, pdf_R)) newdata = np.hstack((sample_R, sample_P, pdf_R))
218 237
219 238 elif space in ('P', 'U'): elif space in ('P', 'U'):
220 try:
221 sample_P = getattr(sample, space)
222 except AttributeError:
223 sample_P = sample
239 sample_P = sample
224 240 sample_R = stats.norm.ppf(sample_P) sample_R = stats.norm.ppf(sample_P)
225 241
226 242 pdfs_R = stats.norm.pdf(sample_R) pdfs_R = stats.norm.pdf(sample_R)
 
... ... class SNorm:
229 245 newdata = np.hstack((sample_R, sample_P, pdf_R.reshape(len(pdf_R), 1))) newdata = np.hstack((sample_R, sample_P, pdf_R.reshape(len(pdf_R), 1)))
230 246 else: else:
231 247 newdata = np.hstack((sample_R, sample_P, pdf_R)) newdata = np.hstack((sample_R, sample_P, pdf_R))
248
249 else:
250 raise ValueError('SNorm: unknown space %s' % space)
232 251
233 f._data = np.vstack((f._data, newdata))
234
235
236 # drobná pomucka
237 def new_sample(f, sample=None, space='R'):
238 f_copy = f()
239 if sample is not None:
240 f_copy.add_sample(sample, space)
241 return f_copy
252 return newdata
253
254
242 255
243 256
244 257 def pdf(f, space='R'): def pdf(f, space='R'):
 
... ... class UnCorD: # nic moc nazev, ale je přece lepší nez CommonJointDistribution
386 399 sl = slice(i*nvar, (i+1)*nvar) sl = slice(i*nvar, (i+1)*nvar)
387 400 return f._data[:,sl] return f._data[:,sl]
388 401
402
389 403 def add_sample(f, sample, space='R'): def add_sample(f, sample, space='R'):
404 """
405 Adds coordinates from input sample
406 """
407 newdata = f._parse_sample(sample, space)
408 f._data = np.vstack((f._data, newdata))
409
410
411 #č tohle už není "drobná pomucka"
412 #č to je jedná z funkcí, která běží 30% času
413 def new_sample(f, sample=None, space='R'):
414 """
415 Returns new f_model object with the same distribution and with coordinates from 'sample' taken
416 """
417 f_copy = copy.copy(f)
418 if sample is None:
419 f_copy._data = np.empty((0, f_copy._data.shape[1]), dtype=float)
420 else:
421 f_copy._data = np.atleast_2d(f._parse_sample(sample, space))
422 return f_copy
423
424
425 def _parse_sample(f, input_sample, space='R'):
390 426 # isinstance, ne? # isinstance, ne?
391 if f.__class__.__name__ == sample.__class__.__name__:
392 if f.marginals == sample.marginals:
393 f._data = np.vstack((f._data, sample._data))
394 return f
427 if f.__class__.__name__ == input_sample.__class__.__name__:
428 if f.marginals == input_sample.marginals:
429 if (space in ('R', 'Rn', 'P', 'GK', 'G', 'U')) or (f.alpha == input_sample.alpha):
430 return input_sample._data
395 431
432
433 # does sample is another f_model object?
434 try:
435 sample_ = getattr(input_sample, space)
436 except AttributeError:
437 # no
438 sample_ = input_sample
439
396 440 # new piece of code "alpha"-related # new piece of code "alpha"-related
397 elif space in ('aR', 'aRn', 'aGK', 'aG', 'aP', 'aU'):
398 # does sample is another f_model object?
399 try:
400 sample = getattr(sample, space) / f.alpha
401 except AttributeError:
402 sample = sample / f.alpha
441 if space in ('aR', 'aRn', 'aGK', 'aG', 'aP', 'aU'):
442 sample_ = sample_ / f.alpha
403 443 space = space[1:] space = space[1:]
404 444
405 445 elif space not in ('R', 'Rn', 'P', 'GK', 'G', 'U'): elif space not in ('R', 'Rn', 'P', 'GK', 'G', 'U'):
406 446 # co jako, mám gettext sem tahnout?! # co jako, mám gettext sem tahnout?!
407 raise ValueError('Zadaný prostor %s mi není znám' % space)
408 raise ValueError('Unknown space %s' % space)
447 raise ValueError('SNorm: zadaný prostor %s mi není znám' % space)
448 raise ValueError('SNorm: unknown space %s' % space)
409 449
410 # does sample is another f_model object?
411 try:
412 sample_ = getattr(sample, space)
413 except AttributeError:
414 # no
415 sample_ = sample
416 450
417 451 if space=='GK': if space=='GK':
418 452 space='G' space='G'
 
... ... class UnCorD: # nic moc nazev, ale je přece lepší nez CommonJointDistribution
427 461 pdf_R = np.prod(pdfs_R, axis=0).reshape(-1, 1) pdf_R = np.prod(pdfs_R, axis=0).reshape(-1, 1)
428 462 # nvar_Rn + nvar_R + nvar_P + nvar_G + pdf_R + pdf_G # nvar_Rn + nvar_R + nvar_P + nvar_G + pdf_R + pdf_G
429 463 newdata = np.hstack((sample_dict['Rn'], sample_dict['R'], sample_dict['P'], sample_dict['G'], pdf_R, pdf_G)) newdata = np.hstack((sample_dict['Rn'], sample_dict['R'], sample_dict['P'], sample_dict['G'], pdf_R, pdf_G))
430
431 f._data = np.vstack((f._data, newdata))
432
433
434 # drobná pomucka
435 def new_sample(f, sample=None, space='R'):
436 f_copy = f()
437 if sample is not None:
438 f_copy.add_sample(sample, space)
439 return f_copy
464
465 return newdata
466
440 467
441 468
442 469 def _chain(f, sample_dict): def _chain(f, sample_dict):
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