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)
voronoi: almost finished 00b697466c226212aeb1ea76a717cf3db48c3187 I am 2022-11-28 16:28:48
voronoi: WIP 29c59822f96df4efd6d1c6555a6fa083a869a2c8 I am 2022-11-28 11:14:50
voronoi: WIP, clean up 8e776235f7603a9bc7f3d8254976224a81bb153e I am 2022-11-27 19:56:34
voronoi: WIP 41e506eacb502853a1cf70023e7b276539579af7 I am 2022-11-27 13:03:08
convex_hull: optimize orth basis generation 4ebfde2955aa792fb31075bf9ac8af718ae07b29 I am 2022-11-26 15:35:21
voronoi: WIP 8f7f3bca7c4333ab579e057438c8c64208d1f60e I am 2022-11-26 11:22:55
voronoi: remove the code already moved to wireframe module fe57b4b699e8689d35afb510f704019152566f09 I am 2022-11-25 09:25:55
qt_gui.qt_pairwise.ContactWidget: show Qhull request at most once. db6af332a70786759692175384f4b7e779b4caca I am 2022-11-16 13:26:04
wireframe.LinearSolver: polytope handle hotfix bc48de3193ce9be482cc4dd068a26f48ea1e0203 I am 2022-11-16 13:24:41
qt_gui.qt_pairwise.ContactWidget: add LP methods 8dbd480ca80aabe1c7e0e689780767b78c86c1d1 I am 2022-11-16 11:33:32
wireframe: implement two LP solvers 8aecd55104ce85ccccf872ebef0052a5937415b5 I am 2022-11-16 11:32:31
qt_gui.qt_pairwise.ContactWidget: add Gabriel adjacency 86eaf302b176612fad072a2248e2c724d32be755 I am 2022-11-16 06:17:53
wireframe: implement Gabriel adjacency f0a74b4f28cec6c2ddc68d6811e0a812fc829d63 I am 2022-11-16 06:16:58
qt_gui.qt_pairwise.ContactWidget: reflect updated wireframe b00a9be23d92d999e0020426a7a5caa1206c5862 I am 2022-11-16 03:56:57
wireframe: implement LocalizedHull class 95c19144c5144461db241df1b2bd20d8950c8d57 I am 2022-11-16 03:55:59
qt_gui.qt_pairwise.ContactWidget: polish UI bd48c8a6342e20dac1d635b963dd44e62c371379 I am 2022-11-13 20:03:39
wireframe: add convex_slice() method efada4c62f88b6106c687217472e0b8c52374fed I am 2022-11-13 19:51:49
qt_gui.qt_pairwise.ContactWidget: finish widget and clean up 10753a104879d6b9c109735e959b18b5a60a4616 I am 2022-11-10 05:02:01
wireframe: finish and clean up module. implement DirectContact. f7ff9c02f25a3ed8fe04e99036da69766afa5a49 I am 2022-11-10 04:58:58
qt_gui.qt_pairwise.ContactWidget: implement Qhull check e362df1f8b87ab7c6a27643cd6f4091b9caec9a3 I am 2022-11-09 21:35:10
Commit 00b697466c226212aeb1ea76a717cf3db48c3187 - voronoi: almost finished
Author: I am
Author date (UTC): 2022-11-28 16:28
Committer name: I am
Committer date (UTC): 2022-11-28 16:28
Parent(s): 29c59822f96df4efd6d1c6555a6fa083a869a2c8
Signer:
Signing key:
Signing status: N
Tree: 0b8b8fd9e418f704ab86c34f6d5da85a52fa8a16
File Lines added Lines deleted
wellmet/voronoi.py 97 21
File wellmet/voronoi.py changed (mode: 100644) (index 05813bf..307bf40)
... ... class ContactVoronoi:
576 576 self._valid_outsides = set() #č zabyvá se tím bezprostředně integrovačka self._valid_outsides = set() #č zabyvá se tím bezprostředně integrovačka
577 577
578 578
579 Nodes pipeline:
580 0. Sampling: generate coordinates
581 1. _store_masked(): Filter out, create CandyNodes
582 with d2 and (optionally) imask assigned
583 2. assign weights (w) such as sum(w)=1 over entire domain
584 3. score(): assign so called "score"
579 # Nodes pipeline:
580 # 0. Sampling: generate coordinates
581 # 1. _store_masked(): Filter out, create CandyNodes
582 # with d2 and (optionally) imask assigned
583 # 2. assign weights (w) such as sum(w)=1 over entire domain
584 # 3. score(): assign so called "score"
585 585 """ """
586 586
587 587
 
... ... class ContactVoronoi:
697 697 #č zda nejsou změny u sady, doporučenou k integraci #č zda nejsou změny u sady, doporučenou k integraci
698 698
699 699 #č co všechno se tu může dít? #č co všechno se tu může dít?
700 #č 1. pár není, neboť smyčka tam přídavá všechny možné kombinace.
700 #č -1. pár není, neboť smyčka tam přídavá všechny možné kombinace.
701 701 if couple_indices not in self.couples: if couple_indices not in self.couples:
702 702 assert couple_indices not in self.mixed_couples assert couple_indices not in self.mixed_couples
703 703 assert couple_indices not in self.red_couples assert couple_indices not in self.red_couples
704 704 return -1 return -1
705 705 idx_list = self.couples[couple_indices] idx_list = self.couples[couple_indices]
706 706
707 #č 2. seznam může být prazdný i když by neměl
707 #č -2. seznam může být prazdný i když by neměl
708 708 if not idx_list: if not idx_list:
709 709 self.couples.pop(couple_indices) self.couples.pop(couple_indices)
710 710 print("ContactVoronoi: empty list found for ", couple_indices) print("ContactVoronoi: empty list found for ", couple_indices)
711 711 print(self.mixed_couples.pop(couple_indices, None)) print(self.mixed_couples.pop(couple_indices, None))
712 712 print(self.red_couples.pop(couple_indices, None)) print(self.red_couples.pop(couple_indices, None))
713 713 return -2 return -2
714
715 ##č 2.5 v seznamu je jen chudý první bodík, který se ani neintegruje
716
717 #č Pokud pár je červený, tak stačí zkontrolovat jen reprezentativní sadu
718 714
715 #č 3. Pokud je pár červený, stačí zkontrolovat jen reprezentativní sadu
716 if couple_indices in self.red_couples:
717 idx = self.red_couples[couple_indices].idx
718 status, nodes = self._check_nodes(idx)
719 if status == 1: #č nic se nezměnilo
720 return 3
721 #č idx už jsme zkontrolovali.
722 idx_list.remove(idx)
723 #č Dále seznam proženeme smyčkou _walk_through_couple_nodes()
724 #č (i kdyby se tam poslal prazdný idx_list - nic se neděje)
725 #č pokud bodíky se jen maliňko změnily (status 2 z _check_nodes),
726 #č tak budou použity jako best_nodes a dostanou se zpatky do seznamu.
727 #č Propadla-li sada kompletně (status 3), tak nodes budou None
728 else:
729 nodes = None
719 730
720 #č u smíšených může být potřeba zkontorlovat všechy sady bodíků
731 #č 4. (u smíšených) může být potřeba zkontorlovat všechy sady bodíků
721 732 #č kvůli garancim skříňce #č kvůli garancim skříňce
733 new_idxs, best_nodes = self._walk_through_couple_nodes(idx_list, nodes)
734 if not new_idxs:
735 self._invalidate_couple(couple_indices)
736 return -5
737 else:
738 self.couples[couple_indices] = new_idxs
739 self._recommend_to_integration(best_nodes)
740 return 4
741
742
722 743
744 def _walk_through_couple_nodes(self, idx_list, best_nodes=None):
745 new_idxs = []
746 #č i kdyby se poslal prazdný idx_list - nic se neděje
747 if best_nodes is not None:
748 new_idxs.append(best_nodes.idx)
749 best_score = best_nodes.score
750 else:
751 best_score = -np.inf
752
753
754 sampling_needed = False
723 755
756 for idx in idx_list:
757 status, nodes = self._check_nodes(idx)
758 if status != 1: #č 1 == nic se nezměnilo
759 sampling_needed = True
760 if status == 3: #č Padla celá sada bodů.
761 continue
762
763 new_idxs.append(idx)
764 if nodes.score > best_score:
765 best_nodes = nodes
766 best_score = nodes.score
767
768 if (best_nodes is not None) and sampling_needed:
769 #č tp-čko se musí znovu vygenerovat na aktuálních vzorcích
770 #č nepůjde je ukladat
771 tp = TwoPoints(self.points, best_nodes.couple, workers=self.workers)
772 nodes = self.sample_alike(tp, best_nodes, self.ns)
773 if nodes is not None:
774 new_idxs.append(nodes.idx)
775 if nodes.score > best_score:
776 best_nodes = nodes
724 777
778 return new_idxs, best_nodes
725 779
726 780
727 def _check_nodes(self, nodes):
781 def _check_nodes(self, idx):
728 782 "returns status, masked_nodes" "returns status, masked_nodes"
729 783 #č co všechno se tu může dít? #č co všechno se tu může dít?
730 784 #č 1. nic se nezměnilo, všechny bodíky pořad patří k páru #č 1. nic se nezměnilo, všechny bodíky pořad patří k páru
 
... ... class ContactVoronoi:
733 787
734 788 #č bodíky musí mít konečné souřadnice - ony prošly KD stromem #č bodíky musí mít konečné souřadnice - ony prošly KD stromem
735 789 #č vzorky - tím více #č vzorky - tím více
790 nodes = self.nodes[idx]
736 791 nodes_model = getattr(nodes, self.model_space) nodes_model = getattr(nodes, self.model_space)
737 792 d3 = np.min(cdist(nodes_model, self.points[self._nsim:]), axis=1) d3 = np.min(cdist(nodes_model, self.points[self._nsim:]), axis=1)
738 793 mask = nodes.d2 <= d3 mask = nodes.d2 <= d3
739 794
740 795 if not np.any(mask): if not np.any(mask):
796 # -1 = 'outside', 0=success, 1=failure, 2=mix
797 if nodes.event_id == 2:
798 #č dáme zákazníkovi vědět před tím, než bodíky vyhodíme
799 self.on_delete_mixed(idx)
800 #č invalidace sady
801 self.nodes.pop(idx)
741 802 return 3, None return 3, None
742 803 elif np.all(mask): elif np.all(mask):
743 804 return 1, nodes return 1, nodes
 
... ... class ContactVoronoi:
745 806 del nodes.p_inside del nodes.p_inside
746 807 del nodes.p_fv del nodes.p_fv
747 808 del nodes.p_fw del nodes.p_fw
748 return 2, nodes[mask]
809 masked_nodes = nodes[mask]
810 # update score
811 self.score(masked_nodes)
812 self.nodes[idx] = masked_nodes
813 #č nejdřív update, teprve poté informujeme kontrahenta
814 if nodes.event_id == 2:
815 self.on_update_mixed(idx)
816 return 2, masked_nodes
749 817
750 #č invalidace sady?
751 # update score?
818 ## checklist
819 #self.couples[tp.couple_indices].append(nodes.idx)
752 820
753 821
754 def invalidate_couple(self, couple_indices):
755 pass
822 def _invalidate_couple(self, couple_indices):
823 self.couples.pop(couple_indices)
824 self.mixed_couples.pop(couple_indices, None)
825 self.red_couples.pop(couple_indices, None)
756 826
757 827 def onboard_couple(self, couple_indices, event_id, nis): def onboard_couple(self, couple_indices, event_id, nis):
758 828 #č (i, j)? poprvé ta čísla vidíme #č (i, j)? poprvé ta čísla vidíme
 
... ... class ContactVoronoi:
767 837 #č kontakt existuje, dáme vědět aktualizovačce #č kontakt existuje, dáme vědět aktualizovačce
768 838 ##č (snad jediné místo kde tuhle funkci voláme) ##č (snad jediné místo kde tuhle funkci voláme)
769 839 self._add_indices_to_update(j) self._add_indices_to_update(j)
840 self.couples[couple_indices].append(nodes.idx)
770 841
771 842
772 843 ##nodes.w = 0 ##nodes.w = 0
 
... ... class ContactVoronoi:
805 876 #č kontakt existuje, dáme vědět aktualizovačce #č kontakt existuje, dáme vědět aktualizovačce
806 877 ##č (druhé místo kde tuhle funkci voláme) ##č (druhé místo kde tuhle funkci voláme)
807 878 self._add_indices_to_update(j) self._add_indices_to_update(j)
879 self.couples[couple_indices].append(nodes.idx)
808 880
809 881 #č jdeme do adaptivního IS vzorkování #č jdeme do adaptivního IS vzorkování
810 882 #č zde jenom vzorkujeme; #č zde jenom vzorkujeme;
 
... ... class ContactVoronoi:
813 885 while nodes.score > best_score: while nodes.score > best_score:
814 886 best_nodes = nodes best_nodes = nodes
815 887 best_score = nodes.score best_score = nodes.score
816 nodes = self.sample_alike(tp, nodes, nis)
888 nodes = self.sample_alike(tp, nodes, nis)
889 self.couples[couple_indices].append(nodes.idx)
817 890
818 891
819 892 #č doporučíme k integraci #č doporučíme k integraci
 
... ... class ContactVoronoi:
929 1002
930 1003
931 1004 ## checklist ## checklist
932 self.couples[tp.couple_indices].append(nodes.idx)
1005 #č _store_masked dělá na urovní nodes
1006 #č zbytek nechť dělá kód vejš
1007 #č michá se to u kontrol párů z minule
1008 #self.couples[tp.couple_indices].append(nodes.idx)
933 1009 #self.mixed_couples #č v této fázi nevíme, #self.mixed_couples #č v této fázi nevíme,
934 1010 #self.red_couples #č zda je sada ta nejlepší #self.red_couples #č zda je sada ta nejlepší
935 1011 #self._add_indices_to_update(j) #č vždyť já nevím, jestli se jedná o aktualizaci #self._add_indices_to_update(j) #č vždyť já nevím, jestli se jedná o aktualizaci
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