Last change
on this file since 6c7ebb88 was
09e0c32,
checked in by Piotr Rozyczko <piotr.rozyczko@…>, 6 years ago
|
Added tooltip on COnstraints table.
Added "validate" parameter to Constraint, allowing for looser validation
of complex, multi-fitpage setups.
|
-
Property mode set to
100644
|
File size:
1.9 KB
|
Rev | Line | |
---|
[eae226b] | 1 | class Constraint(object): |
---|
| 2 | """ |
---|
| 3 | Internal representation of a single parameter constraint |
---|
[14ec91c5] | 4 | Currently just a data structure, might get expaned with more functionality, |
---|
| 5 | hence made into a class. |
---|
[eae226b] | 6 | """ |
---|
[ecc5d043] | 7 | def __init__(self, parent=None, param=None, value=0.0, |
---|
| 8 | min=None, max=None, func=None, value_ex=None, |
---|
| 9 | operator="="): |
---|
[eae226b] | 10 | self._value = value |
---|
| 11 | self._param = param |
---|
[baeac95] | 12 | self._value_ex = value_ex |
---|
[eae226b] | 13 | self._func = func |
---|
| 14 | self._min = min |
---|
| 15 | self._max = max |
---|
[ecc5d043] | 16 | self._operator = operator |
---|
[09e0c32] | 17 | self.validate = True |
---|
| 18 | self.active = True |
---|
[eae226b] | 19 | |
---|
| 20 | @property |
---|
| 21 | def value(self): |
---|
[baeac95] | 22 | # value/parameter to fit to (e.g. 1.0 or sld) |
---|
[eae226b] | 23 | return self._value |
---|
| 24 | |
---|
| 25 | @value.setter |
---|
| 26 | def value(self, val): |
---|
| 27 | self._value = val |
---|
| 28 | |
---|
| 29 | @property |
---|
[baeac95] | 30 | def value_ex(self): |
---|
| 31 | # full parameter name to fit to (e.g. M1.sld) |
---|
| 32 | return self._value_ex |
---|
| 33 | |
---|
| 34 | @value_ex.setter |
---|
| 35 | def value_ex(self, val): |
---|
| 36 | self._value_ex = val |
---|
| 37 | |
---|
| 38 | @property |
---|
[eae226b] | 39 | def param(self): |
---|
[baeac95] | 40 | # parameter which is being fitted |
---|
[eae226b] | 41 | return self._param |
---|
| 42 | |
---|
| 43 | @param.setter |
---|
| 44 | def param(self, val): |
---|
| 45 | self._param = val |
---|
| 46 | |
---|
| 47 | @property |
---|
| 48 | def func(self): |
---|
[baeac95] | 49 | # Function to be used for constraint |
---|
| 50 | # e.g. sqrt(M1.sld+1.0) |
---|
[eae226b] | 51 | return self._func |
---|
| 52 | |
---|
| 53 | @func.setter |
---|
| 54 | def func(self, val): |
---|
| 55 | self._func = val |
---|
| 56 | |
---|
| 57 | @property |
---|
| 58 | def min(self): |
---|
[baeac95] | 59 | # min param value for single value constraints |
---|
[eae226b] | 60 | return self._min |
---|
| 61 | |
---|
| 62 | @min.setter |
---|
| 63 | def min(self, val): |
---|
| 64 | self._min = val |
---|
| 65 | |
---|
| 66 | @property |
---|
| 67 | def max(self): |
---|
[baeac95] | 68 | # max param value for single value constraints |
---|
[eae226b] | 69 | return self._max |
---|
| 70 | |
---|
| 71 | @max.setter |
---|
| 72 | def max(self, val): |
---|
| 73 | self._max = val |
---|
| 74 | |
---|
[ecc5d043] | 75 | @property |
---|
| 76 | def operator(self): |
---|
| 77 | # operator to use for constraint |
---|
| 78 | return self._operator |
---|
| 79 | |
---|
| 80 | @operator.setter |
---|
| 81 | def operator(self, val): |
---|
| 82 | self._operator = val |
---|
| 83 | |
---|
Note: See
TracBrowser
for help on using the repository browser.