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)
mplot: we need more rasterization! 46df5af418dcab84e8e7e7e23724a74e86575806 I am 2022-02-05 02:20:22
testcases: provide more presice pf for vehicle suspension example e2c4bd1c7f2278b4d94b6f7515785528267c18bb I am 2022-02-05 02:18:45
g_models.PassiveSuspensionVehicle: reformulation and clean up 6e0f9ea7b97f12a2554d895be0b2b8a3f39a536d I am 2022-02-04 03:50:03
mplot: add beta diagram 5e346bdd2c5f06a41726e2ff264776dcc60eac19 I am 2022-02-01 04:08:34
mplot.maxes3d: rasterization of risges is absolutely needed 87c3235b8313ade07ca5b4d72b1f8fec339d621d I am 2022-01-31 03:15:31
testcases: add pf_exact for suspension example 9f903986699b97bfc0eb7c8d4bcad78d3e018450 I am 2022-01-30 23:14:42
mplot: polish 3d b78a192b0ce5c4f5f9e3a94e271bcde3f3c03fac I am 2022-01-30 23:14:16
qt_gui.gl_plot: oprašit gl_plotové prvky d4336e94b262d11db3b6a110527689a9ab101a60 Aleksei Gerasimov 2022-01-30 04:00:40
add vehicle suspension problem 1546923576c59fa15e97c082b4a9c39cdadcf690 I am 2022-01-30 10:39:08
mplot: add 3D triangulation plot addec9ba2a5a9cdfbbfea2eaf660847ea814d387 I am 2022-01-30 05:15:22
mplot: oprašit matplotlibové 3D b438c6e10bc36b6f70f54611df6c3988a7959275 I am 2022-01-30 04:28:27
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
Commit 46df5af418dcab84e8e7e7e23724a74e86575806 - mplot: we need more rasterization!
Author: I am
Author date (UTC): 2022-02-05 02:20
Committer name: I am
Committer date (UTC): 2022-02-05 02:20
Parent(s): e2c4bd1c7f2278b4d94b6f7515785528267c18bb
Signer:
Signing key:
Signing status: N
Tree: 865bc78e506a097ba408f1f60ed475bcc331c95d
File Lines added Lines deleted
mplot/mart3d.py 55 5
mplot/maxes3d.py 10 1
mplot/mfigs.py 13 1
mplot/mgraph.py 10 4
File mplot/mart3d.py changed (mode: 100644) (index b1d3eab..2d36710)
... ... def get_g_model_wireframe_data(shape_share, limits, space='R', ngrid=50):
58 58 # ax.space and ax.sample_box attributes should (expected to) be set up! # ax.space and ax.sample_box attributes should (expected to) be set up!
59 59
60 60
61 def scatter_points(ax3d, zs=None, **kwargs):
61 def scatter_points(ax3d, zs=None, markers=('P', 'X', 'h', 'H'), **kwargs):
62 62 sample = getattr(ax3d.sample_box, ax3d.space) sample = getattr(ax3d.sample_box, ax3d.space)
63 63 nsim = len(sample) nsim = len(sample)
64 64 if zs is not None: if zs is not None:
 
... ... def scatter_points(ax3d, zs=None, **kwargs):
77 77 except AttributeError: except AttributeError:
78 78 proxy = np.full(nsim, False, dtype=np.bool) proxy = np.full(nsim, False, dtype=np.bool)
79 79
80 sm, fm, psm, pfm = markers
80 81
81 82 mask = np.all((~failsi, ~proxy), axis=0) mask = np.all((~failsi, ~proxy), axis=0)
82 success = ax3d.scatter(x[mask], y[mask], zs=zs[mask], c='g', marker='P', **kwargs)
83 success = ax3d.scatter(x[mask], y[mask], zs=zs[mask], c='g', marker=sm, **kwargs)
83 84
84 85 mask = np.all((failsi, ~proxy), axis=0) mask = np.all((failsi, ~proxy), axis=0)
85 failures = ax3d.scatter(x[mask], y[mask], zs=zs[mask], c='r', marker='X', **kwargs)
86 failures = ax3d.scatter(x[mask], y[mask], zs=zs[mask], c='r', marker=fm, **kwargs)
86 87
87 88 mask = np.all((~failsi, proxy), axis=0) mask = np.all((~failsi, proxy), axis=0)
88 89 proxy_successes = ax3d.scatter(x[mask], y[mask], zs=zs[mask],\ proxy_successes = ax3d.scatter(x[mask], y[mask], zs=zs[mask],\
89 c='#77AC30', marker='h', **kwargs)
90 c='#77AC30', marker=psm, **kwargs)
90 91
91 92 mask = np.all((failsi, proxy), axis=0) mask = np.all((failsi, proxy), axis=0)
92 93 proxy_failures = ax3d.scatter(x[mask], y[mask], zs=zs[mask],\ proxy_failures = ax3d.scatter(x[mask], y[mask], zs=zs[mask],\
93 c='#D95319', marker='H', **kwargs)
94 c='#D95319', marker=pfm, **kwargs)
94 95
95 96 return success, failures, proxy_successes, proxy_failures return success, failures, proxy_successes, proxy_failures
96 97
97 98
98 99
100 def plot_points(ax3d, zs=None, markers=('P', 'X', 'h', 'H'), ls='', **kwargs):
101 sample = getattr(ax3d.sample_box, ax3d.space)
102 nsim = len(sample)
103 if zs is not None:
104 x, y = sample[:,:2].T
105 elif ax3d.sample_box.nvar == 2:
106 x, y = sample[:,:2].T
107 #zs = ax3d.sample_box.pdf(ax3d.space)
108 zs = ax3d.sample_box.g_values
109 else:
110 x, y, zs = sample[:,:3].T
111
112 failsi = ax3d.sample_box.failsi
113
114 try: # proxy denotes to implicitly-known values
115 proxy = ax3d.sample_box.proxy
116 except AttributeError:
117 proxy = np.full(nsim, False, dtype=np.bool)
118
119 sm, fm, psm, pfm = markers
120
121 plot_list = []
122
123 #č byl jsem svědkem, že matplotlib zlobil ve 3D
124 #č kvůli tomu, že nebyl žádný safe vzorek
125 #č proto raději budu přidávat tečky podmíněne
126 mask = np.all((~failsi, ~proxy), axis=0)
127 if np.any(mask): #success
128 plot_list.append(ax3d.plot(x[mask], y[mask], mec='g', mfc='g',\
129 marker=sm, ls=ls, **kwargs))
130
131 mask = np.all((failsi, ~proxy), axis=0)
132 if np.any(mask): #failures
133 plot_list.append(ax3d.plot(x[mask], y[mask], mec='r', mfc='r',\
134 marker=fm, ls=ls, **kwargs))
135
136 mask = np.all((~failsi, proxy), axis=0)
137 if np.any(mask): #proxy_successes
138 plot_list.append(ax3d.plot(x[mask], y[mask], mec='#77AC30', mfc=(0,0,0,0),\
139 marker=psm, ls=ls, **kwargs))
140
141 mask = np.all((failsi, proxy), axis=0)
142 if np.any(mask): #proxy_failures
143 plot_list.append(ax3d.plot(x[mask], y[mask], mec='#D95319', mfc=(0,0,0,0),\
144 marker=pfm, ls=ls, **kwargs))
145
146 return plot_list # success, failures, proxy_successes, proxy_failures
147
148
99 149
100 150 def tri_plot(ax, Tri=None, fmt='-', ns=100, **kwargs): def tri_plot(ax, Tri=None, fmt='-', ns=100, **kwargs):
101 151 if ax.sample_box.nvar == 3: if ax.sample_box.nvar == 3:
File mplot/maxes3d.py changed (mode: 100644) (index f98db2a..af012d1)
... ... from . import mart
14 14 from . import mart3d from . import mart3d
15 15
16 16 # it is mostly for qt_plot, it offers availiable options to user # it is mostly for qt_plot, it offers availiable options to user
17 __all__ = ['tri_plot', 'plot3D', 'candidates_drawing', 'plane_under_density', 'qhull_under_density', 'dhull_under_density']
17 __all__ = ['tri_plot', 'plot3D', 'plot_points_3D',
18 'candidates_drawing', 'plane_under_density',
19 'qhull_under_density', 'dhull_under_density']
18 20
19 21 def plot3D(ax3d): def plot3D(ax3d):
20 22 mart3d.scatter_points(ax3d) mart3d.scatter_points(ax3d)
 
... ... def plot3D(ax3d):
24 26 ax3d.set_zlabel("$x_3$") ax3d.set_zlabel("$x_3$")
25 27
26 28
29 def plot_points_3D(ax3d):
30 mart3d.scatter_points(ax3d, markers=('.', '.', '.', '.'), alpha=0.5, rasterized=True)
31
32 ax3d.set_xlabel("$x_1$")
33 ax3d.set_ylabel("$x_2$")
34 ax3d.set_zlabel("$x_3$")
35
27 36
28 37 #č ten [plot] zásadně vytvaří své struktury, nepouzívá oné ze skříňky, #č ten [plot] zásadně vytvaří své struktury, nepouzívá oné ze skříňky,
29 38 #č protože já vím, že v těch obrázcích, ve kterých chcu ho použit, #č protože já vím, že v těch obrázcích, ve kterých chcu ho použit,
File mplot/mfigs.py changed (mode: 100644) (index deabcb5..454f2f5)
... ... from matplotlib import ticker
14 14
15 15 __all__ = [ __all__ = [
16 16 'convergence_diagram', 'convergence_legend', 'double_proxy_diagram', 'convergence_diagram', 'convergence_legend', 'double_proxy_diagram',
17 'four_branch_convergence', 'beta_diagram', 'suspension_3d',
17 'four_branch_convergence', 'beta_diagram', 'double_diagram', 'suspension_3d',
18 18 'double_tri_R_plot', 'double_tri_R_twins_plot', 'double_plot', 'double_tri_R_plot', 'double_tri_R_twins_plot', 'double_plot',
19 19 'double_pprod_R_plot', 'double_mprod_R_plot', 'double_pprod_R_plot', 'double_mprod_R_plot',
20 20 'triple_plot', 'triple_wide', 'triple_wide_50_100', 'triple_plot_50_100', 'triple_plot', 'triple_wide', 'triple_wide_50_100', 'triple_plot_50_100',
 
... ... def four_branch_convergence(fig, sample_box, space, lim=100):
92 92 ax.xaxis.set_major_formatter(ticker.FixedFormatter(seq)) ax.xaxis.set_major_formatter(ticker.FixedFormatter(seq))
93 93 ax.xaxis.set_major_locator(ticker.FixedLocator(locs=ticks)) ax.xaxis.set_major_locator(ticker.FixedLocator(locs=ticks))
94 94
95 def double_diagram(fig, sample_box, space, lim=1000):
96 ax1 = ax = fig.add_subplot(211)
97 ax.sample_box = sample_box
98 maxes.convergence_diagram(ax)
99 ax.set_xlim(0, lim)
100 ax.set_xlabel('')
101
102 ax = fig.add_subplot(212)
103 ax.sample_box = sample_box
104 maxes.convergence_diagram(ax)
105 ax.sharex(ax1)
106
95 107 def double_proxy_diagram(fig, sample_box, space, lim=1000): def double_proxy_diagram(fig, sample_box, space, lim=1000):
96 108 ax1 = ax = fig.add_subplot(211) ax1 = ax = fig.add_subplot(211)
97 109 ax.sample_box = sample_box ax.sample_box = sample_box
File mplot/mgraph.py changed (mode: 100644) (index 54c067c..4a01931)
... ... def tri_estimation_fill(ax, df):
22 22 #xkcd_cream = (255, 243, 154) # let's try xkcd: dark cream (#fff39a) #xkcd_cream = (255, 243, 154) # let's try xkcd: dark cream (#fff39a)
23 23 cream = "#FFF39A" cream = "#FFF39A"
24 24 grey = "#DDDDDD" grey = "#DDDDDD"
25 colors = (red, cream, grey, green)
25
26 26 o = df['outside'].to_numpy() o = df['outside'].to_numpy()
27 27 s = df['success'].to_numpy() s = df['success'].to_numpy()
28 28 f = df['failure'].to_numpy() f = df['failure'].to_numpy()
29 29 m = df['mix'].to_numpy() m = df['mix'].to_numpy()
30 labels = ("failure domain", "mixed domain",\
31 "outside domain", "success domain")
32 return ax.stackplot(df.index, f, m, o, s, labels=labels, colors=colors)
30 kwargs = {'colors': (red, cream, grey, green),
31 'labels': ("failure domain", "mixed domain",\
32 "outside domain", "success domain")}
33 if len(df.index) > 1000:
34 kwargs['rasterized'] = True
35 return ax.stackplot(df.index, f, m, o, s, **kwargs)
33 36
34 37
35 38 #č sehnaní datarámu necháme uživateli #č sehnaní datarámu necháme uživateli
 
... ... def tri_estimation_plot(ax, df, pf_exact=None, pf_exact_method="$p_f$",
88 91 #č blbost, ale uspořadal jsem tu prvky tak, #č blbost, ale uspořadal jsem tu prvky tak,
89 92 #č aby se hezky kreslily v legendě #č aby se hezky kreslily v legendě
90 93
94 if (len(df.index) > 1000) and ('rasterize' not in kwargs):
95 kwargs['rasterized'] = True
96
91 97 v = df['vertex_estimation'].to_numpy() v = df['vertex_estimation'].to_numpy()
92 98 wv = df['weighted_vertex_estimation'].to_numpy() wv = df['weighted_vertex_estimation'].to_numpy()
93 99 ax.plot(df.index, wv, '-r', label="weighted $p_f$ estimation", zorder=100500, **kwargs) ax.plot(df.index, wv, '-r', label="weighted $p_f$ estimation", zorder=100500, **kwargs)
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