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+
73+ getresidualequation_dep_msg = build_deprecation_message (
74+ base ,
75+ "getResidualEquation" ,
76+ "get_residual_equation" ,
77+ removal_version ,
78+ )
79+
6680
6781class FitContribution (ParameterSet ):
6882 """FitContribution class.
@@ -186,7 +200,7 @@ def set_profile(self, profile, xname=None, yname=None, dyname=None):
186200
187201 # If we have _eq, but not _reseq, set the residual
188202 if self ._eq is not None and self ._reseq is None :
189- self .setResidualEquation ("chiv" )
203+ self .set_residual_equation ("chiv" )
190204
191205 return
192206
@@ -262,7 +276,7 @@ def set_equation(self, eqstr, ns={}):
262276
263277 This sets the equation that will be used when generating the residual
264278 for this FitContribution. The equation will be usable within
265- setResidualEquation as "eq", and it takes no arguments.
279+ set_residual_equation as "eq", and it takes no arguments.
266280
267281 Attributes
268282 ----------
@@ -296,7 +310,7 @@ def set_equation(self, eqstr, ns={}):
296310
297311 # Set the residual if we need to
298312 if self .profile is not None and self ._reseq is None :
299- self .setResidualEquation ("chiv" )
313+ self .set_residual_equation ("chiv" )
300314
301315 return
302316
@@ -334,7 +348,7 @@ def getEquation(self):
334348 """
335349 return self .get_equation ()
336350
337- def setResidualEquation (self , eqstr ):
351+ def set_residual_equation (self , eqstr ):
338352 """Set the residual equation for the FitContribution.
339353
340354 Attributes
@@ -378,7 +392,19 @@ def setResidualEquation(self, eqstr):
378392
379393 return
380394
381- def getResidualEquation (self ):
395+ @deprecated (setresidualequation_dep_msg )
396+ def setResidualEquation (self , eqstr ):
397+ """This function has been deprecated and will be removed in version
398+ 4.0.0.
399+
400+ Please use
401+ diffpy.srfit.fitbase.FitContribution.set_residual_equation
402+ instead.
403+ """
404+ self .set_residual_equation (eqstr )
405+ return
406+
407+ def get_residual_equation (self ):
382408 """Get math expression string for the active residual equation.
383409
384410 Return normalized math formula or an empty string if residual
@@ -391,6 +417,18 @@ def getResidualEquation(self):
391417 rv = getExpression (self ._reseq , eqskip = "eq$" )
392418 return rv
393419
420+ @deprecated (getresidualequation_dep_msg )
421+ def getResidualEquation (self ):
422+ """This function has been deprecated and will be removed in version
423+ 4.0.0.
424+
425+ Please use
426+ diffpy.srfit.fitbase.FitContribution.get_residual_equation
427+ instead.
428+ """
429+
430+ return self .get_residual_equation ()
431+
394432 def residual (self ):
395433 """Calculate the residual for this fitcontribution.
396434
@@ -402,7 +440,7 @@ def residual(self):
402440 chiv = (eq() - self.profile.y) / self.profile.dy
403441 The value that is optimized is dot(chiv, chiv).
404442
405- The residual equation can be changed with the setResidualEquation
443+ The residual equation can be changed with the set_residual_equation
406444 method.
407445 """
408446 # Assign the calculated profile
0 commit comments