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.gl_plot: dát dohromady ConvexHull třídu 19f7fc6ebf130d07897dca3496d78e3208ddfa29 Aleksei Gerasimov 2022-01-30 03:03:07
qt_gui.gl_plot: Make 3D working at least for basic box 1d285206abd77b68207fae0a771b3e69b197a5aa Aleksei Gerasimov 2022-01-30 01:15:54
qt_gui: prepare 3D view startup 21648380b72f891cd267ff57e2b9bbbb1dc1d13f I am 2022-01-30 00:24:06
mplot.maxes.convergence_legend(): úpravit jeden index 6345b5d4c70dde76102e105c1accc1ca9b3adb40 I am 2022-01-29 19:12:43
mplot.mgraph.tri_estimation_plot: adjust zorder of lines 6cf6cef6d6e19eb4cb5e8cda24f2bdc75652221d I am 2022-01-28 02:44:50
add Z_min g_model and general testcase 806fa2dfea2042cda04cff9020b891d3e033b9aa I am 2022-01-27 17:17:19
mplot.mgraph.tri_estimation_plot: draw p_mixed line navíc b59ec8cbaeb671a130edee5df206d57099ecb9bf I am 2022-01-27 16:41:53
testcases.gaussian_2D: fix four branch pf_exact f9d0f71ad6a4e6af6843c6b36688b8a002495bdc I am 2022-01-27 06:14:40
mplot: add mprod plot, polish pprod 045c5401dad6abca019da21fd42da5bfb671b909 I am 2022-01-26 04:16:00
mplot.mfigs: add quadruple plot 8ef6b85bedc31f1908ce25634bda84bdc07edef9 I am 2022-01-26 01:30:01
testcases.gaussian_2D: add final pf value to metaball case 5be29e59b1cd789da32d62caff1dcfb9c231a40e I am 2022-01-26 01:28:52
g_models: add boundary finding for metaball function 5ea3011d11572d2fa98d77819cc1ba333e6b4016 I am 2022-01-26 00:38:21
mplot: polish ad5819ced9f1be64c8d731813c575c1ec854421d I am 2022-01-25 03:39:22
testcases.gaussian_2D: add pf_exact to the black swan 38e19e42884234afc467a0ee7af9699af1f84e96 I am 2022-01-25 03:37:59
mplot.maxes: pass nrod to plot_boundaries() b87c6c58900b2b7f9a11f238eb9b7f2b054e9abf I am 2022-01-24 21:06:35
mplot: fix global settings overwrite 28a6304a895b0f2f53482ae086f0f2900adfd65e I am 2022-01-24 21:02:56
qt_gui.qt_dicebox: add dumb DiceBox widget d609cbbd928859a7c2ebf05ecdec2878d5356f9c I am 2022-01-24 18:43:53
mplot.maxes: parametrize tri plots 395bbad17802accecdc978462b0aed5a8828534b I am 2022-01-23 04:35:10
mplot.maxes: adjust triple plot marker sizes and lineweights 7e8b6eea3a27569542b5d15a2002ee1b77205672 I am 2022-01-22 21:39:02
mplot.maxes: add convergence legend 59405e29e76faf2a74d5bddd994c0252f7dfdb7d I am 2022-01-22 01:48:40
Commit 19f7fc6ebf130d07897dca3496d78e3208ddfa29 - qt_gui.gl_plot: dát dohromady ConvexHull třídu
Author: Aleksei Gerasimov
Author date (UTC): 2022-01-30 03:03
Committer name: Aleksei Gerasimov
Committer date (UTC): 2022-01-30 03:03
Parent(s): 1d285206abd77b68207fae0a771b3e69b197a5aa
Signer:
Signing key:
Signing status: N
Tree: 6bba72fd6ae657645f654f0c6e8d980ab903e8c7
File Lines added Lines deleted
qt_gui/gl_plot.py 83 75
File qt_gui/gl_plot.py changed (mode: 100644) (index d6aced1..b7c45ec)
... ... import pandas as pd # required for estimation graph
13 13 from scipy import spatial from scipy import spatial
14 14
15 15 from .. import estimation as stm from .. import estimation as stm
16 from .. import convex_hull as khull
17 from .. import simplex as six
16 18 from . import qt_gui from . import qt_gui
17 19 from . import qt_plot from . import qt_plot
18 20
 
... ... class Grid:
267 269
268 270
269 271
270
272 #č mění se význám, semantika třídy
273 #č teď to není nástroj pro kontrolu skříňky, ale
274 #č ale pro zobrazování hezkých obrázků
275 #č teď se mi to víc hodí do krámu
271 276 class ConvexHull(gl.GLMeshItem): class ConvexHull(gl.GLMeshItem):
272 277 def __init__(self, w): def __init__(self, w):
273 278 ## Mesh item will automatically compute face normals. ## Mesh item will automatically compute face normals.
 
... ... class ConvexHull(gl.GLMeshItem):
278 283 self.w = w self.w = w
279 284 #č já asi nechcu ani snažit sa něčo zobraziť #č já asi nechcu ani snažit sa něčo zobraziť
280 285 #č z více dimenzí #č z více dimenzí
281 if self.w.sample_box.nvar == 3:
282 self.w.box_runned.connect(self.plot)
286 if self.w.sample_box.nvar == 3:
287 self.w.slice_changed.connect(self.plot)
288 #č slice_changed postačí, zahrnuje i box_runned
289 #self.w.box_runned.connect(self.plot)
283 290 self.w.space_changed.connect(self.plot) self.w.space_changed.connect(self.plot)
284 291 self.w.redraw_called.connect(self.redraw) self.w.redraw_called.connect(self.redraw)
285 292
 
... ... class ConvexHull(gl.GLMeshItem):
298 305
299 306
300 307 def redraw(self): def redraw(self):
301 try:
302 self.plot()
303 self.w.central_widget.addItem(self)
304 except BaseException as e:
305 msg = "Redraw failed "
306 error_msg = self.__class__.__name__ + ": " + msg + repr(e)
307 print(error_msg)
308 self.plot()
309 self.w.central_widget.addItem(self)
308 310
309 311 def recalculate(self): def recalculate(self):
310 if (self.w.sample_box.nsim != len(self.w.sample_box.convex_hull.points)):
311 #č ConvexHull nemichá vzorky a nedělá ďupy - byla to chyba v Blackboxu
312 print(self.__class__.__name__ + \
313 ": convex hull points mismatch. Switching to the failsafe code.")
314 sampled_plan_tri = getattr(self.w.sample_box, self.w.sample_box.tri_space)
315 tree = spatial.cKDTree(sampled_plan_tri)
316 self.points = self.w.sample_box.convex_hull.points
317 dd, ii = tree.query(self.points, k=1, p=2)
318
319 self.simplices = self.w.sample_box.convex_hull.simplices
320 box_facets = ii[self.simplices.flatten()].reshape(-1, 3)
321 self.events = self.w.sample_box.get_events(box_facets)
322
323
324 nodes_colors = np.empty((self.w.sample_box.nsim, 4))
325 nodes_colors[self.w.sample_box.failsi] = np.array([253, 93, 97, 0])/255
326 nodes_colors[~self.w.sample_box.failsi] = np.array([67, 255, 81, 0])/255
327
328
329 self.vertex_colors = nodes_colors[ii]
330
331 else: #č reabilitace ConvexHull
332 self.points = self.w.sample_box.convex_hull.points
333 self.simplices = self.w.sample_box.convex_hull.simplices
334 self.events = self.w.sample_box.get_events(self.simplices)
335
336
337 nodes_colors = np.empty((self.w.sample_box.nsim, 4))
338 nodes_colors[self.w.sample_box.failsi] = np.array([253, 93, 97, 0])/255
339 nodes_colors[~self.w.sample_box.failsi] = np.array([67, 255, 81, 0])/255
340
341
342 self.vertex_colors = nodes_colors
343
344
345
312 nsim = self.w.slider.value()
313 sample_box = self.w.sample_box[:nsim]
314
315 qhull = khull.QHull(sample_box, space=self.w.space, incremental=False)
346 316
317
318 self.points = qhull.points
319 self.simplices = qhull.simplices
320 self.events = six.get_events(sample_box, self.simplices)
321
322 nodes_colors = np.empty((self.w.sample_box.nsim, 4))
323 nodes_colors[self.w.sample_box.failsi] = np.array([253, 93, 97, 0])/255
324 nodes_colors[~self.w.sample_box.failsi] = np.array([67, 255, 81, 0])/255
325
326 self.vertex_colors = nodes_colors
327
347 328 # marker # marker
348 329 self.nsim = self.w.sample_box.nsim self.nsim = self.w.sample_box.nsim
349 330
331 #č kus kódu jako historická památka
332 #č doposud si pamatuji, jak jsem tu kvůli vlástní chybě bojoval s ConvexHull'em
333 #č pak ConvexHull byl reabilitován
334 ## if (self.w.sample_box.nsim != len(self.w.sample_box.convex_hull.points)):
335 ## #č ConvexHull nemichá vzorky a nedělá ďupy - byla to chyba v Blackboxu
336 ## print(self.__class__.__name__ + \
337 ## ": convex hull points mismatch. Switching to the failsafe code.")
338 ## sampled_plan_tri = getattr(self.w.sample_box, self.w.sample_box.tri_space)
339 ## tree = spatial.cKDTree(sampled_plan_tri)
340 ## self.points = self.w.sample_box.convex_hull.points
341 ## dd, ii = tree.query(self.points, k=1, p=2)
342 ##
343 ## self.simplices = self.w.sample_box.convex_hull.simplices
344 ## box_facets = ii[self.simplices.flatten()].reshape(-1, 3)
345 ## self.events = self.w.sample_box.get_events(box_facets)
346 ##
347 ##
348 ## nodes_colors = np.empty((self.w.sample_box.nsim, 4))
349 ## nodes_colors[self.w.sample_box.failsi] = np.array([253, 93, 97, 0])/255
350 ## nodes_colors[~self.w.sample_box.failsi] = np.array([67, 255, 81, 0])/255
351 ##
352 ##
353 ## self.vertex_colors = nodes_colors[ii]
354
355
350 356
351 357 def plot(self): def plot(self):
352 try:
353 if (self.failure_item.checkState() + self.success_item.checkState())\
354 and (self.w.space == self.w.sample_box.tri_space):
355
356 if self.nsim != self.w.sample_box.nsim:
358 if (self.failure_item.checkState() + self.success_item.checkState())\
359 and (self.w.slider.value() > 3):
360 try:
361 if self.nsim != self.w.slider.value():
357 362 self.recalculate() self.recalculate()
358 363
359 364 #face_colors = np.empty((len(self.simplices), 4), dtype=np.int16) #face_colors = np.empty((len(self.simplices), 4), dtype=np.int16)
 
... ... class ConvexHull(gl.GLMeshItem):
377 382 drawEdges=True, edgeColor=(1, 1, 0, 1)) drawEdges=True, edgeColor=(1, 1, 0, 1))
378 383
379 384 self.show() self.show()
380 else:
381 self.hide()
382 except BaseException as e:
383 msg = "nepovedlo se nám spočítat konvexní obálku "
384 error_msg = self.__class__.__name__ + ": " + msg + repr(e)
385 print(error_msg)
385 except BaseException as e:
386 msg = "nepovedlo se nám spočítat konvexní obálku "
387 error_msg = self.__class__.__name__ + ": " + msg + repr(e)
388 print(error_msg)
389 else:
390 self.hide()
391
386 392
387 393
388
394 #č mění se význám, semantika třídy
395 #č teď to není nástroj pro kontrolu skříňky, ale
396 #č ale pro zobrazování hezkých obrázků
397 #č teď se mi to víc hodí do krámu
389 398 class Facets(gl.GLMeshItem): class Facets(gl.GLMeshItem):
390 399 def __init__(self, w): def __init__(self, w):
391 400 ## Mesh item will automatically compute face normals. ## Mesh item will automatically compute face normals.
 
... ... class Facets(gl.GLMeshItem):
397 406 #č já asi nechcu ani snažit sa něčo zobraziť #č já asi nechcu ani snažit sa něčo zobraziť
398 407 #č z více dimenzí #č z více dimenzí
399 408 if self.w.sample_box.nvar == 3: if self.w.sample_box.nvar == 3:
400 self.w.box_runned.connect(self.plot)
409 self.w.slice_changed.connect(self.plot)
410 #č slice_changed postačí, zahrnuje i box_runned
411 #self.w.box_runned.connect(self.plot)
401 412 self.w.space_changed.connect(self.plot) self.w.space_changed.connect(self.plot)
402 413 self.w.redraw_called.connect(self.redraw) self.w.redraw_called.connect(self.redraw)
403 414
 
... ... class Facets(gl.GLMeshItem):
416 427
417 428
418 429 def redraw(self): def redraw(self):
419 try:
420 self.plot()
421 self.w.central_widget.addItem(self)
422 except BaseException as e:
423 msg = "Redraw failed "
424 error_msg = self.__class__.__name__ + ": " + msg + repr(e)
425 print(error_msg)
430 self.plot()
431 self.w.central_widget.addItem(self)
426 432
427 433 def recalculate(self): def recalculate(self):
428 434 self.points = self.w.sample_box.tri.points self.points = self.w.sample_box.tri.points
 
... ... class Facets(gl.GLMeshItem):
480 486 self.hide() self.hide()
481 487
482 488 except BaseException as e: except BaseException as e:
489 self.hide()
483 490 msg = "nepovedlo se nám spočítat stěny " msg = "nepovedlo se nám spočítat stěny "
484 491 error_msg = self.__class__.__name__ + ": " + msg + repr(e) error_msg = self.__class__.__name__ + ": " + msg + repr(e)
485 492 print(error_msg) print(error_msg)
486 493
487 494
488
495 #č mění se význám, semantika třídy
496 #č teď to není nástroj pro kontrolu skříňky, ale
497 #č ale pro zobrazování hezkých obrázků
498 #č teď se mi to víc hodí do krámu
489 499 class Wireframe(gl.GLMeshItem): class Wireframe(gl.GLMeshItem):
490 500 def __init__(self, w): def __init__(self, w):
491 501 super().__init__(smooth=False, drawFaces=False, drawEdges=True) super().__init__(smooth=False, drawFaces=False, drawEdges=True)
 
... ... class Wireframe(gl.GLMeshItem):
495 505 #č já asi nechcu ani snažit sa něčo zobraziť #č já asi nechcu ani snažit sa něčo zobraziť
496 506 #č z více dimenzí #č z více dimenzí
497 507 if self.w.sample_box.nvar == 3: if self.w.sample_box.nvar == 3:
498 self.w.box_runned.connect(self.plot)
508 self.w.slice_changed.connect(self.plot)
509 #č slice_changed postačí, zahrnuje i box_runned
510 #self.w.box_runned.connect(self.plot)
499 511 self.w.space_changed.connect(self.plot) self.w.space_changed.connect(self.plot)
500 512 self.w.redraw_called.connect(self.redraw) self.w.redraw_called.connect(self.redraw)
501 513
 
... ... class Wireframe(gl.GLMeshItem):
509 521
510 522
511 523 def redraw(self): def redraw(self):
512 try:
513 self.plot()
514 self.w.central_widget.addItem(self)
515 except BaseException as e:
516 msg = "Redraw failed "
517 error_msg = self.__class__.__name__ + ": " + msg + repr(e)
518 print(error_msg)
524 self.plot()
525 self.w.central_widget.addItem(self)
519 526
520 527 def recalculate(self): def recalculate(self):
521 528 self.points = self.w.sample_box.tri.points self.points = self.w.sample_box.tri.points
 
... ... class Wireframe(gl.GLMeshItem):
543 550 else: else:
544 551 self.hide() self.hide()
545 552 except BaseException as e: except BaseException as e:
553 self.hide()
546 554 msg = "nepovedlo se nám spočítat stěny " msg = "nepovedlo se nám spočítat stěny "
547 555 error_msg = self.__class__.__name__ + ": " + msg + repr(e) error_msg = self.__class__.__name__ + ": " + msg + repr(e)
548 556 print(error_msg) print(error_msg)
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