diff --git a/news/assignUniqueLabels-deprecation.rst b/news/assignUniqueLabels-deprecation.rst new file mode 100644 index 0000000..76b1607 --- /dev/null +++ b/news/assignUniqueLabels-deprecation.rst @@ -0,0 +1,23 @@ +**Added:** + +* No news added: add deprecation message for `assignUniqueLabels` + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* diff --git a/src/diffpy/structure/structure.py b/src/diffpy/structure/structure.py index 8d24054..1593af4 100644 --- a/src/diffpy/structure/structure.py +++ b/src/diffpy/structure/structure.py @@ -21,13 +21,19 @@ from diffpy.structure.atom import Atom from diffpy.structure.lattice import Lattice -from diffpy.structure.utils import _link_atom_attribute, atomBareSymbol, isiterable +from diffpy.structure.utils import _link_atom_attribute, atom_bare_symbol, isiterable from diffpy.utils._deprecator import build_deprecation_message, deprecated # ---------------------------------------------------------------------------- base = "diffpy.structure.Structure" removal_version = "4.0.0" +assignUniqueLabels_deprecation_msg = build_deprecation_message( + base, + "assignUniqueLabels", + "assign_unique_labels", + removal_version, +) addNewAtom_deprecation_msg = build_deprecation_message( base, "addNewAtom", @@ -242,7 +248,7 @@ def assign_unique_labels(self): for a in self: if a in islabeled: continue - baresmbl = atomBareSymbol(a.element) + baresmbl = atom_bare_symbol(a.element) elnum[baresmbl] = elnum.get(baresmbl, 0) + 1 a.label = baresmbl + str(elnum[baresmbl]) islabeled.add(a)