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)
Ghull is ready e1a49fe0cb390ce9664e8f892c1da6d30231cc99 I am 2021-03-16 14:29:09
simplex: finish Ghull 5cb6d06a1c77cdb0cc1d3e83cfb217924b2345f1 I am 2021-03-03 23:06:13
simplex.Ghull: WIP 043724e7d4fe0c25ac698becf6498bc2abb8bf29 I am 2021-03-03 17:06:08
sball: je naimplementována třída Shell b335ba64be48582ca2f31baf035d0f5c6c75090c I am 2021-03-03 13:45:02
sball: new gamma-based solution. Keep the old version as well b6ac51b6b08ca2e7d5c398fa56c5a9a0832ab301 I am 2021-02-24 10:55:11
mart: add convergence plot 85a9ef727d15fc6567b7b0a594ed52cef9fe5680 I am 2021-02-22 23:32:34
mart: add basic plot and scatter functions 20e04c27db7ee3ac3a6418300eb4fc1ef532a1c7 I am 2021-02-22 14:45:31
mart: add convex hull related functions 5284e4c1c747fe25d220e7e3a6a9803d8bc6d4a1 I am 2021-02-21 20:57:52
axes3d_: draw only bottom pane 5a24020e052a7adbc17485b4c9c74d7eea801765 Alex 2021-02-12 20:50:09
mart3d: tri surface fix 2f1889070cea6c97937e00d76ce029744c9f8d07 Alex 2021-02-12 10:01:59
mart3d: add plot_wireframe 8b21a8ca659e4f2146459ea5f4cc006535f51308 I am 2021-02-12 04:45:56
mart and mart3d: add new functions fdbfd002214bf7ab7be8df8e90d6b96b62c82d13 I am 2021-02-10 17:18:02
qt_plot: update slider on redraw, add simplex estimation with no graphics 7b392cd9ee8487a620466fe757a17c7fcfff2770 I am 2021-02-09 23:00:32
mart: WIP 81d970b1e515032f0414d1cc4c6d7473f187d162 I am 2021-02-09 19:38:36
mart3d: add scatter_points() 26644c64e3b996b68e1ee133e4531380d4e00090 I am 2021-02-08 18:03:51
mart3d: new matplotlib-support module 8b6b13937a0694998e0b4de7b8a96d89abecc64a I am 2021-02-08 13:47:56
gmodels: increased no of discretization points in boundary for Pareto function 7f12597e2d15b2564d612a014fd75492663043dd Miroslav Vořechovský 2021-02-05 15:28:32
gmodels.py added boundary for Pareto function e7bc61e9c5854bc4cff0ee05b651b4b7ede4e0a1 Miroslav Vořechovský 2021-02-05 15:14:52
improved estimation of pf for Pareto Example 427602319f6a81e896b7aa50fd8947c5a1a91873 Miroslav Vořechovský 2021-02-05 14:15:41
dicebox.Razitko: little fixes 0e3f9147a40b7008ddec0893c3965136bac7fedf I am 2021-02-05 12:32:27
Commit e1a49fe0cb390ce9664e8f892c1da6d30231cc99 - Ghull is ready
Author: I am
Author date (UTC): 2021-03-16 14:29
Committer name: I am
Committer date (UTC): 2021-03-16 14:29
Parent(s): 5cb6d06a1c77cdb0cc1d3e83cfb217924b2345f1
Signer:
Signing key:
Signing status: N
Tree: 88270e26d463ed0cfd4a86d1a8b1a8cbc0f6dcdd
File Lines added Lines deleted
qt_plot.py 458 0
simplex.py 10 6
File qt_plot.py changed (mode: 100644) (index 612128d..d3bfdde)
... ... class QtGuiPlot2D(QtGui.QMainWindow):
256 256 self.tabifyDockWidget(dock_r, dock) self.tabifyDockWidget(dock_r, dock)
257 257
258 258
259 dock = QtGui.QDockWidget("Ghull", self)
260 dock.setWidget(HullEstimationWidget(self, dock))
261 self.view.addAction(dock.toggleViewAction())
262 self.dockables.append(dock)
263 self.tabifyDockWidget(dock_r, dock)
264
259 265 dock = QtGui.QDockWidget("Blackbox's candidates", self) dock = QtGui.QDockWidget("Blackbox's candidates", self)
260 266 dock.setWidget(CandidatesWidget(self, dock)) dock.setWidget(CandidatesWidget(self, dock))
261 267 self.view.addAction(dock.toggleViewAction()) self.view.addAction(dock.toggleViewAction())
 
... ... class QtGuiPlot2D(QtGui.QMainWindow):
357 363
358 364
359 365
366 """
367 ==============
368 оӵ Суред люкет
369 č Kreslicí prvky
370 E Drawing items
371 =================
372 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
373 """
374
375
360 376
377 #class Serie:
378 # def __init__(self, sample, w, **plot_kwargs):
379 # self.sample = sample
380 # self.w = w
381 # self.plot_kwargs = plot_kwargs
382 #
383 # self._draw()
384 #
385 # def _draw(self):
386 # pos = getattr(self.sample, self.w.space)[:,:2]
387 # mask = np.all(np.isfinite(pos), axis=1)
388 # self.plot_item = w.central_widget.plot(pos[mask], **plot_kwargs)
361 389
362 390
391 class Series:
392 def __init__(self, w, autoredraw=True):
393 self.w = w
394 self.w.space_changed.connect(self.space_update)
395 self.w.redraw_called.connect(self._redraw)
396 # redraw policy
397 self.autoredraw = autoredraw
398 self.items = {}
363 399
364 400
401 def add_serie(self, sample, index=None, **plot_kwargs):
402 plot_item = self._draw(sample, plot_kwargs)
403
404 if index is None:
405 index = len(self.items)
406 elif index in self.items:
407 # kind of update, then
408 #č musíme korektně odebrat předchozí kresbu
409 self.remove_item(index)
410
411 self.items[index] = [sample, plot_item, plot_kwargs]
412 return plot_item
413
414
415 def _draw(self, sample, plot_dict):
416 pos = getattr(sample, self.w.space)[:,:2]
417 mask = np.all(np.isfinite(pos), axis=1)
418 return self.w.central_widget.plot(pos[mask], **plot_dict)
419
420
421 def clear(self):
422 for item in self.items.values():
423 __sample, plot_item, __plot_dict = item
424 self.w.central_widget.removeItem(plot_item)
425 self.items.clear()
426
427 def remove_item(self, index):
428 __sample, plot_item, __plot_dict = self.items.pop(index)
429 self.w.central_widget.removeItem(plot_item)
430
431
432 def hide(self, index=None):
433 if index is None:
434 for item in self.items.values():
435 __sample, plot_item, __plot_dict = item
436 plot_item.hide()
437 else:
438 __sample, plot_item, __plot_dict = self.items[index]
439 plot_item.hide()
440
441 def show(self, index=None):
442 if index is None:
443 for item in self.items.values():
444 __sample, plot_item, __plot_dict = item
445 plot_item.show()
446 else:
447 __sample, plot_item, __plot_dict = self.items[index]
448 plot_item.show()
449
450
451 def _redraw(self):
452 if self.autoredraw:
453 for item in self.items.values():
454 sample, _invalid_plot_item, plot_dict = item
455 item[1] = self._draw(sample, plot_dict)
456 else:
457 self.items.clear()
458
459
460 def space_update(self):
461 for item in self.items.values():
462 sample, plot_item, __plot_dict = item
463
464 pos = getattr(sample, self.w.space)[:,:2]
465 mask = np.all(np.isfinite(pos), axis=1)
466 plot_item.setData(pos[mask])
467
468
469
470 #č Kružničky chcete?
471 #ё Кружочки ннада?
472 #оӵ Гаусслэн котыресез
473 class Giracles(Series):
474 def __init__(self, w, autoredraw=True, nrod=200):
475 super().__init__(w, autoredraw)
476
477 self.setup(nrod)
478
479 def setup(self, nrod):
480 phi = np.linspace(0, 6.283185307, nrod, endpoint=True)
481 cos_phi = np.cos(phi)
482 sin_phi = np.sin(phi)
483
484 self.prebound = np.array((cos_phi, sin_phi)).T
485
486
487 def add_circle(self, r=1, index=None, **plot_kwargs):
488 f_model = self.w.sample_box.f_model
489 sample_G = self.prebound * r
490 sample = f_model.new_sample(sample_G, space='G', extend=True)
491 return self.add_serie(sample, index=None, **plot_kwargs)
492
493
365 494 """ """
366 495 ============== ==============
367 496 у График люкет у График люкет
 
... ... class VoronoiEstimationWidget(QtGui.QSplitter):
2664 2793
2665 2794
2666 2795
2796
2797
2798
2799 class HullEstimationWidget(pg.LayoutWidget):
2800 # I'd like to get access to the samplebox stuff via the container's reference,
2801 def __init__(self, samplebox_item, parent=None, *args, **kwargs):
2802 super().__init__(parent)
2803 # sb like samplebox, of course
2804 self.sb_item = samplebox_item
2805
2806 self.giracle = Giracles(w=samplebox_item, autoredraw=False, nrod=200)
2807
2808 self.sb_item.box_runned.connect(self.on_box_run)
2809 #č Alexi, ten signal může té funkce posilát bůhví co navíc. Uvidíme.
2810 self.sb_item.slice_changed.connect(self.giracle.clear)
2811 #self.sb_item.space_changed.connect(self.on_space_changed)
2812 #self.sb_item.redraw_called.connect(self.redraw)
2813
2814 #☺ na internetu všichni tak dělaj
2815 self.setup()
2816
2817 def setup(self):
2818 #č já teďkom dědím ne QSplitter, ale LayoutWidget
2819 #оӵ Кужым кариськы, Олёш!
2820
2821 #č zkusíme nový (pro WellMet) UI, uživatelské rozhraní
2822 #оӵ кнопка вылын
2823 #self.layout = self.addLayout(row=0, col=0)
2824 #self.tool_layout = QtGui.QHBoxLayout()
2825 #self.layout.addLayout(self.tool_layout, 0, 0)
2826 #self.addWidget(self.layout, row=0, col=0)
2827
2828 #č toolbar je obecně super věc, ale mě zlobí umístění v layoutu
2829 self.toolbar = QtGui.QToolBar(self)
2830 #č jmenovitě, roztažení mě nefunguje vůbec
2831 #size_policy = self.toolbar.sizePolicy()
2832 #size_policy.setHorizontalPolicy(QtGui.QSizePolicy.Expanding)
2833 #self.toolbar.setSizePolicy(size_policy)
2834
2835 action = self.toolbar.addAction("shell out!", self.get_shell_estimation)
2836 btn = self.toolbar.widgetForAction(action)
2837 btn.setAutoRaise(False)
2838 #btn.setSizePolicy(size_policy)
2839
2840 action = self.toolbar.addAction("integrate", self.integrate)
2841 btn = self.toolbar.widgetForAction(action)
2842 btn.setAutoRaise(False)
2843 #btn.setSizePolicy(size_policy)
2844
2845 action = self.toolbar.addAction("fire!", self.fire)
2846 btn = self.toolbar.widgetForAction(action)
2847 btn.setAutoRaise(False)
2848 #btn.setSizePolicy(size_policy)
2849
2850 #action = self.toolbar.addAction("redraw", self.recolor)
2851 #btn = self.toolbar.widgetForAction(action)
2852 #btn.setAutoRaise(False)
2853 ##btn.setSizePolicy(size_policy)
2854
2855 action = self.toolbar.addAction("hide", self.giracle.hide)
2856 btn = self.toolbar.widgetForAction(action)
2857 btn.setAutoRaise(False)
2858 #btn.setSizePolicy(size_policy)
2859
2860 #self.tool_layout.addWidget(self.toolbar)
2861 self.addWidget(self.toolbar, row=0, col=0)
2862
2863
2864 #č použivám QToolButton jen proto, že jsou menši :)
2865 # self.btn0 = QtGui.QToolButton(self)
2866 # self.btn0.setText("shell out!")
2867 # self.tool_layout.addWidget(self.btn0)
2868 # self.btn0.clicked.connect(self.get_shell_estimation)
2869 #
2870 # self.btn1 = QtGui.QToolButton(self)
2871 # self.btn1.setText("integrate")
2872 # self.tool_layout.addWidget(self.btn1)
2873 # self.btn1.clicked.connect(self.integrate)
2874 #
2875 # self.btn = QtGui.QToolButton(self)
2876 # self.btn.setText("fire!")
2877 # self.tool_layout.addWidget(self.btn)
2878 # self.btn.clicked.connect(self.fire)
2879 #
2880 # self.btn2 = QtGui.QToolButton(self)
2881 # self.btn2.setText("redraw")
2882 # self.tool_layout.addWidget(self.btn2)
2883 # self.btn2.clicked.connect(self.recolor)
2884 #
2885 # self.btn3 = QtGui.QToolButton(self)
2886 # self.btn3.setText("hide")
2887 # self.tool_layout.addWidget(self.btn3)
2888 # self.btn3.clicked.connect(self.hide)
2889
2890 #оӵ остальной (люкет) уллапала
2891
2892 ### Create ParameterTree widget
2893 self.ptree = pg.parametertree.ParameterTree()
2894 self._set_param()
2895 self.ptree.setParameters(self.param, showTop=False)
2896
2897 self.splitter = QtGui.QSplitter(self)
2898 self.splitter.setOrientation(QtCore.Qt.Vertical)
2899 self.splitter.addWidget(self.ptree)
2900
2901 self.table = pg.TableWidget(sortable=False)
2902 self.splitter.addWidget(self.table)
2903
2904
2905 #self.addWidget(self.splitter, row=1, col=0, colspan=5)
2906 self.addWidget(self.splitter, row=1, col=0)
2907
2908
2909 def _set_param(self):
2910 params = list()
2911 # params.append({'name': 'method', 'type': 'list', \
2912 # 'values': ['Ghull'], 'value': 'Ghull'})
2913 # designs = ['None']
2914 # if 'designs' in self.sb_item.kwargs:
2915 # designs.extend(self.sb_item.kwargs['designs'].keys())
2916 # params.append({'name': 'design', 'type': 'list', \
2917 # 'values': designs, 'value': 'None'})
2918 params.append({'name': 'budget', 'type': 'int', \
2919 'limits': (1, float('inf')), 'value': 1000, 'default': 1000})
2920
2921 params.append({'name': 'node (pixel) size', 'type': 'float',\
2922 'limits': (0, float('inf')), 'value': 3.5, 'default': self.sb_item.px_size})
2923 #ё больше калорий богу калорий!
2924 params.append({'name': 'r', 'type': 'color', 'value': (189, 204, 0, 255) })
2925 params.append({'name': 'inside', 'type': 'color', 'value': (133, 172, 102, 255) })
2926 #params.append({'name': 'convex_hull', 'type': 'color', 'value': (186, 109, 0, 255) })
2927 params.append({'name': 'fire', 'type': 'color', 'value': (245, 117, 0, 255) })
2928 params.append({'name': 'outside', 'type': 'color', 'value': 0.6})
2929 params.append({'name': 'R', 'type': 'color', 'value': (189, 204, 255, 255) })
2930 params.append({'name': 'Update as the box runned', 'type': 'bool', 'value': False }) # 'tip': "This is a checkbox"
2931
2932
2933 ### Create tree of Parameter objects
2934 # I don't know why that signals do not work for me
2935 # Only sigTreeStateChanged works, but I don't want to struggle with it
2936 # May be I'll report the issue
2937 #self.param.sigValueChanged.connect(self.param_changed)
2938 #self.param.sigValueChanging.connect(self.param_changing)
2939 self.param = pg.parametertree.Parameter.create(name='params', type='group', children=params)
2940
2941
2942
2943
2944 def recolor(self):
2945 pass
2946 # with pg.BusyCursor():
2947 # # keep the GUI responsive :)
2948 # self.sb_item.app.processEvents()
2949 # #č nejdřív triangulace
2950 # for tri_bound, plot_item in self.triangulation:
2951 # plot_item.show()
2952 #
2953 #
2954 # #č teď tečičky
2955 # for nodes, plot_item, cell_stats in self.simplices:
2956 # event = cell_stats['event']
2957 # if event in self.max_simplices:
2958 # cell_probability = cell_stats['cell_probability']
2959 # cm = self.param.getValues()[event][0] #č očekávám tam kolor mapu
2960 # blue_intensity = cell_probability / self.max_simplices[event]
2961 # color = cm.mapToQColor(blue_intensity)
2962 # else: # outside
2963 # color = 0.6
2964 # #symbolSize = np.sqrt(nodes.w / min(nodes.w)) # not bad
2965 # size = self.param.getValues()['node (pixel) size'][0]
2966 # plot_item.setSymbolBrush(color)
2967 # plot_item.setSymbolSize(size)
2968 # plot_item.show()
2969
2970
2971
2972 #č ten hlavní modul se dočkal na překopávání
2973 def on_box_run(self, *args, **kwargs):
2974 self.giracle.clear()
2975 #č je třeba zkontrolovat autorun a restartovat výpočet
2976 if self.param.getValues()['Update as the box runned'][0]:
2977 self.get_shell_estimation()
2978 #else:
2979 # self.self_clear()
2980
2981
2982 # def self_clear(self):
2983 # # odebereme prvky-propísky z hlavního plotu
2984 # for tri_bound, plot_item in self.triangulation:
2985 # self.sb_item.central_widget.removeItem(plot_item)
2986 # for nodes, plot_item, cell_stats in self.simplices:
2987 # self.sb_item.central_widget.removeItem(plot_item)
2988 #
2989 # self.redraw()
2990
2991 def get_shell_estimation(self):
2992 nsim = self.sb_item.slider.value()
2993 sample = self.sb_item.sample_box.f_model[:nsim]
2994
2995 try:
2996 ghull = stm.six.Ghull(sample, incremental=False, design=None)
2997 shell_estimation, global_stats = ghull.get_shell_estimation()
2998
2999 # if hasattr(self.sb_item.sample_box, 'estimations'):
3000 # self.sb_item.sample_box.estimations.append(data)
3001 # self.sb_item.estimation_added.emit()
3002 self.table.setData({**global_stats, 'shell_estimation':shell_estimation})
3003
3004 index = 'r'
3005 r = global_stats[index]
3006 if r < 0:
3007 r = 0
3008 color = self.param.getValues()[index][0] #č bude tam barva?
3009 plot_item = self.giracle.add_circle(r=r,\
3010 index=index, pen=color, name=index)
3011 plot_item.setZValue(32)
3012
3013 index = 'R'
3014 color = self.param.getValues()[index][0] #č bude tam barva?
3015 plot_item = self.giracle.add_circle(global_stats[index],\
3016 index=index, pen=color, name=index)
3017 plot_item.setZValue(32)
3018
3019 except BaseException as e:
3020 msg = "error during estimation "
3021 error_msg = self.__class__.__name__ + ": " + msg + repr(e)
3022 print(error_msg)
3023
3024
3025 def fire(self):
3026 nsim = self.sb_item.slider.value()
3027 sample = self.sb_item.sample_box.f_model[:nsim]
3028 #☺ Krucinal, kdo ten OrderedDict vymyslel?
3029 params = self.param.getValues()
3030 ns = params['budget'][0]
3031 try:
3032 ghull = stm.six.Ghull(sample, incremental=False, design=None)
3033 fire_G = ghull.fire(ns)
3034 fire = sample.new_sample(fire_G, space='G', extend=True)
3035
3036 color = self.param.getValues()['fire'][0] #č bude tam barva?
3037
3038
3039 # draw tečičky
3040
3041 size = self.param.getValues()['node (pixel) size'][0]
3042 #brush = pg.mkBrush(color)
3043 plot_item = self.giracle.add_serie(fire, index='fire',\
3044 pen=None, symbol='o', symbolPen=pg.mkPen(None), \
3045 symbolBrush=color, symbolSize=size, name='fire')
3046 plot_item.setZValue(30)
3047
3048 except BaseException as e:
3049 msg = "error "
3050 error_msg = self.__class__.__name__ + ": " + msg + repr(e)
3051 print(error_msg)
3052
3053
3054 def integrate(self):
3055 nsim = self.sb_item.slider.value()
3056 sample = self.sb_item.sample_box.f_model[:nsim]
3057 #☺ Krucinal, kdo ten OrderedDict vymyslel?
3058 params = self.param.getValues()
3059 budget = params['budget'][0]
3060
3061 # design = params['design'][0]
3062 # if design == 'None':
3063 # design = None
3064 # else:
3065 # design = self.sb_item.kwargs['designs'][design]
3066
3067 try:
3068 ghull = stm.six.Ghull(sample, incremental=False, design=None)
3069 data = ghull.integrate(budget)
3070 nodes, ghull_estimation, convex_hull_estimation, global_stats = data
3071
3072 #if hasattr(self.sb_item.sample_box, 'estimations'):
3073 #self.sb_item.sample_box.estimations.append(data)
3074 #self.sb_item.estimation_added.emit()
3075 self.table.setData({**global_stats, "ghull_estimation":ghull_estimation,\
3076 "convex_hull_estimation": convex_hull_estimation})
3077
3078 # draw tečičky
3079 size = self.param.getValues()['node (pixel) size'][0]
3080 plot_params = {'pen':None, 'symbol':'o', 'symbolSize':size, \
3081 'symbolPen':pg.mkPen(None)}
3082 #brush = pg.mkBrush(color)
3083 mask = nodes.is_outside
3084
3085 index = 'inside'
3086 color = self.param.getValues()[index][0] #č bude tam barva?
3087 plot_item = self.giracle.add_serie(nodes[mask], index=index,\
3088 symbolBrush=color, name=index, **plot_params)
3089 plot_item.setZValue(30)
3090
3091 index = 'outside'
3092 color = self.param.getValues()[index][0] #č bude tam barva?
3093 plot_item = self.giracle.add_serie(nodes[~mask], index=index,\
3094 symbolBrush=color, name=index, **plot_params)
3095 plot_item.setZValue(30)
3096
3097 index = 'r'
3098 r = global_stats[index]
3099 if r < 0:
3100 r = 0
3101 color = self.param.getValues()[index][0] #č bude tam barva?
3102 plot_item = self.giracle.add_circle(r=r,\
3103 index=index, pen=color, name=index)
3104 plot_item.setZValue(32)
3105
3106 index = 'R'
3107 color = self.param.getValues()[index][0] #č bude tam barva?
3108 plot_item = self.giracle.add_circle(global_stats[index],\
3109 index=index, pen=color, name=index)
3110 plot_item.setZValue(32)
3111
3112
3113 except BaseException as e:
3114 msg = "error during estimation "
3115 error_msg = self.__class__.__name__ + ": " + msg + repr(e)
3116 print(error_msg)
3117
3118
3119
3120
3121
3122
3123
3124
2667 3125 """ """
2668 3126 =========== ===========
2669 3127 ♥ Чыры-пыры ♥ Чыры-пыры
File simplex.py changed (mode: 100644) (index ed37e05..9c0f513)
... ... class Ghull:
35 35
36 36 def calculate_d(self): def calculate_d(self):
37 37 "calculates distances to planes. Can be negative" "calculates distances to planes. Can be negative"
38 A = convex_hull.equations[:,:-1]
38 A = self.convex_hull.equations[:,:-1]
39 39 b = self.convex_hull.equations[:,-1] b = self.convex_hull.equations[:,-1]
40 40 sum_squared = np.sum(np.square(A), axis=1) sum_squared = np.sum(np.square(A), axis=1)
41 41 self.d = b / np.sqrt(sum_squared) self.d = b / np.sqrt(sum_squared)
 
... ... class Ghull:
44 44 return -np.nanmax(self.d) return -np.nanmax(self.d)
45 45
46 46 def fire(self, ns): def fire(self, ns):
47 A = convex_hull.equations[:,:-1]
47 A = self.convex_hull.equations[:,:-1]
48 48 b = self.convex_hull.equations[:,-1] b = self.convex_hull.equations[:,-1]
49 49
50 50 to_fire = np.argmax(self.d) to_fire = np.argmax(self.d)
51 51 a = A[to_fire] a = A[to_fire]
52 fire_from = stats.norm.cdf(self.ger_r())
52 fire_from = stats.norm.cdf(self.get_r())
53 53 t = np.linspace(fire_from, 1, ns) t = np.linspace(fire_from, 1, ns)
54 54 t = stats.norm.ppf(t) t = stats.norm.ppf(t)
55 55 fire_G = t.reshape(-1,1) @ a.reshape(1,-1) fire_G = t.reshape(-1,1) @ a.reshape(1,-1)
 
... ... class Ghull:
60 60 shell = self.shell shell = self.shell
61 61 r = self.get_r() r = self.get_r()
62 62 R = self.get_R() R = self.get_R()
63 shell.set_bounds(r, R)
63
64 if r<0:
65 shell.set_bounds(0, R)
66 else:
67 shell.set_bounds(r, R)
64 68
65 69 # shell_estimation -22: inner, -3: shell, -11: outer # shell_estimation -22: inner, -3: shell, -11: outer
66 70 shell_estimation = {-22:shell.ps, -3: shell.p_shell, -11: shell.pf} shell_estimation = {-22:shell.ps, -3: shell.p_shell, -11: shell.pf}
 
... ... class Ghull:
70 74 def integrate(self, nis): def integrate(self, nis):
71 75 #č no to teda disajn třidy je doopravdy hroznej #č no to teda disajn třidy je doopravdy hroznej
72 76 # .get_shell_estimation() will calculate radiuses and will update shell # .get_shell_estimation() will calculate radiuses and will update shell
73 ghull_estimation, global_stats = self.get_shell_estimation()
77 shell_estimation, global_stats = self.get_shell_estimation()
74 78 nodes_G = self.shell.rvs(nis) nodes_G = self.shell.rvs(nis)
75 mask = is_outside(self.convex_hull, sample_G)
79 mask = is_outside(self.convex_hull, nodes_G)
76 80 #č nevím proč, ale kdysi mě to vyšlo rychlejc jak obyčejný součet #č nevím proč, ale kdysi mě to vyšlo rychlejc jak obyčejný součet
77 81 nf = len(mask[mask]) nf = len(mask[mask])
78 82 ns = nis - nf ns = nis - nf
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