1 | ################################################################################ |
---|
2 | #This software was developed by the University of Tennessee as part of the |
---|
3 | #Distributed Data Analysis of Neutron Scattering Experiments (DANSE) |
---|
4 | #project funded by the US National Science Foundation. |
---|
5 | # |
---|
6 | #See the license text in license.txt |
---|
7 | # |
---|
8 | #copyright 2009, University of Tennessee |
---|
9 | ################################################################################ |
---|
10 | import copy |
---|
11 | from sans.models.qsmearing import smear_selection |
---|
12 | |
---|
13 | |
---|
14 | class FitProblemComponent(object): |
---|
15 | """ |
---|
16 | Inferface containing information to store data, model, range of data, etc... |
---|
17 | and retreive this information. This is an inferface |
---|
18 | for a fitProblem i.e relationship between data and model. |
---|
19 | """ |
---|
20 | def enable_smearing(self, flag=False): |
---|
21 | """ |
---|
22 | :param flag: bool.When flag is 1 get the computer smear value. When |
---|
23 | flag is 0 ingore smear value. |
---|
24 | """ |
---|
25 | def get_smearer(self): |
---|
26 | """ |
---|
27 | return smear object |
---|
28 | """ |
---|
29 | def save_model_name(self, name): |
---|
30 | """ |
---|
31 | """ |
---|
32 | def get_name(self): |
---|
33 | """ |
---|
34 | """ |
---|
35 | def set_model(self, model): |
---|
36 | """ |
---|
37 | associates each model with its new created name |
---|
38 | :param model: model selected |
---|
39 | :param name: name created for model |
---|
40 | """ |
---|
41 | def get_model(self): |
---|
42 | """ |
---|
43 | :return: saved model |
---|
44 | """ |
---|
45 | def set_residuals(self, residuals): |
---|
46 | """ |
---|
47 | save a copy of residual |
---|
48 | :param data: data selected |
---|
49 | """ |
---|
50 | def get_residuals(self): |
---|
51 | """ |
---|
52 | :return: residuals |
---|
53 | """ |
---|
54 | |
---|
55 | def set_theory_data(self, data): |
---|
56 | """ |
---|
57 | save a copy of the data select to fit |
---|
58 | :param data: data selected |
---|
59 | """ |
---|
60 | def get_theory_data(self): |
---|
61 | """ |
---|
62 | :return: list of data dList |
---|
63 | """ |
---|
64 | def set_fit_data(self, data): |
---|
65 | """ |
---|
66 | Store of list of data and create by create new fitproblem of each data |
---|
67 | id , if there was existing information about model, this information |
---|
68 | get copy to the new fitproblem |
---|
69 | :param data: list of data selected |
---|
70 | """ |
---|
71 | def get_fit_data(self): |
---|
72 | """ |
---|
73 | """ |
---|
74 | def set_model_param(self, name, value=None): |
---|
75 | """ |
---|
76 | Store the name and value of a parameter of this fitproblem's model |
---|
77 | :param name: name of the given parameter |
---|
78 | :param value: value of that parameter |
---|
79 | """ |
---|
80 | def set_param2fit(self, list): |
---|
81 | """ |
---|
82 | Store param names to fit (checked) |
---|
83 | :param list: list of the param names |
---|
84 | """ |
---|
85 | def get_param2fit(self): |
---|
86 | """ |
---|
87 | return the list param names to fit |
---|
88 | """ |
---|
89 | def get_model_param(self): |
---|
90 | """ |
---|
91 | return list of couple of parameter name and value |
---|
92 | """ |
---|
93 | def schedule_tofit(self, schedule=0): |
---|
94 | """ |
---|
95 | set schedule to true to decide if this fit must be performed |
---|
96 | """ |
---|
97 | def get_scheduled(self): |
---|
98 | """ |
---|
99 | return true or false if a problem as being schedule for fitting |
---|
100 | """ |
---|
101 | def set_range(self, qmin=None, qmax=None): |
---|
102 | """ |
---|
103 | set fitting range |
---|
104 | """ |
---|
105 | def get_range(self): |
---|
106 | """ |
---|
107 | :return: fitting range |
---|
108 | """ |
---|
109 | def set_weight(self, flag=None): |
---|
110 | """ |
---|
111 | set fitting range |
---|
112 | """ |
---|
113 | def get_weight(self): |
---|
114 | """ |
---|
115 | get fitting weight |
---|
116 | """ |
---|
117 | def clear_model_param(self): |
---|
118 | """ |
---|
119 | clear constraint info |
---|
120 | """ |
---|
121 | def set_fit_tab_caption(self, caption): |
---|
122 | """ |
---|
123 | store the caption of the page associated with object |
---|
124 | """ |
---|
125 | def get_fit_tab_caption(self): |
---|
126 | """ |
---|
127 | Return the caption of the page associated with object |
---|
128 | """ |
---|
129 | def set_graph_id(self, id): |
---|
130 | """ |
---|
131 | Set graph id (from data_group_id at the time the graph produced) |
---|
132 | """ |
---|
133 | def get_graph_id(self): |
---|
134 | """ |
---|
135 | Get graph_id |
---|
136 | """ |
---|
137 | |
---|
138 | class FitProblemDictionary(FitProblemComponent, dict): |
---|
139 | """ |
---|
140 | This module implements a dictionary of fitproblem objects |
---|
141 | """ |
---|
142 | def __init__(self): |
---|
143 | FitProblemComponent.__init__(self) |
---|
144 | dict.__init__(self) |
---|
145 | ## the current model |
---|
146 | self.model = None |
---|
147 | ## if 1 this fit problem will be selected to fit , if 0 |
---|
148 | ## it will not be selected for fit |
---|
149 | self.schedule = 0 |
---|
150 | ##list containing parameter name and value |
---|
151 | self.list_param = [] |
---|
152 | ## fitting range |
---|
153 | self.qmin = None |
---|
154 | self.qmax = None |
---|
155 | self.graph_id = None |
---|
156 | self._smear_on = False |
---|
157 | self.scheduled = 0 |
---|
158 | self.fit_tab_caption = '' |
---|
159 | self.nbr_residuals_computed = 0 |
---|
160 | self.batch_inputs = {} |
---|
161 | self.batch_outputs = {} |
---|
162 | |
---|
163 | |
---|
164 | def enable_smearing(self, flag=False, fid=None): |
---|
165 | """ |
---|
166 | :param flag: bool.When flag is 1 get the computer smear value. When |
---|
167 | flag is 0 ingore smear value. |
---|
168 | """ |
---|
169 | self._smear_on = flag |
---|
170 | if fid is None: |
---|
171 | for value in self.itervalues(): |
---|
172 | value.enable_smearing(flag) |
---|
173 | else: |
---|
174 | if fid in self.iterkeys(): |
---|
175 | self[fid].enable_smearing(flag) |
---|
176 | |
---|
177 | def set_smearer(self, smearer, fid=None): |
---|
178 | """ |
---|
179 | save reference of smear object on fitdata |
---|
180 | :param smear: smear object from DataLoader |
---|
181 | """ |
---|
182 | if fid is None: |
---|
183 | for value in self.itervalues(): |
---|
184 | value.set_smearer(smearer) |
---|
185 | else: |
---|
186 | if fid in self.iterkeys(): |
---|
187 | self[fid].set_smearer(smearer) |
---|
188 | |
---|
189 | def get_smearer(self, fid=None): |
---|
190 | """ |
---|
191 | return smear object |
---|
192 | """ |
---|
193 | if fid in self.iterkeys(): |
---|
194 | return self[fid].get_smearer() |
---|
195 | |
---|
196 | |
---|
197 | def save_model_name(self, name, fid=None): |
---|
198 | """ |
---|
199 | """ |
---|
200 | if fid is None: |
---|
201 | for value in self.itervalues(): |
---|
202 | value.save_model_name(name) |
---|
203 | else: |
---|
204 | if fid in self.iterkeys(): |
---|
205 | self[fid].save_model_name(name) |
---|
206 | |
---|
207 | def get_name(self, fid=None): |
---|
208 | """ |
---|
209 | """ |
---|
210 | result = [] |
---|
211 | if fid is None: |
---|
212 | for value in self.itervalues(): |
---|
213 | result.append(value.get_name()) |
---|
214 | else: |
---|
215 | if fid in self.iterkeys(): |
---|
216 | result.append(self[fid].get_name()) |
---|
217 | return result |
---|
218 | |
---|
219 | def set_model(self, model, fid=None): |
---|
220 | """ |
---|
221 | associates each model with its new created name |
---|
222 | :param model: model selected |
---|
223 | :param name: name created for model |
---|
224 | """ |
---|
225 | self.model = model |
---|
226 | if fid is None: |
---|
227 | for value in self.itervalues(): |
---|
228 | value.set_model(self.model) |
---|
229 | else: |
---|
230 | if fid in self.iterkeys(): |
---|
231 | self[fid].set_model(self.model) |
---|
232 | |
---|
233 | def get_model(self, fid): |
---|
234 | """ |
---|
235 | :return: saved model |
---|
236 | """ |
---|
237 | if fid in self.iterkeys(): |
---|
238 | return self[fid].get_model() |
---|
239 | |
---|
240 | def set_fit_tab_caption(self, caption): |
---|
241 | """ |
---|
242 | store the caption of the page associated with object |
---|
243 | """ |
---|
244 | self.fit_tab_caption = caption |
---|
245 | |
---|
246 | def get_fit_tab_caption(self): |
---|
247 | """ |
---|
248 | Return the caption of the page associated with object |
---|
249 | """ |
---|
250 | return self.fit_tab_caption |
---|
251 | |
---|
252 | def set_residuals(self, residuals, fid): |
---|
253 | """ |
---|
254 | save a copy of residual |
---|
255 | :param data: data selected |
---|
256 | """ |
---|
257 | if fid in self.iterkeys(): |
---|
258 | self[fid].set_residuals(residuals) |
---|
259 | |
---|
260 | def get_residuals(self, fid): |
---|
261 | """ |
---|
262 | :return: residuals |
---|
263 | """ |
---|
264 | if fid in self.iterkeys(): |
---|
265 | return self[fid].get_residuals() |
---|
266 | |
---|
267 | def set_theory_data(self, fid, data=None): |
---|
268 | """ |
---|
269 | save a copy of the data select to fit |
---|
270 | :param data: data selected |
---|
271 | """ |
---|
272 | if fid in self.iterkeys(): |
---|
273 | self[fid].set_theory_data(data) |
---|
274 | |
---|
275 | def get_theory_data(self, fid): |
---|
276 | """ |
---|
277 | :return: list of data dList |
---|
278 | """ |
---|
279 | if fid in self.iterkeys(): |
---|
280 | return self[fid].get_theory_data() |
---|
281 | |
---|
282 | def add_data(self, data): |
---|
283 | """ |
---|
284 | Add data to the current dictionary of fitproblem. if data id does not |
---|
285 | exist create a new fit problem. |
---|
286 | :note: only data changes in the fit problem |
---|
287 | """ |
---|
288 | if data.id not in self.iterkeys(): |
---|
289 | self[data.id] = FitProblem() |
---|
290 | self[data.id].set_fit_data(data) |
---|
291 | |
---|
292 | def set_fit_data(self, data): |
---|
293 | """ |
---|
294 | save a copy of the data select to fit |
---|
295 | :param data: data selected |
---|
296 | |
---|
297 | """ |
---|
298 | self.clear() |
---|
299 | if data is None: |
---|
300 | data = [] |
---|
301 | for d in data: |
---|
302 | if (d is not None): |
---|
303 | if (d.id not in self.iterkeys()): |
---|
304 | self[d.id] = FitProblem() |
---|
305 | self[d.id].set_fit_data(d) |
---|
306 | self[d.id].set_model(self.model) |
---|
307 | self[d.id].set_range(self.qmin, self.qmax) |
---|
308 | #self[d.id].set_smearer(self[d.id].get_smearer()) |
---|
309 | def get_fit_data(self, fid): |
---|
310 | """ |
---|
311 | |
---|
312 | return data for the given fitproblem id |
---|
313 | :param fid: is key representing a fitproblem. usually extract from data |
---|
314 | id |
---|
315 | """ |
---|
316 | if fid in self.iterkeys(): |
---|
317 | return self[fid].get_fit_data() |
---|
318 | |
---|
319 | def set_model_param(self, name, value=None, fid=None): |
---|
320 | """ |
---|
321 | Store the name and value of a parameter of this fitproblem's model |
---|
322 | :param name: name of the given parameter |
---|
323 | :param value: value of that parameter |
---|
324 | """ |
---|
325 | if fid is None: |
---|
326 | for value in self.itervalues(): |
---|
327 | value.set_model_param(name, value) |
---|
328 | else: |
---|
329 | if fid in self.iterkeys(): |
---|
330 | self[fid].set_model_param(name, value) |
---|
331 | |
---|
332 | def get_model_param(self, fid): |
---|
333 | """ |
---|
334 | return list of couple of parameter name and value |
---|
335 | """ |
---|
336 | if fid in self.iterkeys(): |
---|
337 | return self[fid].get_model_param() |
---|
338 | |
---|
339 | def set_param2fit(self, list): |
---|
340 | """ |
---|
341 | Store param names to fit (checked) |
---|
342 | :param list: list of the param names |
---|
343 | """ |
---|
344 | self.list_param2fit = list |
---|
345 | |
---|
346 | def get_param2fit(self): |
---|
347 | """ |
---|
348 | return the list param names to fit |
---|
349 | """ |
---|
350 | return self.list_param2fit |
---|
351 | |
---|
352 | def schedule_tofit(self, schedule=0): |
---|
353 | """ |
---|
354 | set schedule to true to decide if this fit must be performed |
---|
355 | """ |
---|
356 | self.scheduled = schedule |
---|
357 | for value in self.itervalues(): |
---|
358 | value.schedule_tofit(schedule) |
---|
359 | |
---|
360 | def get_scheduled(self): |
---|
361 | """ |
---|
362 | return true or false if a problem as being schedule for fitting |
---|
363 | """ |
---|
364 | return self.scheduled |
---|
365 | |
---|
366 | def set_range(self, qmin=None, qmax=None, fid=None): |
---|
367 | """ |
---|
368 | set fitting range |
---|
369 | """ |
---|
370 | self.qmin = qmin |
---|
371 | self.qmax = qmax |
---|
372 | if fid is None: |
---|
373 | for value in self.itervalues(): |
---|
374 | value.set_range(self.qmin, self.qmax) |
---|
375 | else: |
---|
376 | if fid in self.iterkeys(): |
---|
377 | self[fid].value.set_range(self.qmin, self.qmax) |
---|
378 | |
---|
379 | def get_range(self, fid): |
---|
380 | """ |
---|
381 | :return: fitting range |
---|
382 | """ |
---|
383 | if fid in self.iterkeys(): |
---|
384 | return self[fid].get_range() |
---|
385 | |
---|
386 | def set_weight(self, is2d, flag=None, fid=None): |
---|
387 | """ |
---|
388 | fit weight |
---|
389 | """ |
---|
390 | if fid is None: |
---|
391 | for value in self.itervalues(): |
---|
392 | value.set_weight(flag=flag, is2d=is2d) |
---|
393 | else: |
---|
394 | if fid in self.iterkeys(): |
---|
395 | self[fid].set_weight(flag=flag, is2d=is2d) |
---|
396 | |
---|
397 | def get_weight(self, fid=None): |
---|
398 | """ |
---|
399 | return fit weight |
---|
400 | """ |
---|
401 | if fid in self.iterkeys(): |
---|
402 | return self[fid].get_weight() |
---|
403 | |
---|
404 | def clear_model_param(self, fid=None): |
---|
405 | """ |
---|
406 | clear constraint info |
---|
407 | """ |
---|
408 | if fid is None: |
---|
409 | for value in self.itervalues(): |
---|
410 | value.clear_model_param() |
---|
411 | else: |
---|
412 | if fid in self.iterkeys(): |
---|
413 | self[fid].clear_model_param() |
---|
414 | |
---|
415 | def get_fit_problem(self): |
---|
416 | """ |
---|
417 | return fitproblem contained in this dictionary |
---|
418 | """ |
---|
419 | return self.itervalues() |
---|
420 | |
---|
421 | def set_result(self, batch_inputs, batch_outputs): |
---|
422 | """ |
---|
423 | set a list of result |
---|
424 | """ |
---|
425 | self.batch_inputs = batch_inputs |
---|
426 | self.batch_outputs = batch_outputs |
---|
427 | |
---|
428 | def get_result(self): |
---|
429 | """ |
---|
430 | get result |
---|
431 | """ |
---|
432 | return self.batch_inputs, self.batch_outputs |
---|
433 | |
---|
434 | def set_graph_id(self, id): |
---|
435 | """ |
---|
436 | Set graph id (from data_group_id at the time the graph produced) |
---|
437 | """ |
---|
438 | self.graph_id = id |
---|
439 | |
---|
440 | def get_graph_id(self): |
---|
441 | """ |
---|
442 | Get graph_id |
---|
443 | """ |
---|
444 | return self.graph_id |
---|
445 | |
---|
446 | |
---|
447 | class FitProblem(FitProblemComponent): |
---|
448 | """ |
---|
449 | FitProblem class allows to link a model with the new name created in _on_model, |
---|
450 | a name theory created with that model and the data fitted with the model. |
---|
451 | FitProblem is mostly used as value of the dictionary by fitting module. |
---|
452 | """ |
---|
453 | def __init__(self): |
---|
454 | FitProblemComponent.__init__(self) |
---|
455 | """ |
---|
456 | contains information about data and model to fit |
---|
457 | """ |
---|
458 | ## data used for fitting |
---|
459 | self.fit_data = None |
---|
460 | self.theory_data = None |
---|
461 | self.residuals = None |
---|
462 | # original data: should not be modified |
---|
463 | self.original_data = None |
---|
464 | ## the current model |
---|
465 | self.model = None |
---|
466 | ## if 1 this fit problem will be selected to fit , if 0 |
---|
467 | ## it will not be selected for fit |
---|
468 | self.schedule = 0 |
---|
469 | ##list containing parameter name and value |
---|
470 | self.list_param = [] |
---|
471 | ## smear object to smear or not data1D |
---|
472 | self.smearer_computed = False |
---|
473 | self.smearer_enable = False |
---|
474 | self.smearer_computer_value = None |
---|
475 | ## fitting range |
---|
476 | self.qmin = None |
---|
477 | self.qmax = None |
---|
478 | # fit weight |
---|
479 | self.weight = None |
---|
480 | |
---|
481 | |
---|
482 | def enable_smearing(self, flag=False): |
---|
483 | """ |
---|
484 | :param flag: bool.When flag is 1 get the computer smear value. When |
---|
485 | flag is 0 ingore smear value. |
---|
486 | """ |
---|
487 | self.smearer_enable = flag |
---|
488 | |
---|
489 | def set_smearer(self, smearer): |
---|
490 | """ |
---|
491 | save reference of smear object on fitdata |
---|
492 | |
---|
493 | :param smear: smear object from DataLoader |
---|
494 | |
---|
495 | """ |
---|
496 | self.smearer_computer_value = smearer |
---|
497 | |
---|
498 | def get_smearer(self): |
---|
499 | """ |
---|
500 | return smear object |
---|
501 | """ |
---|
502 | if not self.smearer_enable: |
---|
503 | return None |
---|
504 | if not self.smearer_computed: |
---|
505 | #smeari_selection should be call only once per fitproblem |
---|
506 | self.smearer_computer_value = smear_selection(self.fit_data, |
---|
507 | self.model) |
---|
508 | self.smearer_computed = True |
---|
509 | return self.smearer_computer_value |
---|
510 | |
---|
511 | def save_model_name(self, name): |
---|
512 | """ |
---|
513 | """ |
---|
514 | self.name_per_page= name |
---|
515 | |
---|
516 | def get_name(self): |
---|
517 | """ |
---|
518 | """ |
---|
519 | return self.name_per_page |
---|
520 | |
---|
521 | def set_model(self, model): |
---|
522 | """ |
---|
523 | associates each model with its new created name |
---|
524 | :param model: model selected |
---|
525 | :param name: name created for model |
---|
526 | """ |
---|
527 | self.model = model |
---|
528 | self.smearer_computer_value = smear_selection(self.fit_data, |
---|
529 | self.model) |
---|
530 | self.smearer_computed = True |
---|
531 | |
---|
532 | def get_model(self): |
---|
533 | """ |
---|
534 | :return: saved model |
---|
535 | """ |
---|
536 | return self.model |
---|
537 | |
---|
538 | def set_residuals(self, residuals): |
---|
539 | """ |
---|
540 | save a copy of residual |
---|
541 | :param data: data selected |
---|
542 | """ |
---|
543 | self.residuals = residuals |
---|
544 | |
---|
545 | def get_residuals(self): |
---|
546 | """ |
---|
547 | :return: residuals |
---|
548 | """ |
---|
549 | return self.residuals |
---|
550 | |
---|
551 | def set_theory_data(self, data): |
---|
552 | """ |
---|
553 | save a copy of the data select to fit |
---|
554 | |
---|
555 | :param data: data selected |
---|
556 | |
---|
557 | """ |
---|
558 | self.theory_data = copy.deepcopy(data) |
---|
559 | |
---|
560 | |
---|
561 | |
---|
562 | def get_theory_data(self): |
---|
563 | """ |
---|
564 | :return: theory generated with the current model and data of this class |
---|
565 | """ |
---|
566 | return self.theory_data |
---|
567 | |
---|
568 | def set_fit_data(self, data): |
---|
569 | """ |
---|
570 | Store data associated with this class |
---|
571 | :param data: list of data selected |
---|
572 | """ |
---|
573 | self.original_data = None |
---|
574 | self.fit_data = None |
---|
575 | # original data: should not be modified |
---|
576 | self.original_data = copy.deepcopy(data) |
---|
577 | # fit data: used for fit and can be modified for convenience |
---|
578 | self.fit_data = copy.deepcopy(data) |
---|
579 | self.smearer_computer_value = smear_selection(self.fit_data, |
---|
580 | self.model) |
---|
581 | self.smearer_computed = True |
---|
582 | |
---|
583 | def get_fit_data(self): |
---|
584 | """ |
---|
585 | :return: data associate with this class |
---|
586 | """ |
---|
587 | return self.fit_data |
---|
588 | |
---|
589 | def set_weight(self, is2d, flag=None): |
---|
590 | """ |
---|
591 | Received flag and compute error on data. |
---|
592 | :param flag: flag to transform error of data. |
---|
593 | :param is2d: flag to distinguish 1D to 2D Data |
---|
594 | """ |
---|
595 | from .utils import get_weight |
---|
596 | # send original data for weighting |
---|
597 | self.weight = get_weight(data=self.original_data, is2d=is2d, flag=flag) |
---|
598 | if is2d: |
---|
599 | self.fit_data.err_data = self.weight |
---|
600 | else: |
---|
601 | self.fit_data.dy = self.weight |
---|
602 | |
---|
603 | def get_weight(self): |
---|
604 | """ |
---|
605 | returns weight array |
---|
606 | """ |
---|
607 | return self.weight |
---|
608 | |
---|
609 | def set_param2fit(self, list): |
---|
610 | """ |
---|
611 | Store param names to fit (checked) |
---|
612 | :param list: list of the param names |
---|
613 | """ |
---|
614 | self.list_param2fit = list |
---|
615 | |
---|
616 | def get_param2fit(self): |
---|
617 | """ |
---|
618 | return the list param names to fit |
---|
619 | """ |
---|
620 | return self.list_param2fit |
---|
621 | |
---|
622 | def set_model_param(self,name,value=None): |
---|
623 | """ |
---|
624 | Store the name and value of a parameter of this fitproblem's model |
---|
625 | :param name: name of the given parameter |
---|
626 | :param value: value of that parameter |
---|
627 | """ |
---|
628 | self.list_param.append([name,value]) |
---|
629 | |
---|
630 | def get_model_param(self): |
---|
631 | """ |
---|
632 | return list of couple of parameter name and value |
---|
633 | """ |
---|
634 | return self.list_param |
---|
635 | |
---|
636 | def schedule_tofit(self, schedule=0): |
---|
637 | """ |
---|
638 | set schedule to true to decide if this fit must be performed |
---|
639 | """ |
---|
640 | self.schedule = schedule |
---|
641 | |
---|
642 | def get_scheduled(self): |
---|
643 | """ |
---|
644 | return true or false if a problem as being schedule for fitting |
---|
645 | """ |
---|
646 | return self.schedule |
---|
647 | |
---|
648 | def set_range(self, qmin=None, qmax=None): |
---|
649 | """ |
---|
650 | set fitting range |
---|
651 | :param qmin: minimum value to consider for the fit range |
---|
652 | :param qmax: maximum value to consider for the fit range |
---|
653 | """ |
---|
654 | self.qmin = qmin |
---|
655 | self.qmax = qmax |
---|
656 | |
---|
657 | def get_range(self): |
---|
658 | """ |
---|
659 | :return: fitting range |
---|
660 | |
---|
661 | """ |
---|
662 | return self.qmin, self.qmax |
---|
663 | |
---|
664 | def clear_model_param(self): |
---|
665 | """ |
---|
666 | clear constraint info |
---|
667 | """ |
---|
668 | self.list_param = [] |
---|
669 | |
---|
670 | def set_fit_tab_caption(self, caption): |
---|
671 | """ |
---|
672 | """ |
---|
673 | self.fit_tab_caption = str(caption) |
---|
674 | |
---|
675 | def get_fit_tab_caption(self): |
---|
676 | """ |
---|
677 | """ |
---|
678 | return self.fit_tab_caption |
---|
679 | |
---|
680 | def set_graph_id(self, id): |
---|
681 | """ |
---|
682 | Set graph id (from data_group_id at the time the graph produced) |
---|
683 | """ |
---|
684 | self.graph_id = id |
---|
685 | |
---|
686 | def get_graph_id(self): |
---|
687 | """ |
---|
688 | Get graph_id |
---|
689 | """ |
---|
690 | return self.graph_id |
---|
691 | |
---|