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: add matplotlib menu 73835a59908b82f08d618a06c4c05a96703715b1 I am 2021-07-14 17:01:54
mart: add candidates plot functions 56b3f5320e83071886c0d8f65a3d9df7c5a231a8 I am 2021-07-13 10:55:13
dicebox.Goal.assess_candidates: put back dd attribute 5da7c67800b8cd6eb3f221273a8270393a571e2b I am 2021-07-12 08:47:00
sball: fix Radial pdf 830fbf3119e2e54e42ea48640dfe553ffa2b3c1f I am 2021-07-08 19:50:42
spring: try to fix infinite loop 0e9a6161996c1b078698b1631d10f1a171332818 I am 2021-07-08 17:54:04
dicebox.Goal: add q_psee potential 4c151252460f6e96f7c1ac5662f81474eae305a0 I am 2021-07-08 00:34:27
dicebox.Goal: Goal is back after the breakage! 19c3c63001ebc19ed5e17892e4b11edb4dbfe828 I am 2021-07-06 16:14:14
IS_stat.PushAndPull: small variance fix, spíše formální 7b5b87655b6978828ed06ba3743ada46a2bfde6b I am 2021-07-06 04:31:43
qt_plot.Ghull: update Ghull related code. A lot of fixes. Вроде фурычит. 29cd8fce14cecc872e1be856d73d9669a6395b08 I am 2021-07-05 18:47:53
IS_stat: new class added (for Ghull, actually) 27b2685694655cb75657c6629d10706669d1f2e2 I am 2021-07-04 22:05:48
convex_hull.Ghull: integrovaní memikruží je hodně překopano. Breakage. není zatím testováno 2d39dcd67948a99028013b0f7f420adf86eb19e9 I am 2021-07-04 22:02:48
dicebox: replace everywhere "potencial" typo by correct "potential" word. Save English eyes! c4aae036362d93c8a0a5bde9f30537d1b549adaa I am 2021-06-30 14:30:26
welford: add method for sparse data c9dd961c58243ac890b9a518cfff5901dd6a5789 I am 2021-06-28 13:47:09
welford: yet another Welford's algoritm implementation ec31907d6727c408306f4b25c09b7f87632b0ecf I am 2021-06-27 22:27:06
IS_stat.TrueIS: pridal jsem do komentářu vzpomínky 1c5b4596a4da1206b02ed91954cbe8147ec1e208 I am 2021-06-27 15:23:42
IS_stat: add get_IS_estimation() function d048b4cd4e90d8440e7ff2a3ad86bc0f3c160d4f I am 2021-06-26 19:55:14
spring: new brand hustý modul pro vyrovnání odhadů 3fc5eb00de1eb65cff2db71640c340602687f52f I am 2021-06-25 00:52:06
convex_hull.Ghull.rvs: hloupá chyba 7494eef4e2621ac9651037cd4a99e9f570704dee I am 2021-06-21 01:37:49
convex_hull.Ghull.rvs: ensure at least one node outside 1c6d05935c83d11637ae566528cf65eb384215b5 I am 2021-06-19 19:04:40
convex_hull.Ghull: add nonGaussian hulls support, fix MC integration 3e10c2cefff5f3e204c1d4118b195e37023a5a57 I am 2021-06-19 17:44:09
Commit 73835a59908b82f08d618a06c4c05a96703715b1 - qt_plot: add matplotlib menu
Author: I am
Author date (UTC): 2021-07-14 17:01
Committer name: I am
Committer date (UTC): 2021-07-14 17:01
Parent(s): 56b3f5320e83071886c0d8f65a3d9df7c5a231a8
Signer:
Signing key:
Signing status: N
Tree: 39e00270e3ba021c6fadbb34a8cc395d8119c416
File Lines added Lines deleted
mart.py 4 11
maxes.py 46 0
mplot.py 16 1
qt_plot.py 27 2
File mart.py changed (mode: 100644) (index 2192c77..5bc331e)
... ... import matplotlib.patches as mpatches
12 12
13 13 from . import misc from . import misc
14 14
15 def get_simplices_colors(sb, simplices): #simplices = bx.tri.simplices
16 s = '#a7ffb5' #'xkcd:light seafoam green' #a7ffb5
17 f = '#fdc1c5' #'xkcd: pale rose' # (#fdc1c5)
18 m = '#FFF39A' #'xkcd: dark cream' # (255, 243, 154, 255)
19
20 in_failure = np.isin(simplices, sb.failure_points)
21 has_failure = in_failure.any(axis=1)
22 all_failure = in_failure.all(axis=1)
23 return np.where(has_failure, np.where(all_failure, f, m), s)
24
15 #č Tahlensta blbost je použita funkcí tripcolor()
16 #č Je třeba jú překopat na Triangulation třidu,
17 #č která get_events má jako svůj method.
25 18 def get_events(sb, simplices): #simplices = bx.tri.simplices def get_events(sb, simplices): #simplices = bx.tri.simplices
26 19 """ """
27 20 Metoda musí simplexům přiřazovat jev Metoda musí simplexům přiřazovat jev
 
... ... def center_spines(ax):
345 338 ax.plot(1, 0, ">k", transform=ax.get_yaxis_transform(), clip_on=False) ax.plot(1, 0, ">k", transform=ax.get_yaxis_transform(), clip_on=False)
346 339 ax.plot(0, 1, "^k", transform=ax.get_xaxis_transform(), clip_on=False) ax.plot(0, 1, "^k", transform=ax.get_xaxis_transform(), clip_on=False)
347 340
348
341 #č před použitím bude třeba skutečně naimportovat ticker
349 342 def fix_locator(ax, loc): def fix_locator(ax, loc):
350 343 loc_x = mpl.ticker.FixedLocator(loc) loc_x = mpl.ticker.FixedLocator(loc)
351 344 ax.xaxis.set_major_locator(loc_x) ax.xaxis.set_major_locator(loc_x)
File maxes.py added (mode: 100644) (index 0000000..9443370)
1 #!/usr/bin/env python
2 # coding: utf-8
3
4 # Axes level functions (for Matplotlib)
5
6 #č Založme nový modul pro funkce (procedury),
7 #č které sice stejně jako mart pracují na urovni axes,
8 #č ale na rozdil od atomických funkcí mart modulu
9 #č udělaj z prazdných os hotový obrazek.
10 #č mplot.show2D() může použivat tuhle nabídku obrázků.
11
12 from . import mart
13
14 # it is mostly for qt_plot, it offers availiable options to user
15 __all__ = ['base_drawing', 'candidates_drawing']
16
17
18 def base_drawing(ax):
19 mart.setup(ax)
20 mart.curly(ax)
21 try:
22 mart.triplot(ax, color="grey", linewidth=0.4)
23 except:
24 pass
25 mart.plot_boundaries(ax, linewidth=0.7)
26 mart.scatter_points(ax)
27
28
29 def candidates_drawing(ax):
30 try:
31 mart.triplot(ax, color="grey", linewidth=0.4)
32 except:
33 pass
34 mart.plot_boundaries(ax, linewidth=0.7)
35
36 #č ax.scatter posílá parameter cmap Collections třídě.
37 #č Třída mimo jiného dědí cm.ScalarMappable,
38 #č která inicializaci deleguje funkci cm.get_cmap() ve (svém) modulu cm.
39 # cmap='viridis_r' #cmap='plasma',
40 mart.scatter_candidates(ax, s=5, marker='.', cmap='plasma_r',\
41 alpha=None, linewidths=None, edgecolors=None, plotnonfinite=False)
42 mart.plot_the_best_candidate(ax, "^", color='#3D0D5B')
43
44 mart.scatter_points(ax)
45
46
File mplot.py changed (mode: 100644) (index 917a8cb..ce5171f)
... ... import matplotlib
10 10 import matplotlib.pyplot as plt import matplotlib.pyplot as plt
11 11 matplotlib.rcParams['mathtext.fontset'] = 'cm' # Computer Modern (TeX) matplotlib.rcParams['mathtext.fontset'] = 'cm' # Computer Modern (TeX)
12 12 matplotlib.rcParams['font.family'] = 'STIXGeneral' matplotlib.rcParams['font.family'] = 'STIXGeneral'
13 matplotlib.rcParams['savefig.dpi'] = 300
13 14
14 from . import mart
15 from . import maxes
15 16
17 def show2D(sample_box, space='R', drawing=None):
18 fig = plt.figure()
19 ax = fig.add_subplot(111)
20 ax.space = space
21 ax.sample_box = sample_box
22
23 if drawing is None:
24 maxes.base_drawing(ax)
25 else:
26 getattr(maxes, drawing)(ax)
27 # specially for qt_plot. It already runs event loop
28 return fig.show()
29
30
16 31
17 32 def subplot3D(sample_box, ax3d, space='R'): def subplot3D(sample_box, ax3d, space='R'):
18 33 Fails = getattr(sample_box.failure_samples, space) Fails = getattr(sample_box.failure_samples, space)
File qt_plot.py changed (mode: 100644) (index fabb236..04a3015)
... ... from pyqtgraph import console
10 10 import numpy as np import numpy as np
11 11 import pandas as pd # required for estimation graph import pandas as pd # required for estimation graph
12 12
13 #ё я сдаюсь.
13 #č vzdávám se.
14 14 #č quadpy tak se stavá povinnou závislostí #č quadpy tak se stavá povinnou závislostí
15 15 #č potrebuju pro HullEstimation widget #č potrebuju pro HullEstimation widget
16 16 import quadpy import quadpy
 
... ... class QtGuiPlot2D(QtGui.QMainWindow):
97 97 self.ncircles = 5 self.ncircles = 5
98 98 self.redraw_called.connect(self.central_widget.clear) self.redraw_called.connect(self.central_widget.clear)
99 99
100
100 # should be INHERITED by gl_plot
101 def initialize_matplotlib_menu(self):
102 try: # entire optional functionality
103 from .mplot import show2D
104 from . import maxes
105 self.matplotlib_menu = self.bar.addMenu("Matplotlib")
106 self.matplotlib_actions = []
107 for drawing in maxes.__all__:
108 mpl_action = QtGui.QAction(drawing, self)
109 # do not really understand what I am doing :(
110 # try to show_mpl remember its actual drawing string
111 show_mpl = self._get_mpl_function(show2D, drawing)
112 mpl_action.triggered.connect(show_mpl)
113 self.matplotlib_menu.addAction(mpl_action)
114 # prevent GC from wiping out both Qt object and our function
115 self.matplotlib_actions.append((mpl_action, show_mpl))
116
117 except ImportError as e:
118 msg = "Matplotlib related features are unavailiable"
119 print(self.__class__.__name__ + ":", msg, repr(e))
120
121 def _get_mpl_function(self, show, drawing):
122 return lambda: show(self.sample_box, space=self.space, drawing=drawing)
123
101 124 # INHERITED by gl_plot # INHERITED by gl_plot
102 125 # intended as a common setup function # intended as a common setup function
103 126 def setup(self): def setup(self):
 
... ... class QtGuiPlot2D(QtGui.QMainWindow):
110 133 self.batch_run_action.triggered.connect(self.batch_run) self.batch_run_action.triggered.connect(self.batch_run)
111 134 self.graph_menu.addAction(self.batch_run_action) self.graph_menu.addAction(self.batch_run_action)
112 135
136 # optional feature
137 self.initialize_matplotlib_menu()
113 138
114 139 ### Create some widgets to be placed inside ### Create some widgets to be placed inside
115 140 self.combo_space = pg.ComboBox(items=self.spaces, default=self.space) self.combo_space = pg.ComboBox(items=self.spaces, default=self.space)
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