source: sasview/src/sas/qtgui/Perspectives/Fitting/Constraint.py @ baeac95

ESS_GUIESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalc
Last change on this file since baeac95 was baeac95, checked in by Piotr Rozyczko <piotr.rozyczko@…>, 5 years ago

Added Edit to single page constraint SASVIEW-1043

  • Property mode set to 100644
File size: 1.6 KB
Line 
1class Constraint(object):
2    """
3    Internal representation of a single parameter constraint
4    Currently just a data structure, might get expaned with more functionality,
5    hence made into a class.
6    """
7    def __init__(self, parent=None, param=None, value=0.0, min=None, max=None, func=None, value_ex=None):
8        self._value = value
9        self._param = param
10        self._value_ex = value_ex
11        self._func = func
12        self.active = True
13        self._min = min
14        self._max = max
15
16    @property
17    def value(self):
18        # value/parameter to fit to (e.g. 1.0 or sld)
19        return self._value
20
21    @value.setter
22    def value(self, val):
23        self._value = val
24
25    @property
26    def value_ex(self):
27        # full parameter name to fit to (e.g. M1.sld)
28        return self._value_ex
29
30    @value_ex.setter
31    def value_ex(self, val):
32        self._value_ex = val
33
34    @property
35    def param(self):
36        # parameter which is being fitted
37        return self._param
38
39    @param.setter
40    def param(self, val):
41        self._param = val
42
43    @property
44    def func(self):
45        # Function to be used for constraint
46        # e.g. sqrt(M1.sld+1.0)
47        return self._func
48
49    @func.setter
50    def func(self, val):
51        self._func = val
52
53    @property
54    def min(self):
55        # min param value for single value constraints
56        return self._min
57
58    @min.setter
59    def min(self, val):
60        self._min = val
61
62    @property
63    def max(self):
64        # max param value for single value constraints
65        return self._max
66
67    @max.setter
68    def max(self, val):
69        self._max = val
70
Note: See TracBrowser for help on using the repository browser.