Skip to content

Commit 0adb573

Browse files
committed
deprecate SimpleRecipe.loadParsedData
1 parent dea5482 commit 0adb573

1 file changed

Lines changed: 24 additions & 2 deletions

File tree

src/diffpy/srfit/fitbase/simplerecipe.py

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@
1818
from diffpy.srfit.fitbase.fitrecipe import FitRecipe
1919
from diffpy.srfit.fitbase.fitresults import FitResults
2020
from diffpy.srfit.fitbase.profile import Profile
21+
from diffpy.utils._deprecator import build_deprecation_message, deprecated
22+
23+
base = "diffpy.srfit.fitbase.simplerecipe.SimpleRecipe"
24+
removal_version = "4.0.0"
25+
26+
loadParsedData_dep_msg = build_deprecation_message(
27+
base,
28+
"loadParsedData",
29+
"load_parsed_data",
30+
removal_version,
31+
)
2132

2233

2334
class SimpleRecipe(FitRecipe):
@@ -109,12 +120,23 @@ def __init__(self, name="fit", conclass=FitContribution):
109120
return
110121

111122
# Profile methods
112-
def loadParsedData(self, parser):
123+
def load_parsed_data(self, parser):
113124
"""Load parsed data from a ProfileParser.
114125
115126
This sets the xobs, yobs, dyobs arrays as well as the metadata.
116127
"""
117-
return self.profile.loadParsedData(parser)
128+
return self.profile.load_parsed_data(parser)
129+
130+
@deprecated(loadParsedData_dep_msg)
131+
def loadParsedData(self, parser):
132+
"""This function has been deprecated and will be removed in version
133+
4.0.0.
134+
135+
Please use
136+
diffpy.srfit.fitbase.simplerecipe.SimpleRecipe.load_parsed_data
137+
instead.
138+
"""
139+
return self.load_parsed_data(parser)
118140

119141
def setObservedProfile(self, xobs, yobs, dyobs=None):
120142
"""Set the observed profile.

0 commit comments

Comments
 (0)