Skip to content

Comments

chore: deprecate assignUniqueLabels#158

Merged
sbillinge merged 4 commits intodiffpy:mainfrom
stevenhua0320:deprecate-assignUniqueLabels
Feb 20, 2026
Merged

chore: deprecate assignUniqueLabels#158
sbillinge merged 4 commits intodiffpy:mainfrom
stevenhua0320:deprecate-assignUniqueLabels

Conversation

@stevenhua0320
Copy link
Contributor

@sbillinge ready to review.
Now the test for this function would give deprecationWarning shown below.

(diffpy.structure) ~/dbs/diffpy.structure git:[deprecate-assignUniqueLabels]
pytest
============================================================================================================== test session starts ==============================================================================================================
platform darwin -- Python 3.14.3, pytest-9.0.2, pluggy-1.6.0
rootdir: /Users/huarundong/dbs/diffpy.structure
configfile: pyproject.toml
collected 138 items                                                                                                                                                                                                                             

tests/test_atom.py ..                                                                                                                                                                                                                     [  1%]
tests/test_lattice.py ............                                                                                                                                                                                                        [ 10%]
tests/test_loadstructure.py ......                                                                                                                                                                                                        [ 14%]
tests/test_p_cif.py .....................                                                                                                                                                                                                 [ 29%]
tests/test_p_discus.py .....                                                                                                                                                                                                              [ 33%]
tests/test_p_pdffit.py .........                                                                                                                                                                                                          [ 39%]
tests/test_parsers.py .............                                                                                                                                                                                                       [ 49%]
tests/test_spacegroups.py .....                                                                                                                                                                                                           [ 52%]
tests/test_structure.py ........................................                                                                                                                                                                          [ 81%]
tests/test_supercell.py ...                                                                                                                                                                                                               [ 84%]
tests/test_symmetryutilities.py .....................                                                                                                                                                                                     [ 99%]
tests/test_version.py .                                                                                                                                                                                                                   [100%]

=============================================================================================================== warnings summary ================================================================================================================
tests/test_structure.py::TestStructure::test_assignUniqueLabels
  /Users/huarundong/dbs/diffpy.structure/tests/test_structure.py:128: DeprecationWarning: 'diffpy.structure.Structure.assignUniqueLabels' is deprecated and will be removed in version 4.0.0. Please use 'diffpy.structure.Structure.assign_unique_labels' instead.
    self.stru.assignUniqueLabels()

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
======================================================================================================== 138 passed, 1 warning in 0.63s =========================================================================================================

Copy link
Contributor

@sbillinge sbillinge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will merge this but @stevenhua0320 and @cadenmyers13 please can you see my comment

@@ -0,0 +1,23 @@
**Added:**

* No News Added: deprecate assignUniqueLabels method
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this no news. Don't we need to list what we deprecate and what we add?


def test_assignUniqueLabels(self):
"""Check Structure.assignUniqueLabels()"""
"""Duplicate test with the deprecated assignUniqueLabels method.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to do this. This test will start failing when we remove the function so these will be easy to find and remove.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sbillinge So, what we need to contain here? should we maintain the original docstring here?

@sbillinge
Copy link
Contributor

Actually, I can't merge because of the news. I am afraid that I may have merged som no-news's that should have had news in them. Please can you take a look @stevenhua0320 and add PRs if I did?

@stevenhua0320
Copy link
Contributor Author

@sbillinge It's safe right now since nothing deprecation's PR has been merged yet. I would now change the news and see anything that we need edit here.

@codecov
Copy link

codecov bot commented Feb 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.93%. Comparing base (1b565c8) to head (2a1f30e).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #158   +/-   ##
=======================================
  Coverage   98.93%   98.93%           
=======================================
  Files          13       13           
  Lines        1878     1884    +6     
=======================================
+ Hits         1858     1864    +6     
  Misses         20       20           
Files with missing lines Coverage Δ
tests/test_structure.py 99.78% <100.00%> (+<0.01%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sbillinge sbillinge merged commit 39d41f0 into diffpy:main Feb 20, 2026
7 checks passed
@stevenhua0320 stevenhua0320 changed the title build: deprecate assignUniqueLabels chore: deprecate assignUniqueLabels Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants