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_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
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
Commit a4d9fd7f841f9f56ee6ff0725315e988b0a683b5 - qt_plot: polishing (mainly, triangulation)
Author: Олёш
Author date (UTC): 2020-09-05 01:53
Committer name: Олёш
Committer date (UTC): 2020-09-05 01:53
Parent(s): 0dffc07efa9557f5660b0be669b4e42ff7b049e8
Signer:
Signing key:
Signing status: N
Tree: 492fcaf34e846fb1331a3a5796132266bcbd35d7
File Lines added Lines deleted
qt_plot.py 70 59
File qt_plot.py changed (mode: 100644) (index f014d26..7932c95)
... ... class LastShot:
418 418 self.item.setFlags(self.item.flags() | QtCore.Qt.ItemIsUserCheckable) self.item.setFlags(self.item.flags() | QtCore.Qt.ItemIsUserCheckable)
419 419 self.item.setCheckState(QtCore.Qt.Checked) self.item.setCheckState(QtCore.Qt.Checked)
420 420 self.w.list_view.addItem(self.item) self.w.list_view.addItem(self.item)
421 self.w.list_view.itemChanged.connect(self.plot)
421 self.w.list_view.itemChanged.connect(self.show_slot)
422 422
423 def show_slot(self, item):
424 if item is self.item:
425 self.plot()
423 426
424 427 def redraw(self): def redraw(self):
425 428 pos = () pos = ()
 
... ... class Circles:
456 459 self.item.setFlags(self.item.flags() | QtCore.Qt.ItemIsUserCheckable) self.item.setFlags(self.item.flags() | QtCore.Qt.ItemIsUserCheckable)
457 460 self.item.setCheckState(QtCore.Qt.Checked) self.item.setCheckState(QtCore.Qt.Checked)
458 461 self.w.list_view.addItem(self.item) self.w.list_view.addItem(self.item)
459 self.w.list_view.itemChanged.connect(self.plot)
462 self.w.list_view.itemChanged.connect(self.show_slot)
460 463
461 464
462 465 def redraw(self): def redraw(self):
 
... ... class Circles:
472 475
473 476 self.plot() self.plot()
474 477
475
478 def show_slot(self, item):
479 if item is self.item:
480 self.plot()
476 481
477 482 def plot(self): def plot(self):
478 483 if self.item.checkState(): if self.item.checkState():
 
... ... class Boundaries:
512 517 self.item.setFlags(self.item.flags() | QtCore.Qt.ItemIsUserCheckable) self.item.setFlags(self.item.flags() | QtCore.Qt.ItemIsUserCheckable)
513 518 self.item.setCheckState(QtCore.Qt.Checked) self.item.setCheckState(QtCore.Qt.Checked)
514 519 self.w.list_view.addItem(self.item) self.w.list_view.addItem(self.item)
515 self.w.list_view.itemChanged.connect(self.plot)
520 self.w.list_view.itemChanged.connect(self.show_slot)
516 521
517 522
518 523 def redraw(self): def redraw(self):
 
... ... class Boundaries:
531 536
532 537 self.plot() self.plot()
533 538
534
539 def show_slot(self, item):
540 if item is self.item:
541 self.plot()
535 542
536 543 def plot(self): def plot(self):
537 544 if self.item.checkState(): if self.item.checkState():
 
... ... class Triangulation:
559 566 self.w.list_view.addItem(self.item) self.w.list_view.addItem(self.item)
560 567
561 568
562 self.w.list_view.itemChanged.connect(self.replot)
569 self.w.list_view.itemChanged.connect(self.show_slot)
563 570
564 571
565 572
566 573 def redraw(self): def redraw(self):
567 574 self.simplices = np.empty((0,3), dtype=np.int) self.simplices = np.empty((0,3), dtype=np.int)
568 self.plot_items = np.empty(0, dtype=object)
575 self.plot_items = []
569 576 self.replot() self.replot()
570 577
571 578
579 def show_slot(self, item):
580 if item is self.item:
581 if (self.w.sample_box.nvar==2) and self.item.checkState():
582 for item in self.plot_items:
583 item.show()
584
585 #оӵ Мед сюредалоз!
586 self.replot()
587
588 else: #оӵ Медам сюреда!
589 for item in self.plot_items:
590 item.hide()
591
572 592
573 593
574 594 def replot(self): def replot(self):
 
... ... class Triangulation:
579 599 redraw the triangulation redraw the triangulation
580 600 """ """
581 601 if (self.w.sample_box.nvar==2) and self.item.checkState(): if (self.w.sample_box.nvar==2) and self.item.checkState():
582 try:
583 if len(self.plot_items) < self.w.sample_box.tri.nsimplex:
584 pos = ()
585 plot_widget = self.w.central_widget
586 gap = self.w.sample_box.tri.nsimplex - len(self.plot_items)
587 gap_items = []
588 for __ in range(gap):
589 gap_items.append(plot_widget.plot(pos=pos, pen=0.7))
590 self.plot_items = np.append(self.plot_items, gap_items)
591
602 try:
592 603 self.simplices = self.w.sample_box.tri.simplices self.simplices = self.w.sample_box.tri.simplices
593 self.draw_triangles(self.simplices, self.plot_items)
604 self.draw_triangles(range(self.w.sample_box.tri.nsimplex))
594 605
595 606 except BaseException as e: except BaseException as e:
596 msg = "error during triangulation drawing"
607 msg = "error during of triangulation replot"
597 608 print(self.__class__.__name__ + ":",msg, repr(e)) print(self.__class__.__name__ + ":",msg, repr(e))
598 609
599 else:
600 for item in self.plot_items:
601 item.hide()
602 610
603 611
604 612 def update(self): def update(self):
605 613 # update triangulation # update triangulation
606 614 if (self.w.sample_box.nvar==2) and self.item.checkState(): if (self.w.sample_box.nvar==2) and self.item.checkState():
607 615 try: #оӵ Мед сюредалоз! try: #оӵ Мед сюредалоз!
608 if len(self.plot_items) < self.w.sample_box.tri.nsimplex:
609 pos = ()
610 plot_widget = self.w.central_widget
611 gap = self.w.sample_box.tri.nsimplex - len(self.plot_items)
612 gap_items = np.empty(gap, dtype=object)
613 for i in range(gap):
614 gap_items[i] = plot_widget.plot(pos=pos, pen=0.7)
615 self.plot_items = np.append(self.plot_items, gap_items)
616 #č empty není bezpěčný - může obsahovat cokoliv
617 #č takže budeme se tešit na chvili, kdy to selže
618 #č jistě to bude nejméné vhodná chvile, nějaká konference...
619 former_simplices = np.append(self.simplices, np.empty((gap,3), dtype=np.int))
620 else:
621 former_simplices = self.simplices
622
616 former_simplices = self.simplices
623 617 self.simplices = self.w.sample_box.tri.simplices self.simplices = self.w.sample_box.tri.simplices
618
624 619 #č zkontrolujeme co se změnilo #č zkontrolujeme co se změnilo
625 620 #č předpokladám, že se počet simplexů přidaním bodů nezměnší #č předpokladám, že se počet simplexů přidaním bodů nezměnší
626 equal_mask = former_simplices == self.w.sample_box.tri.simplices
627 #č vůbec nechapu, proč se mi nechce prostě všecko udělat stejně jako v blackboxu?
628 mask = equal_mask.all(axis=1).flatten()
621 equal_mask = former_simplices == self.w.sample_box.tri.simplices[:len(former_simplices)]
622 changed_simplices_ids = np.argwhere(~equal_mask.all(axis=1)).flatten()
623 self.draw_triangles(changed_simplices_ids)
629 624
630 self.draw_triangles(self.simplices[~mask], self.plot_items[~mask])
631 for item in self.plot_items[mask]:
632 item.show()
625 #č teď nové simplexy
626 #ё simplexy свежего разлива
627 self.draw_triangles(range(len(former_simplices), self.w.sample_box.tri.nsimplex))
633 628
634 629 except BaseException as e: except BaseException as e:
635 msg = "error during triangulation drawing"
630 msg = "error during of triangulation update"
636 631 print(self.__class__.__name__ + ":",msg, repr(e)) print(self.__class__.__name__ + ":",msg, repr(e))
637
638 else: #оӵ Медам сюреда!
639 for item in self.plot_items:
640 item.hide()
632
641 633
642 634
643 635
644
645 def draw_triangles(self, simplices, plot_items):
636 #č já jsem tu všecko překopal protože .plot() a .setData() jsou nejžravejší na čas
637 #č a nemá žádnou cenu je provadet hned vedle sebe (spouští totéž dvakrát)
638 def draw_triangles(self, simplex_ids):
646 639 # take coordinates in the space, where triangulation has been performed # take coordinates in the space, where triangulation has been performed
647 640 sampled_plan_tri = getattr(self.w.sample_box, self.w.sample_box.tri_space) sampled_plan_tri = getattr(self.w.sample_box, self.w.sample_box.tri_space)
648 641
642 plot_widget = self.w.central_widget
643
649 644 if self.w.space == self.w.sample_box.tri_space: if self.w.space == self.w.sample_box.tri_space:
650 for triangle, plot_item in zip(simplices, plot_items):
645 for simplex_id in simplex_ids:
646 triangle = self.simplices[simplex_id]
651 647 pos = sampled_plan_tri[triangle[[0,1,2,0]]] pos = sampled_plan_tri[triangle[[0,1,2,0]]]
652 648
653 # Update the data
654 plot_item.setData(pos)
655 plot_item.show()
649
650 if simplex_id < len(self.plot_items):
651 # Update the data
652 plot_item = self.plot_items[simplex_id]
653 plot_item.setData(pos)
654 #plot_item.show()
655 else: #č spolehám na korektnost volajícího kódu
656 #оӵ Суредасько
657 plot_item = plot_widget.plot(pos, pen=0.7)
658 self.plot_items.append(plot_item)
659
656 660 else: else:
657 661 ns = 100 ns = 100
658 662 with pg.BusyCursor(): with pg.BusyCursor():
659 for triangle, plot_item in zip(simplices, plot_items):
663 for simplex_id in simplex_ids:
664 triangle = self.simplices[simplex_id]
660 665 # keep the GUI responsive :) # keep the GUI responsive :)
661 666 # it was quite slow on my target machine # it was quite slow on my target machine
662 667 self.w.app.processEvents() self.w.app.processEvents()
 
... ... class Triangulation:
671 676 tri_bound_tri = np.array((x_tri, y_tri)).T tri_bound_tri = np.array((x_tri, y_tri)).T
672 677 #č vytvořme sample #č vytvořme sample
673 678 tri_bound = self.w.sample_box.f_model.new_sample(tri_bound_tri, space=self.w.sample_box.tri_space) tri_bound = self.w.sample_box.f_model.new_sample(tri_bound_tri, space=self.w.sample_box.tri_space)
679 pos = getattr(tri_bound, self.w.space)
674 680
675 # Update the data
676 #print("Суредасько", tri_bound)
677 plot_item.setData(getattr(tri_bound, self.w.space))
678 plot_item.show()
681 if simplex_id < len(self.plot_items):
682 # Update the data
683 plot_item = self.plot_items[simplex_id]
684 plot_item.setData(pos)
685 #plot_item.show()
686 else: #č spolehám na korektnost volajícího kódu
687 #оӵ Суредасько
688 plot_item = plot_widget.plot(pos, pen=0.7)
689 self.plot_items.append(plot_item)
679 690
680 691
681 692
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