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: finally refactored and Simplex Graph updated b81f6c276ab9153ac86c26fe2c47cd6b4504d1db Олёш 2020-09-09 16:33:49
qt_plot: just playing 068010ed53213845fa29fc49b18a6edf65fe0c08 Олёш 2020-09-08 22:27:09
qt_plot: FastSimplexEstimationWidget is ready 07210b295638e9022589630bc1fb2a9b7ba5bae6 Олёш 2020-09-08 19:33:31
qt_plot: WIP simplex widget 9c801dee251d9ba17cae0c254df8ca9a2fb88753 Олёш 2020-09-07 22:59:23
qt_plot: polishing (mainly, triangulation) a4d9fd7f841f9f56ee6ff0725315e988b0a683b5 Олёш 2020-09-05 01:53:06
qt_plot: refactoring, WIP 0dffc07efa9557f5660b0be669b4e42ff7b049e8 Олёш 2020-09-04 23:21:58
estimation: fast_simplex_estimation added 28c2325972df8335b80d4a79ac4468363e0b2917 Олёш 2020-09-03 15:52:48
estimation: little enhancement 694db9ebd144ee5e0fba0b068e8c73b5e06a4b98 Олёш 2020-09-02 01:14:20
estimation: new simlex_estimation added be2a9b65df74e9c3d4c03d30530d50796604f431 Олёш 2020-09-01 23:23:22
f_models: little refactoring, performance boost is not almost visible, though a34473ad2ef19973c69bde8b8c6aa29eb1614399 Олёш 2020-08-23 21:52:43
candybox: little fix 65cbd8d0fdbfd80cfa46d2fd7d87d2226b7b2c12 Олёш 2020-08-22 23:50:26
f_models, SNorm: little fix at .add_sample, a little bit better performance 49e808b07d199e8c97d7dfcda24428e8c2a081ec Олёш 2020-08-22 23:48:09
blackbox, OptimizedCensoredSampling: little refactoring, a little better performance 9825bf5531f52acb2af3bdc3b10b4c8c67101300 Олёш 2020-08-22 23:45:44
g_models: four_branch_2D refactored into the class FourBranch2D 5c60519a95121530e97e0a452b2c4ab8926c46fd I am 2020-08-21 21:45:14
LHS turned off, new test function 'Sball' 22057718d681144478dc5ea2b4e94c60394eb4c9 Miroslav Vořechovský 2020-08-13 15:53:55
gl_plot: ready 4c52875c06ecd32dddbbcb9d3638033ece5fb34b Alex 2020-08-11 01:42:53
gl_plot: SimplexEstimationWidget now almost works d25a5a4048d55090c53d63368882f3ae4027236f Alex 2020-08-10 23:34:29
gl_plot: už je to hustý ebcbd27e880f61bece09e126617cf46554f3a41d Alex 2020-08-10 18:26:44
gl_plot: WIP e9032c2b108b42630e8ae894ab9badf4ac4d2064 Alex 2020-08-10 07:27:45
gl_plot: WIP b746a2b7f175681bafbbabb4de8eaae673afdf9b Alex 2020-08-10 01:28:45
Commit b81f6c276ab9153ac86c26fe2c47cd6b4504d1db - qt_plot: finally refactored and Simplex Graph updated
Author: Олёш
Author date (UTC): 2020-09-09 16:33
Committer name: Олёш
Committer date (UTC): 2020-09-09 16:33
Parent(s): 068010ed53213845fa29fc49b18a6edf65fe0c08
Signer:
Signing key:
Signing status: N
Tree: 1ccf2f7faca7d149cf3256e6e4d9f9a5fa711719
File Lines added Lines deleted
qt_plot.py 87 32
File qt_plot.py changed (mode: 100644) (index bc079bc..151af7a)
... ... Estimation graph widgets
717 717 """ """
718 718
719 719
720 def get_estimation_data(estimations, metric):
721 metric_dict = dict()
722 # new-style: šecko leží dohromady a každý z toho
723 # bere co chce a jak chce
724 # ne že by to bylo nějak šetrný
725 # estimation je slovníkem
726 for estimation in estimations:
727 # nsim musí mäť každej odhad
728 # pokud nemá - je třeba jej prostě opravit
729 nsim = estimation['nsim']
730 try:
731 if estimation[metric] > 0:
732 metric_dict[nsim] = estimation[metric]
733 except KeyError as e:
734 pass #print(self.__class__.__name__ + ":", repr(e))
735
736 # nikdo neslibil, že budou v pořadí
737 x = np.sort(tuple(metric_dict.keys()))
738 y = np.array(tuple(metric_dict.values()))[np.argsort(tuple(metric_dict.keys()))]
739 return x, y
740
720 741
721 742
722 743 class TriEstimationGraph(pg.PlotWidget): class TriEstimationGraph(pg.PlotWidget):
 
... ... class SimpleSimplexEstimationGraph(pg.PlotWidget):
820 841 self.pen_mix = self.plot(x, y, fillLevel=0, brush=(255, 165, 0)) # orange self.pen_mix = self.plot(x, y, fillLevel=0, brush=(255, 165, 0)) # orange
821 842 self.pen_outside = self.plot(x, y, fillLevel=0, brush=0.8) # grey self.pen_outside = self.plot(x, y, fillLevel=0, brush=0.8) # grey
822 843 self.pen_success = self.plot(x, y, fillLevel=0, brush='g') # green self.pen_success = self.plot(x, y, fillLevel=0, brush='g') # green
823 self.pen_exact = self.plot(x, y, pen='b') # blue
824 844
825 845
826 846 else: else:
 
... ... class SimpleSimplexEstimationGraph(pg.PlotWidget):
829 849 self.pen_outside = self.plot(x, y, fillLevel=0, brush=0.8) # grey self.pen_outside = self.plot(x, y, fillLevel=0, brush=0.8) # grey
830 850 self.pen_mix = self.plot(x, y, fillLevel=0, brush=(255, 165, 0)) # orange self.pen_mix = self.plot(x, y, fillLevel=0, brush=(255, 165, 0)) # orange
831 851 self.pen_f = self.plot(x, y, fillLevel=0, brush='r') # red self.pen_f = self.plot(x, y, fillLevel=0, brush='r') # red
832 self.pen_exact = self.plot(x, y, pen='b') # blue
852
853 self.pen_vertex = self.plot(x, y, pen='c', name='simple')
854 self.pen_weighted_vertex = self.plot(x, y, pen=(170, 170, 255), name='weighted')
855 try:
856 exact_name = self.black_box.pf_exact_method
857 except:
858 exact_name = ""
859 self.pen_exact = self.plot(x, y, pen='b', name=exact_name) # blue
833 860
834 861
835 862 self.redraw() self.redraw()
 
... ... class SimpleSimplexEstimationGraph(pg.PlotWidget):
856 883 xmax = nsim xmax = nsim
857 884 if nsim < xmin: if nsim < xmin:
858 885 xmin = nsim xmin = nsim
886
859 887 except KeyError as e: except KeyError as e:
860 888 pass #print(self.__class__.__name__ + ":", repr(e)) pass #print(self.__class__.__name__ + ":", repr(e))
861 889
 
... ... class SimpleSimplexEstimationGraph(pg.PlotWidget):
876 904 self.pen_mix.setData(x, nonzero(df.failure)) self.pen_mix.setData(x, nonzero(df.failure))
877 905 self.pen_outside.setData(x, nonzero(df.failure+df.mix)) self.pen_outside.setData(x, nonzero(df.failure+df.mix))
878 906 self.pen_success.setData(x, nonzero(df.failure+df.mix+df.out)) # kontrolu, zda je to 1, nechame uživateli self.pen_success.setData(x, nonzero(df.failure+df.mix+df.out)) # kontrolu, zda je to 1, nechame uživateli
879
880
881
882 907 else: else:
883 908 # Update the data # Update the data
884 909 self.pen_f.setData(x, df.failure) self.pen_f.setData(x, df.failure)
 
... ... class SimpleSimplexEstimationGraph(pg.PlotWidget):
886 911 self.pen_outside.setData(x, df.failure+df.mix+df.out) self.pen_outside.setData(x, df.failure+df.mix+df.out)
887 912 self.pen_success.setData(x, df.failure+df.mix+df.out+df.success) # kontrolu, zda je to 1, nechame uivateli self.pen_success.setData(x, df.failure+df.mix+df.out+df.success) # kontrolu, zda je to 1, nechame uivateli
888 913
889
914 self.pen_vertex.setData(*get_estimation_data(self.black_box.estimations, 'vertex_estimation'))
915 self.pen_weighted_vertex.setData(*get_estimation_data(self.black_box.estimations, 'weighted_vertex_estimation'))
890 916
891 917 if (xmax - xmin) > 0: if (xmax - xmin) > 0:
892 918 if hasattr(self.black_box, 'pf_exact'): if hasattr(self.black_box, 'pf_exact'):
 
... ... class VoronoiEstimationWidget(pg.LayoutWidget):
1585 1611 addLabel(text=' ', row=None, col=None, rowspan=1, colspan=1, **kargs) addLabel(text=' ', row=None, col=None, rowspan=1, colspan=1, **kargs)
1586 1612 """ """
1587 1613 # I'd like to get access to the samplebox stuff via the container's reference, # I'd like to get access to the samplebox stuff via the container's reference,
1588 # but relying to Qt's parent mechanism makes me worry.
1614 # INHERETED by gl_plot
1589 1615 def __init__(self, samplebox_item, parent=None, *args, **kwargs): def __init__(self, samplebox_item, parent=None, *args, **kwargs):
1590 1616 super().__init__(parent) super().__init__(parent)
1591 1617 # sb like samplebox, of course # sb like samplebox, of course
 
... ... class VoronoiEstimationWidget(pg.LayoutWidget):
1597 1623 self.sb_item.redraw_called.connect(self.redraw) self.sb_item.redraw_called.connect(self.redraw)
1598 1624 #☺ na internetu všichni tak dělaj #☺ na internetu všichni tak dělaj
1599 1625 self.setup() self.setup()
1600
1626
1627 # INHERETED by gl_plot
1601 1628 def setup(self): def setup(self):
1602 1629 # model_space='Rn', sampling_space=None, p_norm=1, budget=20000 # model_space='Rn', sampling_space=None, p_norm=1, budget=20000
1603 1630 params = [{'name': 'method', 'type': 'list', 'values': ['Voronoi_tesselation','Voronoi_2_point_estimation'], 'value': 'Voronoi_2_point_estimation'}] params = [{'name': 'method', 'type': 'list', 'values': ['Voronoi_tesselation','Voronoi_2_point_estimation'], 'value': 'Voronoi_2_point_estimation'}]
 
... ... class VoronoiEstimationWidget(pg.LayoutWidget):
1622 1649 self.ptree = pg.parametertree.ParameterTree() self.ptree = pg.parametertree.ParameterTree()
1623 1650 self.ptree.setParameters(self.param, showTop=False) self.ptree.setParameters(self.param, showTop=False)
1624 1651
1625 self.addWidget(self.ptree, row=0, col=0, colspan=2)
1652 self.addWidget(self.ptree, row=0, col=0, colspan=3)
1626 1653
1627 1654
1628 1655 self.btn = QtGui.QPushButton('estimate') self.btn = QtGui.QPushButton('estimate')
 
... ... class VoronoiEstimationWidget(pg.LayoutWidget):
1633 1660 self.addWidget(self.btn2, row=1, col=1) self.addWidget(self.btn2, row=1, col=1)
1634 1661 self.btn2.clicked.connect(self.recolor) self.btn2.clicked.connect(self.recolor)
1635 1662
1663 self.btn3 = QtGui.QPushButton('hide')
1664 self.addWidget(self.btn3, row=1, col=2)
1665 self.btn3.clicked.connect(self.hide)
1666
1636 1667 # self.autorun = QtGui.QCheckBox('Run with the box') # self.autorun = QtGui.QCheckBox('Run with the box')
1637 1668 # self.addWidget(self.autorun, row=1, col=1) # self.addWidget(self.autorun, row=1, col=1)
1638 1669
1639 1670 self.table = pg.TableWidget(sortable=False) self.table = pg.TableWidget(sortable=False)
1640 self.addWidget(self.table, row=2, col=0, colspan=2)
1671 self.addWidget(self.table, row=2, col=0, colspan=3)
1641 1672
1642 1673 # pro začatek postačí # pro začatek postačí
1643 1674 self.cells = [] self.cells = []
 
... ... class VoronoiEstimationWidget(pg.LayoutWidget):
1646 1677 self.p_cell_max = {'success':0, 'failure':0} self.p_cell_max = {'success':0, 'failure':0}
1647 1678
1648 1679
1649
1680 # INHERETED by gl_plot
1650 1681 def on_box_run(self, *args, **kwargs): def on_box_run(self, *args, **kwargs):
1651 1682 # je třeba zkontrolovat autorun a restartovat výpočet # je třeba zkontrolovat autorun a restartovat výpočet
1652 1683 if self.param.getValues()['Run with the box'][0]: if self.param.getValues()['Run with the box'][0]:
 
... ... class VoronoiEstimationWidget(pg.LayoutWidget):
1654 1685 #else: #else:
1655 1686 #self.self_clear() #self.self_clear()
1656 1687
1688 # INHERETED by gl_plot
1689 def hide(self):
1690 for nodes, plot_item, cell_stats in self.cells:
1691 plot_item.hide()
1692 # keep the GUI responsive :)
1693 #self.sb_item.app.processEvents()
1694
1695 # INHERETED by gl_plot
1657 1696 def redraw(self, *args, **kwargs): def redraw(self, *args, **kwargs):
1658 1697 self.cells.clear() self.cells.clear()
1659 1698 self.p_cell_max['success'] = 0 self.p_cell_max['success'] = 0
1660 1699 self.p_cell_max['failure'] = 0 self.p_cell_max['failure'] = 0
1661 1700
1662 # I'll rename after main widget refactoring
1701 ## I'll rename after main widget refactoring
1702 # refactoring already done, why I should rename?
1703 # INHERETED by gl_plot
1663 1704 def recolor(self): def recolor(self):
1664 1705 # indikace # indikace
1665 1706 #self.setDisabled(True) #self.setDisabled(True)
 
... ... class VoronoiEstimationWidget(pg.LayoutWidget):
1683 1724
1684 1725
1685 1726 def on_space_changed(self, *args, **kwargs): def on_space_changed(self, *args, **kwargs):
1686 # asi stači překreslit propísky z tri_bound'ov
1687 pass
1727 # teď tečičky
1728 for nodes, plot_item, cell_stats in self.cells:
1729 pos = getattr(nodes, self.sb_item.space)
1730 plot_item.setData(pos)
1688 1731
1689 1732
1733 # INHERETED by gl_plot
1690 1734 def self_clear(self): def self_clear(self):
1691 1735 # odebereme prvky-propísky z hlavního plotu # odebereme prvky-propísky z hlavního plotu
1692 1736 for nodes, plot_item, cell_stats in self.cells: for nodes, plot_item, cell_stats in self.cells:
 
... ... class VoronoiEstimationWidget(pg.LayoutWidget):
1696 1740
1697 1741
1698 1742
1699
1743 # INHERETED by gl_plot
1700 1744 def run_stm(self): def run_stm(self):
1701 1745 # indikace # indikace
1702 1746 #self.setDisabled(True) #self.setDisabled(True)
 
... ... class VoronoiEstimationWidget(pg.LayoutWidget):
1755 1799 if nodes and cell_stats provided we will add them to self.cells if nodes and cell_stats provided we will add them to self.cells
1756 1800 otherwise function redraw items in self.cells otherwise function redraw items in self.cells
1757 1801 """ """
1758
1802 plot_widget = self.sb_item.central_widget
1759 1803 if nodes is None: if nodes is None:
1760 1804 for cell in self.cells: for cell in self.cells:
1761 1805 nodes, plot_item, cell_stats = cell nodes, plot_item, cell_stats = cell
 
... ... class VoronoiEstimationWidget(pg.LayoutWidget):
1764 1808 # protože nikdo neví co tam bylo před tím # protože nikdo neví co tam bylo před tím
1765 1809 # takhle, nechce se mi drbat s tím, co tam bylo před tím # takhle, nechce se mi drbat s tím, co tam bylo před tím
1766 1810 # komplikace ze strany pyqtgraph # komplikace ze strany pyqtgraph
1767 self.sb_item.plotWidget.removeItem(plot_item)
1811 plot_widget.removeItem(plot_item)
1768 1812
1769 1813 # bacha, potřebuji prvek uložiť in-place # bacha, potřebuji prvek uložiť in-place
1770 1814 cell[1] = self.node_pf_scatter_plot(nodes, cell_stats) cell[1] = self.node_pf_scatter_plot(nodes, cell_stats)
 
... ... class VoronoiEstimationWidget(pg.LayoutWidget):
1785 1829 def node_pf_scatter_plot(self, nodes, cell_stats): def node_pf_scatter_plot(self, nodes, cell_stats):
1786 1830 pos = getattr(nodes, self.sb_item.space) pos = getattr(nodes, self.sb_item.space)
1787 1831 symbol_size = self.param.getValues()['node (pixel) size'][0] symbol_size = self.param.getValues()['node (pixel) size'][0]
1788
1832 plot_widget = self.sb_item.central_widget
1789 1833 # zas, нет ножек - нет мультиков # zas, нет ножек - нет мультиков
1790 1834 # node_pf_estimations nemusejí bejt # node_pf_estimations nemusejí bejt
1791 1835 try: try:
 
... ... class VoronoiEstimationWidget(pg.LayoutWidget):
1802 1846 # tuším, že je to neunosně drahý # tuším, že je to neunosně drahý
1803 1847 list_of_dicts = list({'pos': pos[i], 'size':symbol_size, 'pen': colors[i], 'brush':colors[i], 'symbol':'o'} for i in range(len(pos))) list_of_dicts = list({'pos': pos[i], 'size':symbol_size, 'pen': colors[i], 'brush':colors[i], 'symbol':'o'} for i in range(len(pos)))
1804 1848 plot_item = pg.ScatterPlotItem(list_of_dicts) plot_item = pg.ScatterPlotItem(list_of_dicts)
1805 self.sb_item.plotWidget.addItem(plot_item)
1849 plot_widget.addItem(plot_item)
1806 1850 return plot_item return plot_item
1807 1851
1808 1852 except BaseException as e: except BaseException as e:
1809 1853 msg = "node_pf_coloring has problems " msg = "node_pf_coloring has problems "
1810 1854 error_msg = self.__class__.__name__ + ": " + msg + repr(e) error_msg = self.__class__.__name__ + ": " + msg + repr(e)
1811 1855 print(error_msg) print(error_msg)
1812 self.error.emit(error_msg)
1856 #self.error.emit(error_msg)
1813 1857 # simple coloring # simple coloring
1814 1858 event = cell_stats['event'] event = cell_stats['event']
1815 1859 color = self.get_color(event) color = self.get_color(event)
1816 1860 #symbolSize = np.sqrt(nodes.w / min(nodes.w)) # not bad #symbolSize = np.sqrt(nodes.w / min(nodes.w)) # not bad
1817 return self.sb_item.plotWidget.plot(pos, pen=None, symbol='o', symbolPen=color, symbolBrush=color, symbolSize=symbol_size, name='IS localized nodes')
1861 return plot_widget.plot(pos, pen=None, symbol='o', symbolPen=color, symbolBrush=color, symbolSize=symbol_size, name='IS localized nodes')
1818 1862
1819 1863
1820 1864
 
... ... class VoronoiEstimationWidget(pg.LayoutWidget):
1826 1870 otherwise function redraw items in self.cells otherwise function redraw items in self.cells
1827 1871 """ """
1828 1872 symbol_size = self.param.getValues()['node (pixel) size'][0] symbol_size = self.param.getValues()['node (pixel) size'][0]
1829
1873 plot_widget = self.sb_item.central_widget
1830 1874 if nodes is None: if nodes is None:
1831 1875 for cell in self.cells: for cell in self.cells:
1832 1876 nodes, plot_item, cell_stats = cell nodes, plot_item, cell_stats = cell
 
... ... class VoronoiEstimationWidget(pg.LayoutWidget):
1835 1879 # protože nikdo neví co tam bylo před tím # protože nikdo neví co tam bylo před tím
1836 1880 # takhle, nechce se mi drbat s tím, co tam bylo před tím # takhle, nechce se mi drbat s tím, co tam bylo před tím
1837 1881 # komplikace ze strany pyqtgraph # komplikace ze strany pyqtgraph
1838 self.sb_item.plotWidget.removeItem(plot_item)
1882 plot_widget.removeItem(plot_item)
1839 1883
1840 1884 # draw # draw
1841 1885 pos = getattr(nodes, self.sb_item.space) pos = getattr(nodes, self.sb_item.space)
 
... ... class VoronoiEstimationWidget(pg.LayoutWidget):
1845 1889 color = self.get_color(event) color = self.get_color(event)
1846 1890 #symbolSize = np.sqrt(nodes.w / min(nodes.w)) # not bad #symbolSize = np.sqrt(nodes.w / min(nodes.w)) # not bad
1847 1891 # bacha, potřebuji prvek uložiť in-place # bacha, potřebuji prvek uložiť in-place
1848 cell[1] = self.sb_item.plotWidget.plot(pos, pen=None, symbol='o',\
1892 cell[1] = plot_widget.plot(pos, pen=None, symbol='o',\
1849 1893 symbolPen=color, symbolBrush=color, symbolSize=symbol_size, name='IS localized nodes') symbolPen=color, symbolBrush=color, symbolSize=symbol_size, name='IS localized nodes')
1850 1894
1851 1895 # máme nodes, tj. jedeme poprvé # máme nodes, tj. jedeme poprvé
 
... ... class VoronoiEstimationWidget(pg.LayoutWidget):
1857 1901 event = cell_stats['event'] event = cell_stats['event']
1858 1902 color = self.get_color(event) color = self.get_color(event)
1859 1903 #symbolSize = np.sqrt(nodes.w / min(nodes.w)) # not bad #symbolSize = np.sqrt(nodes.w / min(nodes.w)) # not bad
1860 plot_item = self.sb_item.plotWidget.plot(pos, pen=None, symbol='o',\
1904 plot_item = plot_widget.plot(pos, pen=None, symbol='o',\
1861 1905 symbolPen=color, symbolBrush=color, symbolSize=symbol_size, name='IS localized nodes') symbolPen=color, symbolBrush=color, symbolSize=symbol_size, name='IS localized nodes')
1862 1906
1863 1907 # uložíme data # uložíme data
 
... ... class VoronoiEstimationWidget(pg.LayoutWidget):
1874 1918 otherwise function redraw items in self.cells otherwise function redraw items in self.cells
1875 1919 """ """
1876 1920 symbol_size = self.param.getValues()['node (pixel) size'][0] symbol_size = self.param.getValues()['node (pixel) size'][0]
1877
1921 plot_widget = self.sb_item.central_widget
1878 1922 if nodes is None: if nodes is None:
1879 1923 # odebereme prvky z hlavního plotu # odebereme prvky z hlavního plotu
1880 1924 # zde je třeba prvky vygenerovat znovu # zde je třeba prvky vygenerovat znovu
 
... ... class VoronoiEstimationWidget(pg.LayoutWidget):
1882 1926 # takhle, nechce se mi drbat s tím, co tam bylo před tím # takhle, nechce se mi drbat s tím, co tam bylo před tím
1883 1927 # komplikace ze strany pyqtgraph # komplikace ze strany pyqtgraph
1884 1928 for nodes, plot_item, cell_stats in self.cells: for nodes, plot_item, cell_stats in self.cells:
1885 self.sb_item.plotWidget.removeItem(plot_item)
1929 plot_widget.removeItem(plot_item)
1886 1930
1887 1931 event = cell_stats['event'] event = cell_stats['event']
1888 1932 cell_probability = cell_stats['cell_probability'] cell_probability = cell_stats['cell_probability']
 
... ... class VoronoiEstimationWidget(pg.LayoutWidget):
1903 1947 color = self.get_color(event, blue_intensity) color = self.get_color(event, blue_intensity)
1904 1948 #symbolSize = np.sqrt(nodes.w / min(nodes.w)) # not bad #symbolSize = np.sqrt(nodes.w / min(nodes.w)) # not bad
1905 1949 # bacha, potřebuji prvek vložit zpätky # bacha, potřebuji prvek vložit zpätky
1906 cell[1] = self.sb_item.plotWidget.plot(pos, pen=None, symbol='o',\
1950 cell[1] = plot_widget.plot(pos, pen=None, symbol='o',\
1907 1951 symbolPen=color, symbolBrush=color, symbolSize=symbol_size, name='IS localized nodes') symbolPen=color, symbolBrush=color, symbolSize=symbol_size, name='IS localized nodes')
1908 1952
1909 1953 # máme nodes, tj. jedeme poprvé # máme nodes, tj. jedeme poprvé
 
... ... class VoronoiEstimationWidget(pg.LayoutWidget):
1936 1980 #x, y = (*getattr(nodes, self.sb_item.space).T,) #x, y = (*getattr(nodes, self.sb_item.space).T,)
1937 1981
1938 1982 #symbolSize = np.sqrt(nodes.w / min(nodes.w)) # not bad #symbolSize = np.sqrt(nodes.w / min(nodes.w)) # not bad
1939 plot_item = self.sb_item.plotWidget.plot(pos, pen=None, symbol='o',\
1983 plot_item = plot_widget.plot(pos, pen=None, symbol='o',\
1940 1984 symbolPen=color, symbolBrush=color, symbolSize=symbol_size, name='IS localized nodes') symbolPen=color, symbolBrush=color, symbolSize=symbol_size, name='IS localized nodes')
1941 1985
1942 1986 # uložíme data # uložíme data
 
... ... class CandidatesWidget(pg.LayoutWidget):
2037 2081 # 3 # 3
2038 2082 # #
2039 2083 self.gradient = pg.GradientWidget(self, orientation='right') self.gradient = pg.GradientWidget(self, orientation='right')
2084 self.gradient.setColorMap(pg.colormap.ColorMap((0,1),\
2085 [(255, 255, 255, 255), (67, 0, 81, 255)]))
2040 2086 self.addWidget(self.gradient, row=2, col=1) self.addWidget(self.gradient, row=2, col=1)
2041 2087
2088
2089
2042 2090 #E pens, i.e. handles of PlotItem #E pens, i.e. handles of PlotItem
2043 2091 self.pens = [] self.pens = []
2044 2092
 
... ... class CandidatesWidget(pg.LayoutWidget):
2046 2094 def run_stm(self): def run_stm(self):
2047 2095 #č indikace #č indikace
2048 2096 #self.setDisabled(True) #self.setDisabled(True)
2097 plot_widget = self.sb_item.central_widget
2049 2098 with pg.BusyCursor(): with pg.BusyCursor():
2050 2099
2051 2100 color_map = self.gradient.colorMap() color_map = self.gradient.colorMap()
 
... ... class CandidatesWidget(pg.LayoutWidget):
2068 2117 mincb = np.nanmin(array) mincb = np.nanmin(array)
2069 2118 if maxcb > maxvalue: if maxcb > maxvalue:
2070 2119 maxvalue = maxcb maxvalue = maxcb
2120 maxitem = cb[np.nanargmax(array)]
2071 2121 if mincb < minvalue: if mincb < minvalue:
2072 2122 minvalue = mincb minvalue = mincb
2073 2123
2074
2075
2124 #č zvlášť nakreslím maximální hodnotu
2125 pos = getattr(maxitem, self.sb_item.space)
2126 max_item = plot_widget.plot(pos, data=maxvalue, pen=None, symbol='t1',\
2127 symbolBrush=color_map.mapToQColor(1))
2128 max_item.setZValue(130)
2129 self.pens.append(max_item)
2130
2076 2131 #č a teď jdeme! #č a teď jdeme!
2077 2132 for id, cb in self.sb_item.sample_box.candidates_index.items(): for id, cb in self.sb_item.sample_box.candidates_index.items():
2078 2133 array = getattr(cb, attr) array = getattr(cb, attr)
 
... ... class CandidatesWidget(pg.LayoutWidget):
2089 2144 #č sehnal jsem toto ze zdrojaků pyqtgraph #č sehnal jsem toto ze zdrojaků pyqtgraph
2090 2145 style = dict(pen=None, symbol='o', symbolSize=self.sb_item.px_size, symbolPen=pg.mkPen(None)) style = dict(pen=None, symbol='o', symbolSize=self.sb_item.px_size, symbolPen=pg.mkPen(None))
2091 2146 style['symbolBrush'] = np.array([pg.functions.mkBrush(*x) for x in color_map.map(norm_values)]) style['symbolBrush'] = np.array([pg.functions.mkBrush(*x) for x in color_map.map(norm_values)])
2092 pen = self.sb_item.plotWidget.plot(pos, data=values, **style)
2147 pen = plot_widget.plot(pos, data=values, **style)
2093 2148 pen.setZValue(-1) pen.setZValue(-1)
2094 2149 self.pens.append(pen) self.pens.append(pen)
2095 2150
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