Skip to content

Commit 35ada98

Browse files
committed
boundRange --> bound_range
1 parent 160519e commit 35ada98

1 file changed

Lines changed: 18 additions & 4 deletions

File tree

src/diffpy/srfit/fitbase/parameter.py

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@
4646
parameter_base, "setConst", "set_constant", removal_version
4747
)
4848

49+
boundRange_dep_msg = build_deprecation_message(
50+
parameter_base, "boundRange", "bound_range", removal_version
51+
)
52+
4953

5054
class Parameter(_parameter_interface, Argument, Validatable):
5155
"""Parameter class.
@@ -156,7 +160,7 @@ def setConst(self, const=True, value=None):
156160
self.set_constant(const, value)
157161
return self
158162

159-
def boundRange(self, lower_bound=None, upper_bound=None):
163+
def bound_range(self, lower_bound=None, upper_bound=None):
160164
"""Set lower and upper bound of the Parameter.
161165
162166
Parameters
@@ -177,6 +181,16 @@ def boundRange(self, lower_bound=None, upper_bound=None):
177181
self.bounds[1] = upper_bound
178182
return self
179183

184+
@deprecated(boundRange_dep_msg)
185+
def boundRange(self, lower_bound=None, upper_bound=None):
186+
"""This function has been deprecated and will be removed in
187+
version 4.0.0.
188+
189+
Please use diffpy.srfit.fitbase.Parameter.bound_range instead.
190+
"""
191+
self.bound_range(lower_bound, upper_bound)
192+
return self
193+
180194
def boundWindow(self, lr=0, ur=None):
181195
"""Create bounds centered on the current value of the Parameter.
182196
@@ -296,9 +310,9 @@ def getValue(self):
296310
def set_constant(self, const=True, value=None):
297311
return self.par.set_constant(const, value)
298312

299-
@wraps(Parameter.boundRange)
300-
def boundRange(self, lower_bound=None, upper_bound=None):
301-
return self.par.boundRange(lower_bound, upper_bound)
313+
@wraps(Parameter.bound_range)
314+
def bound_range(self, lower_bound=None, upper_bound=None):
315+
return self.par.bound_range(lower_bound, upper_bound)
302316

303317
@wraps(Parameter.boundWindow)
304318
def boundWindow(self, lr=0, ur=None):

0 commit comments

Comments
 (0)