Skip to content

Commit 2894e8a

Browse files
cadenmyers13claude
andauthored
fix: point the camelCase CF deprecations at the srfit 3.4.0 names in cmipdf (#238)
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 <noreply@anthropic.com>
1 parent 0183eaa commit 2894e8a

4 files changed

Lines changed: 35 additions & 12 deletions

File tree

‎news/cf-names-match-3.4.0.rst‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
**Added:**
2+
3+
* No news added: The camelCase characteristic function deprecation messages are unreleased, so the pdf-dep entry is corrected instead.
4+
5+
**Changed:**
6+
7+
* <news item>
8+
9+
**Deprecated:**
10+
11+
* <news item>
12+
13+
**Removed:**
14+
15+
* <news item>
16+
17+
**Fixed:**
18+
19+
* <news item>
20+
21+
**Security:**
22+
23+
* <news item>

‎news/pdf-dep.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
**Changed:**
66

7-
* 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``.
7+
* 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``.
88

99
**Deprecated:**
1010

‎src/diffpy/srfit/pdf/characteristicfunctions.py‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def _build_dep_msg(old_name, new_name, signature_note=None):
9797

9898
lognormalSphericalCF_dep_msg = _build_dep_msg(
9999
"lognormalSphericalCF",
100-
"lognormal_spherical_distribution",
100+
"lognormal_spherical_particle",
101101
"Additionally, the signature has changed. Please pass the parameters "
102102
"'psize' and 'psig' as 'particle_diameter' and "
103103
"'particle_diameter_sigma', respectively.",
@@ -110,14 +110,14 @@ def _build_dep_msg(old_name, new_name, signature_note=None):
110110
"'sthick' as 'sheet_thickness'.",
111111
)
112112

113-
shellCF_dep_msg = _build_dep_msg("shellCF", "spherical_shell")
113+
shellCF_dep_msg = _build_dep_msg("shellCF", "shell_particle")
114114

115115
shellCF2_dep_msg = _build_dep_msg(
116116
"shellCF2",
117-
"spherical_shell",
117+
"shell_particle",
118118
"Additionally, the parameterization has changed. 'shellCF2' took the "
119119
"central radius 'a' and the shell thickness 'delta', while "
120-
"'spherical_shell' takes the inner radius. Please pass "
120+
"'shell_particle' takes the inner radius. Please pass "
121121
"radius = a - delta / 2 and thickness = delta.",
122122
)
123123

@@ -579,7 +579,7 @@ def lognormalSphericalCF(r, psize, psig):
579579
4.0.0.
580580
581581
Please use
582-
diffpy.cmipdf.characteristicfunctions.lognormal_spherical_distribution
582+
diffpy.cmipdf.characteristicfunctions.lognormal_spherical_particle
583583
instead.
584584
"""
585585
return lognormal_spherical_particle(r, psize, psig)
@@ -601,7 +601,7 @@ def shellCF(r, radius, thickness):
601601
"""This function has been deprecated and will be removed in version
602602
4.0.0.
603603
604-
Please use diffpy.cmipdf.characteristicfunctions.spherical_shell
604+
Please use diffpy.cmipdf.characteristicfunctions.shell_particle
605605
instead.
606606
"""
607607
return shell_particle(r, radius, thickness)
@@ -612,7 +612,7 @@ def shellCF2(r, a, delta):
612612
"""This function has been deprecated and will be removed in version
613613
4.0.0.
614614
615-
Please use diffpy.cmipdf.characteristicfunctions.spherical_shell
615+
Please use diffpy.cmipdf.characteristicfunctions.shell_particle
616616
instead.
617617
"""
618618
return shell_particle(r, a - delta / 2, delta)

‎tests/test_characteristicfunctions.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ def test_non_physical_input_warns_only_once(
656656
(
657657
"lognormalSphericalCF",
658658
"lognormal_spherical_particle",
659-
"lognormal_spherical_distribution",
659+
"lognormal_spherical_particle",
660660
"Additionally, the signature has changed. Please pass the "
661661
"parameters 'psize' and 'psig' as 'particle_diameter' and "
662662
"'particle_diameter_sigma', respectively.",
@@ -679,7 +679,7 @@ def test_non_physical_input_warns_only_once(
679679
(
680680
"shellCF",
681681
"shell_particle",
682-
"spherical_shell",
682+
"shell_particle",
683683
"",
684684
(numpy.array([0.0, 5.0, 12.5]), 10.0, 5.0),
685685
(numpy.array([0.0, 5.0, 12.5]), 10.0, 5.0),
@@ -691,10 +691,10 @@ def test_non_physical_input_warns_only_once(
691691
(
692692
"shellCF2",
693693
"shell_particle",
694-
"spherical_shell",
694+
"shell_particle",
695695
"Additionally, the parameterization has changed. 'shellCF2' took "
696696
"the central radius 'a' and the shell thickness 'delta', while "
697-
"'spherical_shell' takes the inner radius. Please pass "
697+
"'shell_particle' takes the inner radius. Please pass "
698698
"radius = a - delta / 2 and thickness = delta.",
699699
(numpy.array([0.0, 5.0, 12.5]), 12.5, 5.0),
700700
(numpy.array([0.0, 5.0, 12.5]), 10.0, 5.0),

0 commit comments

Comments
 (0)