Skip to content

refactor: bring diffpy.srfit.util up to standards - #220

Merged
sbillinge merged 1 commit into
diffpy:mainfrom
cadenmyers13:util-standards
Oct 11, 2026
Merged

sbillinge merged 1 commit into
diffpy:mainfrom
cadenmyers13:util-standards

Conversation

@cadenmyers13

Copy link
Copy Markdown
Contributor

This PR:

  1. Deprecates nine camelCase util names in favour of snake_case (observer, tag, name, input and sort-key helpers) and switch all internal callers.
  2. Restyles the tagmanager and weakrefcallable tests
  3. Adds tests for the untested util modules
  4. Puts the deprecation tests under tests/deprecated for easy removal later
  5. Rewrites the util docstrings in NumPy style.

Deprecate nine camelCase util names in favour of snake_case (observer,
tag, name, input and sort-key helpers) and switch all internal callers.
Restyle the tagmanager and weakrefcallable tests, add tests for the
untested util modules, put the deprecation tests under tests/deprecated,
and rewrite the util docstrings in NumPy style.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.69136% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 83.39%. Comparing base (a9eae82) to head (91e2267).
⚠️ Report is 17 commits behind head on main.

Files with missing lines Patch % Lines
tests/deprecated/test_util_deprecations.py 98.78% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #220       +/-   ##
===========================================
+ Coverage   71.63%   83.39%   +11.76%     
===========================================
  Files          25       32        +7     
  Lines        3437     4343      +906     
===========================================
+ Hits         2462     3622     +1160     
+ Misses        975      721      -254     
Files with missing lines Coverage Δ
tests/conftest.py 91.54% <100.00%> (+3.13%) ⬆️
tests/test_inpututils.py 100.00% <100.00%> (ø)
tests/test_nameutils.py 100.00% <100.00%> (ø)
tests/test_observable.py 100.00% <100.00%> (ø)
tests/test_tagmanager.py 100.00% <100.00%> (+1.36%) ⬆️
tests/test_util.py 100.00% <100.00%> (ø)
tests/test_visitors.py 99.19% <100.00%> (ø)
tests/test_weakrefcallable.py 100.00% <100.00%> (+1.08%) ⬆️
tests/deprecated/test_util_deprecations.py 98.78% <98.78%> (ø)

... and 12 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cadenmyers13

Copy link
Copy Markdown
Contributor Author

@sbillinge ready for review. There are a lot of changes on this PR but most are docstring and deprecation work. The meaningful changes are the tests. Claude refactored some tests that were using unittest and wrote tests for:

  • argbinders.py
  • inpututils.py
  • nameutils.py
  • observable.py
  • sortKeyForNumericString (in util/__init__.py)

MULTILINE_TEXT = "a 1.0\nb 2.0\n"
LONG_TEXT = "x" * 80


@cadenmyers13 cadenmyers13 Oct 8, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The tests in this file are identical to the test for the 9 deprecated functions plus a test for catching the deprecation message

@sbillinge
sbillinge merged commit 2f73490 into diffpy:main Oct 11, 2026
7 checks passed
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