diff --git a/news/deprecate-scatterFactoringTableByType.rst b/news/deprecate-scatterFactoringTableByType.rst new file mode 100644 index 00000000..f4ececad --- /dev/null +++ b/news/deprecate-scatterFactoringTableByType.rst @@ -0,0 +1,23 @@ +**Added:** + +* Added new api call for `scatteringfactortable` from `diffpy.srreal` + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* Removed the use of `scatterFactoringTableByType` method from `diffpy.srreal` + +**Fixed:** + +* + +**Security:** + +* diff --git a/requirements/conda.txt b/requirements/conda.txt index 2e2402dd..0cfe829d 100644 --- a/requirements/conda.txt +++ b/requirements/conda.txt @@ -4,3 +4,4 @@ scipy bg-mpl-stylesheets diffpy.utils diffpy.structure +diffpy.srreal diff --git a/requirements/pip.txt b/requirements/pip.txt index 6a05210c..7ce0faa2 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -4,3 +4,4 @@ scipy bg-mpl-stylesheets diffpy.utils diffpy.structure +diffpy.srreal diff --git a/src/diffpy/srfit/pdf/basepdfgenerator.py b/src/diffpy/srfit/pdf/basepdfgenerator.py index e91023e8..c588cb64 100644 --- a/src/diffpy/srfit/pdf/basepdfgenerator.py +++ b/src/diffpy/srfit/pdf/basepdfgenerator.py @@ -26,6 +26,7 @@ from diffpy.srfit.fitbase import ProfileGenerator from diffpy.srfit.fitbase.parameter import ParameterAdapter from diffpy.srfit.structure import struToParameterSet +from diffpy.srreal.srreal_ext import SFTNeutron # FIXME - Parameter creation will have to be smarter once deeper calculator # configuration is enabled. @@ -190,7 +191,8 @@ def setScatteringType(self, stype="X"): Raises ValueError for unknown scattering type. """ - self._calc.setScatteringFactorTableByType(stype) + self._calc.scatteringfactortable = SFTNeutron() + self._calc.scatteringfactortable.createByType(stype) # update the meta dictionary only if there was no exception self.meta["stype"] = self.getScatteringType() return diff --git a/tests/test_pdf.py b/tests/test_pdf.py index dbb9799f..aee79bee 100644 --- a/tests/test_pdf.py +++ b/tests/test_pdf.py @@ -24,6 +24,7 @@ from diffpy.srfit.exceptions import SrFitError from diffpy.srfit.pdf import PDFContribution, PDFGenerator, PDFParser +from diffpy.srreal.srreal_ext import SFTNeutron # ---------------------------------------------------------------------------- @@ -186,7 +187,8 @@ def testGenerator(diffpy_srreal_available, datafile): calc.rmin = r[0] calc.rmax = r[-1] + 0.5 * calc.rstep calc.qmax = qmax - calc.setScatteringFactorTableByType("N") + calc.scatteringfactortable = SFTNeutron() + calc.scatteringfactortable.createByType("N") calc.eval(stru) yref = calc.pdf