6363 removal_version ,
6464)
6565
66+ setresidualequation_dep_msg = build_deprecation_message (
67+ base ,
68+ "setResidualEquation" ,
69+ "set_residual_equation" ,
70+ removal_version ,
71+ )
72+
6673
6774class FitContribution (ParameterSet ):
6875 """FitContribution class.
@@ -186,7 +193,7 @@ def set_profile(self, profile, xname=None, yname=None, dyname=None):
186193
187194 # If we have _eq, but not _reseq, set the residual
188195 if self ._eq is not None and self ._reseq is None :
189- self .setResidualEquation ("chiv" )
196+ self .set_residual_equation ("chiv" )
190197
191198 return
192199
@@ -262,7 +269,7 @@ def set_equation(self, eqstr, ns={}):
262269
263270 This sets the equation that will be used when generating the residual
264271 for this FitContribution. The equation will be usable within
265- setResidualEquation as "eq", and it takes no arguments.
272+ set_residual_equation as "eq", and it takes no arguments.
266273
267274 Attributes
268275 ----------
@@ -296,7 +303,7 @@ def set_equation(self, eqstr, ns={}):
296303
297304 # Set the residual if we need to
298305 if self .profile is not None and self ._reseq is None :
299- self .setResidualEquation ("chiv" )
306+ self .set_residual_equation ("chiv" )
300307
301308 return
302309
@@ -334,7 +341,7 @@ def getEquation(self):
334341 """
335342 return self .get_equation ()
336343
337- def setResidualEquation (self , eqstr ):
344+ def set_residual_equation (self , eqstr ):
338345 """Set the residual equation for the FitContribution.
339346
340347 Attributes
@@ -378,6 +385,18 @@ def setResidualEquation(self, eqstr):
378385
379386 return
380387
388+ @deprecated (setresidualequation_dep_msg )
389+ def setResidualEquation (self , eqstr ):
390+ """This function has been deprecated and will be removed in version
391+ 4.0.0.
392+
393+ Please use
394+ diffpy.srfit.fitbase.FitContribution.set_residual_equation
395+ instead.
396+ """
397+ self .set_residual_equation (eqstr )
398+ return
399+
381400 def getResidualEquation (self ):
382401 """Get math expression string for the active residual equation.
383402
@@ -402,7 +421,7 @@ def residual(self):
402421 chiv = (eq() - self.profile.y) / self.profile.dy
403422 The value that is optimized is dot(chiv, chiv).
404423
405- The residual equation can be changed with the setResidualEquation
424+ The residual equation can be changed with the set_residual_equation
406425 method.
407426 """
408427 # Assign the calculated profile
0 commit comments