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: ConvexHull2D added bc95406166c081db1df39c60099b908bf24aa16e I am 2020-11-03 19:33:28
dicebox.Chrt.assess_candidates: hračky s hustotama 0fa8f1fe51cebbca7010f3c8cda13525dfbb8fd6 I am 2020-11-03 03:38:52
dicebox: get_pf_estimations() fix 6eda04f0abf77b2586b599dd72c82e438464be4d I am 2020-11-03 02:21:37
dicebox: Erjee class added ef1a9e5b9c0de5d842e2580d3fe7c669d68d95f5 I am 2020-11-03 01:16:04
dicebox.Chrt: .get_pf_estimation() added 7b6685587ad2d7922ae12520c9aede226febe219 I am 2020-10-27 16:05:32
simplex.Shull: нельзя так просто взять и написать IS интегровалку 128ee86c97c82e555fb8b94a90eaa071f873737a I am 2020-10-27 16:03:07
simplex.Shull: move sball sampling distribution to the conter of convex_hull 5703fa4c8e4e70965040e9381cf888220ac543dc I am 2020-10-26 21:03:34
gl_plot: show first 3 dims of nD problems eedca2d89211340a8c2f1131b35c83c65f8f3bc7 Alex 2020-10-26 18:38:21
dicebox.Chrt: explore .convex_hull for gl_plot f2b7777c01638a72b8ca3b38aa3d75bfd55bbdc0 Alex 2020-10-26 18:37:17
gl_plot.ConvexHull: ConvexHull reabilitation 188903a3b14611f8a36d22120fc5fd398d7a79b2 Alex 2020-10-26 17:46:32
blackbox.OptimizedCensoringSampling: double adding to ConvexHull fix (only historical meaning) ddd2fbdf40aed2840a66685e30c6e3aa8078b11f Alex 2020-10-26 17:42:24
restore blackbox version from 16.9.20 5947a853d65c32afaf5151a9b04e738f3c27fbeb Alex 2020-10-26 17:12:00
dicebox: add fee and fee2 criteria 54b3e5bcc54f17fa5695653a73e66a8d0f9d84b1 I am 2020-10-25 21:31:37
simplex.Shull: dirty hack to eliminate looping at very beginnig, where Shull cannot hit convex_hull 792607729c198940b8b8c7bece5be846f41a351e I am 2020-10-25 18:14:29
f_models: 1D input error fix 022d2024ff3a3114c8e73c977892992cdb6e0512 I am 2020-10-25 09:20:12
qt_plot: draw boundaries and circles even in nD (don't ask me about its meaning) 96dd44b3c7822dde2de6465663ce90e5a95742f6 I am 2020-10-24 20:09:17
whitebox.get_2D_boundary: now applicable even in nD (no discussing why) 2bb3f1c13a5e3becdc5355f6bb1fdd275c4d7add I am 2020-10-24 19:52:38
f_models: add extend parametr to .new_sample() method 2ee453d95c49ee674b40ac8263596c7e7176fef7 I am 2020-10-24 19:51:36
qt_plot: show first two dimensions for nD problems 3d39373204bfac850d07afdd8629535c54f32196 I am 2020-10-24 11:44:38
qt_plot: BoxTreeWidget added 20343ef57abdac5754dfe0c01eb40fadf8919f23 I am 2020-10-23 10:10:04
Commit bc95406166c081db1df39c60099b908bf24aa16e - qt_plot: ConvexHull2D added
Author: I am
Author date (UTC): 2020-11-03 19:33
Committer name: I am
Committer date (UTC): 2020-11-03 19:33
Parent(s): 0fa8f1fe51cebbca7010f3c8cda13525dfbb8fd6
Signer:
Signing key:
Signing status: N
Tree: 8570bf2abf861f5a820051801d1fdb26aa3c5796
File Lines added Lines deleted
qt_plot.py 112 39
File qt_plot.py changed (mode: 100644) (index e93295d..a584209)
... ... class QtGuiPlot2D(QtGui.QMainWindow):
222 222 self.view_items.append(LastShot(self)) self.view_items.append(LastShot(self))
223 223 self.view_items.append(Circles(self)) self.view_items.append(Circles(self))
224 224 self.view_items.append(Boundaries(self)) self.view_items.append(Boundaries(self))
225 self.view_items.append(ConvexHull2D(self))
225 226 self.view_items.append(Triangulation(self)) self.view_items.append(Triangulation(self))
226 227
227 228
 
... ... class Boundaries:
618 619 item.hide() item.hide()
619 620
620 621
622
623
621 624 class Triangulation: class Triangulation:
622 625 def __init__(self, w): def __init__(self, w):
623 626
 
... ... class Triangulation:
634 637
635 638
636 639 self.w.list_view.itemChanged.connect(self.show_slot) self.w.list_view.itemChanged.connect(self.show_slot)
640
641 self.spatial = 'tri'
637 642
638 643
639 644
 
... ... class Triangulation:
665 670 when we need to completely when we need to completely
666 671 redraw the triangulation redraw the triangulation
667 672 """ """
668 if (self.w.sample_box.nvar==2) and self.item.checkState():
669 try:
670 self.simplices = self.w.sample_box.tri.simplices
673 if self.item.checkState():
674 try:
675 spatial = getattr(self.w.sample_box, self.spatial)
676 self.simplices = spatial.simplices
671 677 for item in self.plot_items: for item in self.plot_items:
672 678 item.hide() item.hide()
673 self.draw_triangles(range(self.w.sample_box.tri.nsimplex))
679 self.draw_simplices(range(len(self.simplices)))
674 680
675 681 except BaseException as e: except BaseException as e:
676 msg = "error during of triangulation replot"
682 msg = "error during replot"
677 683 print(self.__class__.__name__ + ":",msg, repr(e)) print(self.__class__.__name__ + ":",msg, repr(e))
678 684
679 685
680 686
681 687 def update(self): def update(self):
682 688 # update triangulation # update triangulation
683 if (self.w.sample_box.nvar==2) and self.item.checkState():
689 if self.item.checkState():
684 690 try: #оӵ Мед сюредалоз! try: #оӵ Мед сюредалоз!
685 691 former_simplices = self.simplices former_simplices = self.simplices
686 self.simplices = self.w.sample_box.tri.simplices
692 spatial = getattr(self.w.sample_box, self.spatial)
693 self.simplices = spatial.simplices
687 694
688 #č zkontrolujeme co se změnilo
689 #č předpokladám, že se počet simplexů přidaním bodů nezměnší
690 equal_mask = former_simplices == self.w.sample_box.tri.simplices[:len(former_simplices)]
691 changed_simplices_ids = np.argwhere(~equal_mask.all(axis=1)).flatten()
692 self.draw_triangles(changed_simplices_ids)
693
694 #č teď nové simplexy
695 #ё simplexy свежего разлива
696 self.draw_triangles(range(len(former_simplices), self.w.sample_box.tri.nsimplex))
695 #č počet simplexů může se přidaním bodů změnšit
696 #č (hlavně u ConvexHull, ale coplanar taky může vyskočit)
697 if len(self.simplices) < len(former_simplices):
698 self.replot()
699 else:
700 #č zkontrolujeme co se změnilo
701 equal_mask = former_simplices == self.simplices[:len(former_simplices)]
702 changed_simplices_ids = np.argwhere(~equal_mask.all(axis=1)).flatten()
703 self.draw_simplices(changed_simplices_ids)
704
705 #č teď nové simplexy
706 #ё simplexy свежего разлива
707 self.draw_simplices(range(len(former_simplices), len(self.simplices)))
697 708
698 709 except BaseException as e: except BaseException as e:
699 msg = "error during of triangulation update"
710 msg = "error during update"
700 711 print(self.__class__.__name__ + ":",msg, repr(e)) print(self.__class__.__name__ + ":",msg, repr(e))
701 712
713
702 714
715
716 def set_plot_data(self, pos, simplex_id):
717 if simplex_id < len(self.plot_items):
718 # Update the data
719 plot_item = self.plot_items[simplex_id]
720 plot_item.setData(pos)
721 plot_item.show()
722 else: #č spolehám na korektnost volajícího kódu
723 #оӵ Суредасько
724 plot_widget = self.w.central_widget
725 plot_item = plot_widget.plot(pos, pen=0.7)
726 self.plot_items.append(plot_item)
703 727
704 728
705 729 #č já jsem tu všecko překopal protože .plot() a .setData() jsou nejžravejší na čas #č já jsem tu všecko překopal protože .plot() a .setData() jsou nejžravejší na čas
706 730 #č a nemá žádnou cenu je provadet hned vedle sebe (spouští totéž dvakrát) #č a nemá žádnou cenu je provadet hned vedle sebe (spouští totéž dvakrát)
707 def draw_triangles(self, simplex_ids):
731 def draw_simplices(self, simplex_ids):
708 732 # take coordinates in the space, where triangulation has been performed # take coordinates in the space, where triangulation has been performed
709 733 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)
710 734
711 plot_widget = self.w.central_widget
712
713 735 if self.w.space == self.w.sample_box.tri_space: if self.w.space == self.w.sample_box.tri_space:
714 736 for simplex_id in simplex_ids: for simplex_id in simplex_ids:
715 737 triangle = self.simplices[simplex_id] triangle = self.simplices[simplex_id]
716 738 pos = sampled_plan_tri[triangle[[0,1,2,0]]] pos = sampled_plan_tri[triangle[[0,1,2,0]]]
717 739
718
719 if simplex_id < len(self.plot_items):
720 # Update the data
721 plot_item = self.plot_items[simplex_id]
722 plot_item.setData(pos)
723 plot_item.show()
724 else: #č spolehám na korektnost volajícího kódu
725 #оӵ Суредасько
726 plot_item = plot_widget.plot(pos, pen=0.7)
727 self.plot_items.append(plot_item)
740 self.set_plot_data(pos, simplex_id)
728 741
729 742 else: else:
730 743 ns = 100 ns = 100
 
... ... class Triangulation:
747 760 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)
748 761 pos = getattr(tri_bound, self.w.space) pos = getattr(tri_bound, self.w.space)
749 762
750 if simplex_id < len(self.plot_items):
751 # Update the data
752 plot_item = self.plot_items[simplex_id]
753 plot_item.setData(pos)
754 plot_item.show()
755 else: #č spolehám na korektnost volajícího kódu
756 #оӵ Суредасько
757 plot_item = plot_widget.plot(pos, pen=0.7)
758 self.plot_items.append(plot_item)
763 self.set_plot_data(pos, simplex_id)
764
765
766
767
768 class ConvexHull2D(Triangulation):
769 def __init__(self, w):
770
771 self.w = w
772 if self.w.sample_box.nvar == 2:
773 self.w.box_runned.connect(self.update)
774 self.w.space_changed.connect(self.replot)
775 self.w.redraw_called.connect(self.redraw)
776
777 self.item = QtGui.QListWidgetItem('Convex hull')
778 self.item.setFlags(self.item.flags() | QtCore.Qt.ItemIsUserCheckable)
779 self.item.setCheckState(QtCore.Qt.Checked)
780 self.w.list_view.addItem(self.item)
781
782
783 self.w.list_view.itemChanged.connect(self.show_slot)
784
785 self.spatial = 'convex_hull'
786
787
788
789 def redraw(self):
790 self.simplices = np.empty((0,2), dtype=np.int)
791 self.plot_items = []
792 self.replot()
793
794
795
796
797
798 #č já jsem tu všecko překopal protože .plot() a .setData() jsou nejžravejší na čas
799 #č a nemá žádnou cenu je provadet hned vedle sebe (spouští totéž dvakrát)
800 def draw_simplices(self, simplex_ids):
801
802 # convex hull should be made in the same space as triangulation, I guess
803 # take coordinates in the triangulation space
804 sampled_plan_tri = getattr(self.w.sample_box, self.w.sample_box.tri_space)
805
806 plot_widget = self.w.central_widget
807
808 if self.w.space == self.w.sample_box.tri_space:
809 for simplex_id in simplex_ids:
810 pos = sampled_plan_tri[self.simplices[simplex_id]]
811
812 self.set_plot_data(pos, simplex_id)
813
814 else:
815 ns = 100
816 #оӵ кулэ ӧвӧл обновлять экран карыны
817 for simplex_id in simplex_ids:
818 start_id, end_id = self.simplices[simplex_id]
819
820 x_bound = np.linspace(sampled_plan_tri[start_id,0], sampled_plan_tri[end_id,0], ns, endpoint=True)
821 y_bound = np.linspace(sampled_plan_tri[start_id,1], sampled_plan_tri[end_id,1], ns, endpoint=True)
759 822
823 # sample compatible
824 #оӵ малы транспонировать кароно? Озьы кулэ!
825 bound_tri = np.vstack((x_bound, y_bound)).T
826 #č vytvořme sample
827 bound = self.w.sample_box.f_model.new_sample(bound_tri, space=self.w.sample_box.tri_space)
828 pos = getattr(bound, self.w.space)
829
830 self.set_plot_data(pos, simplex_id)
831
832
760 833
761 834
762 835
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