From 3b0d217e88649311c85ba7a5f6af558732834387 Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Mon, 26 Oct 2026 17:22:31 -0400 Subject: [PATCH] fix: point the camelCase CF deprecations at the srfit 3.4.0 names in cmipdf lognormalSphericalCF, shellCF and shellCF2 were deprecated in 3.4.0 in favor of lognormal_spherical_particle and shell_particle. Their messages now named diffpy.cmipdf's lognormal_spherical_distribution and spherical_shell, which would make users who already moved to the 3.4.0 names rename again. diffpy.cmipdf adopts the 3.4.0 names instead, so the messages point there. news/pdf-dep.rst is corrected to match. Co-Authored-By: Claude Opus 5.5 --- news/cf-names-match-3.4.0.rst | 23 +++++++++++++++++++ news/pdf-dep.rst | 2 +- .../srfit/pdf/characteristicfunctions.py | 14 +++++------ tests/test_characteristicfunctions.py | 8 +++---- 4 files changed, 35 insertions(+), 12 deletions(-) create mode 100644 news/cf-names-match-3.4.0.rst diff --git a/news/cf-names-match-3.4.0.rst b/news/cf-names-match-3.4.0.rst new file mode 100644 index 00000000..2513327f --- /dev/null +++ b/news/cf-names-match-3.4.0.rst @@ -0,0 +1,23 @@ +**Added:** + +* No news added: The camelCase characteristic function deprecation messages are unreleased, so the pdf-dep entry is corrected instead. + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* diff --git a/news/pdf-dep.rst b/news/pdf-dep.rst index fee2b63b..87ac24ea 100644 --- a/news/pdf-dep.rst +++ b/news/pdf-dep.rst @@ -4,7 +4,7 @@ **Changed:** -* The deprecation messages of the camelCase characteristic functions (``sphericalCF``, ``shellCF`` and the others) now point to ``diffpy.cmipdf.characteristicfunctions`` instead of ``diffpy.srfit.pdf.characteristicfunctions``. ``lognormalSphericalCF`` now points to ``lognormal_spherical_distribution``, and ``shellCF`` and ``shellCF2`` now point to ``spherical_shell``. +* The deprecation messages of the camelCase characteristic functions (``sphericalCF``, ``shellCF`` and the others) now point to ``diffpy.cmipdf.characteristicfunctions`` instead of ``diffpy.srfit.pdf.characteristicfunctions``. ``lognormalSphericalCF``, ``shellCF`` and ``shellCF2`` point to the names srfit 3.4.0 gave them, ``lognormal_spherical_particle`` and ``shell_particle``. **Deprecated:** diff --git a/src/diffpy/srfit/pdf/characteristicfunctions.py b/src/diffpy/srfit/pdf/characteristicfunctions.py index fd028df7..efb0b9c4 100644 --- a/src/diffpy/srfit/pdf/characteristicfunctions.py +++ b/src/diffpy/srfit/pdf/characteristicfunctions.py @@ -97,7 +97,7 @@ def _build_dep_msg(old_name, new_name, signature_note=None): lognormalSphericalCF_dep_msg = _build_dep_msg( "lognormalSphericalCF", - "lognormal_spherical_distribution", + "lognormal_spherical_particle", "Additionally, the signature has changed. Please pass the parameters " "'psize' and 'psig' as 'particle_diameter' and " "'particle_diameter_sigma', respectively.", @@ -110,14 +110,14 @@ def _build_dep_msg(old_name, new_name, signature_note=None): "'sthick' as 'sheet_thickness'.", ) -shellCF_dep_msg = _build_dep_msg("shellCF", "spherical_shell") +shellCF_dep_msg = _build_dep_msg("shellCF", "shell_particle") shellCF2_dep_msg = _build_dep_msg( "shellCF2", - "spherical_shell", + "shell_particle", "Additionally, the parameterization has changed. 'shellCF2' took the " "central radius 'a' and the shell thickness 'delta', while " - "'spherical_shell' takes the inner radius. Please pass " + "'shell_particle' takes the inner radius. Please pass " "radius = a - delta / 2 and thickness = delta.", ) @@ -579,7 +579,7 @@ def lognormalSphericalCF(r, psize, psig): 4.0.0. Please use - diffpy.cmipdf.characteristicfunctions.lognormal_spherical_distribution + diffpy.cmipdf.characteristicfunctions.lognormal_spherical_particle instead. """ return lognormal_spherical_particle(r, psize, psig) @@ -601,7 +601,7 @@ def shellCF(r, radius, thickness): """This function has been deprecated and will be removed in version 4.0.0. - Please use diffpy.cmipdf.characteristicfunctions.spherical_shell + Please use diffpy.cmipdf.characteristicfunctions.shell_particle instead. """ return shell_particle(r, radius, thickness) @@ -612,7 +612,7 @@ def shellCF2(r, a, delta): """This function has been deprecated and will be removed in version 4.0.0. - Please use diffpy.cmipdf.characteristicfunctions.spherical_shell + Please use diffpy.cmipdf.characteristicfunctions.shell_particle instead. """ return shell_particle(r, a - delta / 2, delta) diff --git a/tests/test_characteristicfunctions.py b/tests/test_characteristicfunctions.py index ce7ef374..e31240fa 100644 --- a/tests/test_characteristicfunctions.py +++ b/tests/test_characteristicfunctions.py @@ -656,7 +656,7 @@ def test_non_physical_input_warns_only_once( ( "lognormalSphericalCF", "lognormal_spherical_particle", - "lognormal_spherical_distribution", + "lognormal_spherical_particle", "Additionally, the signature has changed. Please pass the " "parameters 'psize' and 'psig' as 'particle_diameter' and " "'particle_diameter_sigma', respectively.", @@ -679,7 +679,7 @@ def test_non_physical_input_warns_only_once( ( "shellCF", "shell_particle", - "spherical_shell", + "shell_particle", "", (numpy.array([0.0, 5.0, 12.5]), 10.0, 5.0), (numpy.array([0.0, 5.0, 12.5]), 10.0, 5.0), @@ -691,10 +691,10 @@ def test_non_physical_input_warns_only_once( ( "shellCF2", "shell_particle", - "spherical_shell", + "shell_particle", "Additionally, the parameterization has changed. 'shellCF2' took " "the central radius 'a' and the shell thickness 'delta', while " - "'spherical_shell' takes the inner radius. Please pass " + "'shell_particle' takes the inner radius. Please pass " "radius = a - delta / 2 and thickness = delta.", (numpy.array([0.0, 5.0, 12.5]), 12.5, 5.0), (numpy.array([0.0, 5.0, 12.5]), 10.0, 5.0),