Skip to content

Commit 9a4195a

Browse files
committed
fix: fix deprecation message and rename the snakecase method to be consistent.
1 parent 99575aa commit 9a4195a

File tree

4 files changed

+21
-21
lines changed

4 files changed

+21
-21
lines changed

news/deprecate-symmetryutilities-1.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
**Added:**
22

3-
* Added ``is_space_group_lat_par`` method in ``symmetryutilities.py``
3+
* Added ``is_space_group_latt_parms`` method in ``symmetryutilities.py``
44
* Added ``is_constant_formula`` method in ``symmetryutilities.py``
55

66
**Changed:**

src/diffpy/structure/pdffitstructure.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
removal_version = "4.0.0"
2323
readStr_deprecation_msg = build_deprecation_message(
2424
base,
25-
"isSpaceGroupLatPar",
26-
"is_space_group_lat_par",
25+
"readStr",
26+
"read_structure",
2727
removal_version,
2828
)
2929

src/diffpy/structure/symmetryutilities.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
isSpaceGroupLatPar_deprecation_msg = build_deprecation_message(
4040
base,
4141
"isSpaceGroupLatPar",
42-
"is_space_group_lat_par",
42+
"is_space_group_latt_parms",
4343
removal_version,
4444
)
4545
isconstantFormula_deprecation_msg = build_deprecation_message(
@@ -63,12 +63,12 @@ def isSpaceGroupLatPar(spacegroup, a, b, c, alpha, beta, gamma):
6363
"""'diffpy.structure.isSpaceGroupLatPar' is deprecated and will be
6464
removed in version 4.0.0.
6565
66-
Please use 'diffpy.structure.is_space_group_lat_par' instead.
66+
Please use 'diffpy.structure.is_space_group_latt_parms' instead.
6767
"""
68-
return is_space_group_lat_par(spacegroup, a, b, c, alpha, beta, gamma)
68+
return is_space_group_latt_parms(spacegroup, a, b, c, alpha, beta, gamma)
6969

7070

71-
def is_space_group_lat_par(spacegroup, a, b, c, alpha, beta, gamma):
71+
def is_space_group_latt_parms(spacegroup, a, b, c, alpha, beta, gamma):
7272
"""Check if space group allows passed lattice parameters.
7373
7474
Parameters

tests/test_symmetryutilities.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
_Position2Tuple,
2929
expandPosition,
3030
is_constant_formula,
31-
is_space_group_lat_par,
31+
is_space_group_latt_parms,
3232
isconstantFormula,
3333
isSpaceGroupLatPar,
3434
pruneFormulaDictionary,
@@ -78,19 +78,19 @@ def test_is_space_group_lat_par(self):
7878
trigonal = GetSpaceGroup("P3")
7979
hexagonal = GetSpaceGroup("P6")
8080
cubic = GetSpaceGroup("P23")
81-
self.assertTrue(is_space_group_lat_par(triclinic, 1, 2, 3, 40, 50, 60))
82-
self.assertFalse(is_space_group_lat_par(monoclinic, 1, 2, 3, 40, 50, 60))
83-
self.assertTrue(is_space_group_lat_par(monoclinic, 1, 2, 3, 90, 50, 90))
84-
self.assertFalse(is_space_group_lat_par(orthorhombic, 1, 2, 3, 90, 50, 90))
85-
self.assertTrue(is_space_group_lat_par(orthorhombic, 1, 2, 3, 90, 90, 90))
86-
self.assertFalse(is_space_group_lat_par(tetragonal, 1, 2, 3, 90, 90, 90))
87-
self.assertTrue(is_space_group_lat_par(tetragonal, 2, 2, 3, 90, 90, 90))
88-
self.assertFalse(is_space_group_lat_par(trigonal, 2, 2, 3, 90, 90, 90))
89-
self.assertTrue(is_space_group_lat_par(trigonal, 2, 2, 2, 80, 80, 80))
90-
self.assertFalse(is_space_group_lat_par(hexagonal, 2, 2, 2, 80, 80, 80))
91-
self.assertTrue(is_space_group_lat_par(hexagonal, 2, 2, 3, 90, 90, 120))
92-
self.assertFalse(is_space_group_lat_par(cubic, 2, 2, 3, 90, 90, 120))
93-
self.assertTrue(is_space_group_lat_par(cubic, 3, 3, 3, 90, 90, 90))
81+
self.assertTrue(is_space_group_latt_parms(triclinic, 1, 2, 3, 40, 50, 60))
82+
self.assertFalse(is_space_group_latt_parms(monoclinic, 1, 2, 3, 40, 50, 60))
83+
self.assertTrue(is_space_group_latt_parms(monoclinic, 1, 2, 3, 90, 50, 90))
84+
self.assertFalse(is_space_group_latt_parms(orthorhombic, 1, 2, 3, 90, 50, 90))
85+
self.assertTrue(is_space_group_latt_parms(orthorhombic, 1, 2, 3, 90, 90, 90))
86+
self.assertFalse(is_space_group_latt_parms(tetragonal, 1, 2, 3, 90, 90, 90))
87+
self.assertTrue(is_space_group_latt_parms(tetragonal, 2, 2, 3, 90, 90, 90))
88+
self.assertFalse(is_space_group_latt_parms(trigonal, 2, 2, 3, 90, 90, 90))
89+
self.assertTrue(is_space_group_latt_parms(trigonal, 2, 2, 2, 80, 80, 80))
90+
self.assertFalse(is_space_group_latt_parms(hexagonal, 2, 2, 2, 80, 80, 80))
91+
self.assertTrue(is_space_group_latt_parms(hexagonal, 2, 2, 3, 90, 90, 120))
92+
self.assertFalse(is_space_group_latt_parms(cubic, 2, 2, 3, 90, 90, 120))
93+
self.assertTrue(is_space_group_latt_parms(cubic, 3, 3, 3, 90, 90, 90))
9494
return
9595

9696
def test_sgtbx_spacegroup_aliases(self):

0 commit comments

Comments
 (0)