File wellmet/dicebox/circumtri.py changed (mode: 100644) (index 9df95d1..983d072) |
... |
... |
TriEstimation = namedtuple('TriEstimation', ( |
34 |
34 |
"shell", |
"shell", |
35 |
35 |
"outer", |
"outer", |
36 |
36 |
"FORM_outside", |
"FORM_outside", |
|
37 |
|
"TwoFORM_outside", |
37 |
38 |
"orth_outside", |
"orth_outside", |
38 |
39 |
"shell_budget", |
"shell_budget", |
39 |
40 |
"shell_inside", |
"shell_inside", |
|
... |
... |
class CircumTri: |
83 |
84 |
|
|
84 |
85 |
bx.sample_box = sample_box |
bx.sample_box = sample_box |
85 |
86 |
|
|
|
87 |
|
#č přece ponechame složku pro uživatelské odhady |
|
88 |
|
#č stm kód může semka něco ukladat |
|
89 |
|
bx.estimations = [] |
|
90 |
|
|
86 |
91 |
#č vítejte nové uložiště odhadů. |
#č vítejte nové uložiště odhadů. |
87 |
92 |
#č Odhady z stm kódu už ale nemají na tohle sahat |
#č Odhady z stm kódu už ale nemají na tohle sahat |
88 |
93 |
if hasattr(bx, 'filename'): |
if hasattr(bx, 'filename'): |
89 |
|
bx.estimations = Store.create(bx.filename + "_tri", TriEstimation) |
|
|
94 |
|
bx.box_estimations = Store.create(bx.filename + "_tri", TriEstimation) |
90 |
95 |
else: |
else: |
91 |
|
bx.estimations = [] |
|
|
96 |
|
bx.box_estimations = [] |
92 |
97 |
|
|
93 |
98 |
bx.CC = sx.CircumCenter(sample_box.nvar) |
bx.CC = sx.CircumCenter(sample_box.nvar) |
94 |
99 |
|
|
|
... |
... |
class CircumTri: |
103 |
108 |
""" |
""" |
104 |
109 |
Returns dictionary of parameters the DiceBox was initialized with |
Returns dictionary of parameters the DiceBox was initialized with |
105 |
110 |
""" |
""" |
106 |
|
return "" |
|
107 |
|
return {'sample_object':bx.sample_box, 'scheme':bx.scheme.name,\ |
|
108 |
|
'tri_space':bx.tri_space, 'tree_space':bx.tree_space,\ |
|
109 |
|
'kechato_space':bx.kechato_space, 'potential':bx.potential,\ |
|
110 |
|
'p_norm':bx.p_norm, 'shell_budget':bx.shell_budget,\ |
|
111 |
|
'outer_budget':bx.outer_budget} |
|
|
111 |
|
return {'sample_box':bx.sample_box, 'scheme':bx.scheme.name,\ |
|
112 |
|
'tri_space':bx.tri_space, 'entropy_mode':bx.entropy_mode,\ |
|
113 |
|
'shell_budget':bx.shell_budget,'outer_budget':bx.outer_budget} |
112 |
114 |
|
|
113 |
115 |
|
|
114 |
116 |
def __repr__(bx): |
def __repr__(bx): |
|
... |
... |
class CircumTri: |
331 |
333 |
bx.convex_hull.update() |
bx.convex_hull.update() |
332 |
334 |
bx.estimate_outside() |
bx.estimate_outside() |
333 |
335 |
|
|
334 |
|
bx.estimations.append(bx.get_pf_estimation()) |
|
|
336 |
|
bx.box_estimations.append(bx.get_pf_estimation()) |
335 |
337 |
|
|
336 |
338 |
|
|
337 |
339 |
|
|
|
... |
... |
class CircumTri: |
392 |
394 |
#č první úkol máme splněný |
#č první úkol máme splněný |
393 |
395 |
bx.ghull_estimation = ghull_estimation |
bx.ghull_estimation = ghull_estimation |
394 |
396 |
bx.convex_hull_estimation = convex_hull_estimation |
bx.convex_hull_estimation = convex_hull_estimation |
|
397 |
|
|
|
398 |
|
#č kvůli názvu neleze do namedtuple |
|
399 |
|
global_stats['TwoFORM_outside'] = global_stats.pop('2FORM_outside') |
|
400 |
|
|
395 |
401 |
bx.global_stats = global_stats |
bx.global_stats = global_stats |
396 |
402 |
bx._logger(msg="outside estimation:", ghull_stats=global_stats) |
bx._logger(msg="outside estimation:", ghull_stats=global_stats) |
397 |
403 |
|
|
|
... |
... |
class CircumTri: |
431 |
437 |
#č takže musíme sami lepit nové etikety |
#č takže musíme sami lepit nové etikety |
432 |
438 |
bx.global_stats['nsim'] = bx.nsim |
bx.global_stats['nsim'] = bx.nsim |
433 |
439 |
|
|
434 |
|
#č kvůli názvu neleze do namedtuple |
|
435 |
|
bx.global_stats.pop('2FORM_outside', None) |
|
436 |
|
|
|
437 |
440 |
failsi = bx.failsi |
failsi = bx.failsi |
438 |
441 |
|
|
439 |
442 |
if 'tri' in dir(bx): |
if 'tri' in dir(bx): |
File wellmet/qt_gui/qt_gui.py changed (mode: 100644) (index 20d16ba..1451b57) |
... |
... |
class QtGuiWindow(QtWidgets.QMainWindow): |
261 |
261 |
#č graphy už nemusí jít po stm widgetech |
#č graphy už nemusí jít po stm widgetech |
262 |
262 |
if hasattr(self.sample_box, 'estimations'): |
if hasattr(self.sample_box, 'estimations'): |
263 |
263 |
dock = QtWidgets.QDockWidget("Estimation data", self) |
dock = QtWidgets.QDockWidget("Estimation data", self) |
264 |
|
dock.setWidget(EstimationTableWidget(self.sample_box.estimations, self, dock)) |
|
|
264 |
|
widget = EstimationTableWidget(self.sample_box.box_estimations, self.box_runned, dock) |
|
265 |
|
dock.setWidget(widget) |
265 |
266 |
self.dockables.append(dock) |
self.dockables.append(dock) |
266 |
267 |
self.tabifyDockWidget(self.dockables[0], dock) |
self.tabifyDockWidget(self.dockables[0], dock) |
267 |
268 |
|
|
|
... |
... |
E Miscellaneous |
549 |
550 |
|
|
550 |
551 |
|
|
551 |
552 |
class EstimationTableWidget(pg.TableWidget): |
class EstimationTableWidget(pg.TableWidget): |
552 |
|
def __init__(self, estimations, w, parent=None): |
|
|
553 |
|
def __init__(self, estimations, signal, parent=None): |
553 |
554 |
super().__init__(parent) |
super().__init__(parent) |
554 |
555 |
# sb like samplebox, of course |
# sb like samplebox, of course |
555 |
556 |
self.estimations = estimations |
self.estimations = estimations |
556 |
|
w.box_runned.connect(self.update) |
|
557 |
|
w.estimation_added.connect(self.update) |
|
|
557 |
|
signal.connect(self.update) |
558 |
558 |
|
|
559 |
559 |
self.setFormat('%g') |
self.setFormat('%g') |
560 |
560 |
self.update(self.estimations) |
self.update(self.estimations) |