diff --git a/news/replace-sft-by-type.rst b/news/replace-sft-by-type.rst new file mode 100644 index 00000000..5a195e47 --- /dev/null +++ b/news/replace-sft-by-type.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* Set the scattering factor table through the ``scatteringfactortable`` property in ``setScatteringType`` instead of the ``setScatteringFactorTableByType`` method deprecated in diffpy.srreal. + +**Security:** + +* diff --git a/src/diffpy/srfit/pdf/basepdfgenerator.py b/src/diffpy/srfit/pdf/basepdfgenerator.py index 6d546da8..d66f33f6 100644 --- a/src/diffpy/srfit/pdf/basepdfgenerator.py +++ b/src/diffpy/srfit/pdf/basepdfgenerator.py @@ -198,7 +198,7 @@ def setScatteringType(self, stype="X"): ValueError If stype is not a recognized scattering type. """ - self._calc.setScatteringFactorTableByType(stype) + self._calc.scatteringfactortable = stype # update the meta dictionary only if there was no exception self.meta["stype"] = self.getScatteringType() return diff --git a/tests/test_pdfgenerator.py b/tests/test_pdfgenerator.py index 4d915928..b1bd8ad7 100644 --- a/tests/test_pdfgenerator.py +++ b/tests/test_pdfgenerator.py @@ -68,7 +68,7 @@ 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 = "N" calc.eval(stru) yref = calc.pdf