@@ -135,23 +135,26 @@ def __init__(self, minuit, par, callback):
135
135
136
136
size_policy = QtWidgets .QSizePolicy (
137
137
QtWidgets .QSizePolicy .Policy .MinimumExpanding ,
138
- QtWidgets .QSizePolicy .Policy .Fixed )
138
+ QtWidgets .QSizePolicy .Policy .Fixed ,
139
+ )
139
140
self .setSizePolicy (size_policy )
140
141
layout = QtWidgets .QVBoxLayout ()
141
142
self .setLayout (layout )
142
143
143
- label = QtWidgets .QLabel (
144
- par , alignment = QtCore .Qt .AlignmentFlag .AlignCenter )
144
+ label = QtWidgets .QLabel (par , alignment = QtCore .Qt .AlignmentFlag .AlignCenter )
145
145
label .setMinimumSize (QtCore .QSize (50 , 0 ))
146
146
self .value_label = QtWidgets .QLabel (
147
- alignment = QtCore .Qt .AlignmentFlag .AlignCenter )
147
+ alignment = QtCore .Qt .AlignmentFlag .AlignCenter
148
+ )
148
149
self .value_label .setMinimumSize (QtCore .QSize (50 , 0 ))
149
150
self .slider = FloatSlider (self .value_label )
150
151
self .tmin = QtWidgets .QDoubleSpinBox (
151
- alignment = QtCore .Qt .AlignmentFlag .AlignCenter )
152
+ alignment = QtCore .Qt .AlignmentFlag .AlignCenter
153
+ )
152
154
self .tmin .setRange (_make_finite (- np .inf ), _make_finite (np .inf ))
153
155
self .tmax = QtWidgets .QDoubleSpinBox (
154
- alignment = QtCore .Qt .AlignmentFlag .AlignCenter )
156
+ alignment = QtCore .Qt .AlignmentFlag .AlignCenter
157
+ )
155
158
self .tmax .setRange (_make_finite (- np .inf ), _make_finite (np .inf ))
156
159
self .tmin .setSizePolicy (size_policy )
157
160
self .tmax .setSizePolicy (size_policy )
@@ -162,8 +165,8 @@ def __init__(self, minuit, par, callback):
162
165
self .fit .setCheckable (True )
163
166
self .fit .setChecked (False )
164
167
size_policy = QtWidgets .QSizePolicy (
165
- QtWidgets .QSizePolicy .Policy .Fixed ,
166
- QtWidgets . QSizePolicy . Policy . Fixed )
168
+ QtWidgets .QSizePolicy .Policy .Fixed , QtWidgets . QSizePolicy . Policy . Fixed
169
+ )
167
170
self .fix .setSizePolicy (size_policy )
168
171
self .fit .setSizePolicy (size_policy )
169
172
layout1 = QtWidgets .QHBoxLayout ()
@@ -278,7 +281,8 @@ def __init__(self):
278
281
plot_group = QtWidgets .QGroupBox ("" , parent = interactive_tab )
279
282
size_policy = QtWidgets .QSizePolicy (
280
283
QtWidgets .QSizePolicy .Policy .MinimumExpanding ,
281
- QtWidgets .QSizePolicy .Policy .MinimumExpanding )
284
+ QtWidgets .QSizePolicy .Policy .MinimumExpanding ,
285
+ )
282
286
plot_group .setSizePolicy (size_policy )
283
287
plot_layout = QtWidgets .QVBoxLayout (plot_group )
284
288
fig , ax = plt .subplots ()
@@ -290,24 +294,23 @@ def __init__(self):
290
294
button_group = QtWidgets .QGroupBox ("" , parent = interactive_tab )
291
295
size_policy = QtWidgets .QSizePolicy (
292
296
QtWidgets .QSizePolicy .Policy .Expanding ,
293
- QtWidgets .QSizePolicy .Policy .Fixed )
297
+ QtWidgets .QSizePolicy .Policy .Fixed ,
298
+ )
294
299
button_group .setSizePolicy (size_policy )
295
300
button_layout = QtWidgets .QHBoxLayout (button_group )
296
301
self .fit_button = QtWidgets .QPushButton ("Fit" , parent = button_group )
297
- self .fit_button .setStyleSheet (
298
- "background-color: #2196F3; color: white" )
302
+ self .fit_button .setStyleSheet ("background-color: #2196F3; color: white" )
299
303
self .fit_button .clicked .connect (partial (self .do_fit , plot = True ))
300
304
button_layout .addWidget (self .fit_button )
301
305
self .update_button = QtWidgets .QPushButton (
302
- "Continuous" , parent = button_group )
306
+ "Continuous" , parent = button_group
307
+ )
303
308
self .update_button .setCheckable (True )
304
309
self .update_button .setChecked (True )
305
310
self .update_button .clicked .connect (self .on_update_button_clicked )
306
311
button_layout .addWidget (self .update_button )
307
- self .reset_button = QtWidgets .QPushButton (
308
- "Reset" , parent = button_group )
309
- self .reset_button .setStyleSheet (
310
- "background-color: #F44336; color: white" )
312
+ self .reset_button = QtWidgets .QPushButton ("Reset" , parent = button_group )
313
+ self .reset_button .setStyleSheet ("background-color: #F44336; color: white" )
311
314
self .reset_button .clicked .connect (self .on_reset_button_clicked )
312
315
button_layout .addWidget (self .reset_button )
313
316
self .algo_choice = QtWidgets .QComboBox (parent = button_group )
@@ -320,7 +323,8 @@ def __init__(self):
320
323
scroll_area .setWidgetResizable (True )
321
324
size_policy = QtWidgets .QSizePolicy (
322
325
QtWidgets .QSizePolicy .Policy .MinimumExpanding ,
323
- QtWidgets .QSizePolicy .Policy .MinimumExpanding )
326
+ QtWidgets .QSizePolicy .Policy .MinimumExpanding ,
327
+ )
324
328
scroll_area .setSizePolicy (size_policy )
325
329
scroll_area_contents = QtWidgets .QWidget ()
326
330
parameter_layout = QtWidgets .QVBoxLayout (scroll_area_contents )
@@ -352,8 +356,7 @@ def fit(self):
352
356
assert False # pragma: no cover, should never happen
353
357
return True
354
358
355
- def on_parameter_change (self , from_fit = False ,
356
- report_success = False ):
359
+ def on_parameter_change (self , from_fit = False , report_success = False ):
357
360
if not from_fit :
358
361
if any (x .fit .isChecked () for x in self .parameters ):
359
362
saved = minuit .fixed [:]
@@ -378,8 +381,7 @@ def do_fit(self, plot=True):
378
381
x .reset (val = minuit .values [i ])
379
382
if not plot :
380
383
return report_success
381
- self .on_parameter_change (
382
- from_fit = True , report_success = report_success )
384
+ self .on_parameter_change (from_fit = True , report_success = report_success )
383
385
384
386
def on_update_button_clicked (self ):
385
387
for x in self .parameters :
0 commit comments