def set(self, param_name, value, index=None): """ Phase extending RietveldClass.set() method Arguments: param_name -- string, parameter name value -- instance, value to set """ rvalue = RietveldClass.set(self, param_name, value, index=index) if param_name == "Jvi": self.set("More", True) elif param_name == "Jdi": self.set("More", True) elif param_name == "Hel": self.set("More", True) elif param_name == "Sol": self.set("More", True) elif param_name == "Mom": self.set("More", True) elif param_name == "Ter": self.set("More", True) return rvalue
def set(self, param_name, value, index=None): """ function: set value to parameter 'param' param_name: parameter name, can be (1) parameter name (2) subclass name value : (1) corresponding python build-in type (2) an object reference index: for the location in ObjectListDict/ParamListDict """ rvalue = RietveldClass.set(self, param_name, value, index) if param_name == "Nba": nba = self.get(param_name) background = None if nba == 0: background = BackgroundPolynomial(self) background.set("Order", 6) elif nba == 1: background = BackgroundPolynomial(self) background.set("Order", 4) elif nba == -1: background = BackgroundDebye(self) elif nba == -2: background = BackgroundFourierwindow(self) elif nba == -3: background = BackgroundPolynomial(self) background.set("Order", 12) elif nba == -4: background = BackgroundPolynomial(self) background.set("Order", 12) elif nba == 2: background = BackgroundUserDefinedLinear(self) elif nba == -5: background = BackgroundUserDefinedCubic(self) else: errmsg = "Nba = %-10s is not supported" % (nba) raise RietError, errmsg if background is not None: self.set("Background", background) else: pass return rvalue