Skip to content

Deprecate: deprecate setValue and remove deprecated Python2 objects#167

Merged
sbillinge merged 5 commits intodiffpy:v3.3.0from
cadenmyers13:setvalue-dep
Mar 6, 2026
Merged

Deprecate: deprecate setValue and remove deprecated Python2 objects#167
sbillinge merged 5 commits intodiffpy:v3.3.0from
cadenmyers13:setvalue-dep

Conversation

@cadenmyers13
Copy link
Contributor

@cadenmyers13 cadenmyers13 commented Mar 5, 2026

Deprecation of Parameter.setValue

There are a lot of methods in srfit called def setValue, but i only deprecated the one inside Parameter because that seems to be the only user-facing one. If a user wants to create a new parameter it is done through this object. The other uses of def setValue I just replaced with def set_value and did not mark with the deprecator.

Also, in src/diffpy/srfit/equation/literals/abcs.py I removed the use of six and other python 2 objects. I did this with the help of chatGPT

@cadenmyers13
Copy link
Contributor Author

@sbillinge ready for review

@codecov
Copy link

codecov bot commented Mar 5, 2026

Codecov Report

❌ Patch coverage is 81.72043% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.94%. Comparing base (08478d4) to head (bb99611).
⚠️ Report is 7 commits behind head on v3.3.0.

Files with missing lines Patch % Lines
tests/test_objcrystparset.py 0.00% 8 Missing ⚠️
tests/test_diffpyparset.py 0.00% 5 Missing ⚠️
tests/test_pdf.py 0.00% 2 Missing ⚠️
tests/test_sas.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           v3.3.0     #167      +/-   ##
==========================================
+ Coverage   72.81%   77.94%   +5.12%     
==========================================
  Files          25       24       -1     
  Lines        3896     3622     -274     
==========================================
- Hits         2837     2823      -14     
+ Misses       1059      799     -260     
Files with missing lines Coverage Δ
tests/test_builder.py 100.00% <100.00%> (ø)
tests/test_constraint.py 96.96% <100.00%> (ø)
tests/test_contribution.py 99.58% <100.00%> (ø)
tests/test_equation.py 100.00% <100.00%> (ø)
tests/test_fitrecipe.py 99.85% <100.00%> (ø)
tests/test_literals.py 99.17% <100.00%> (ø)
tests/test_parameter.py 98.14% <100.00%> (ø)
tests/test_recipeorganizer.py 99.69% <100.00%> (ø)
tests/test_restraint.py 96.87% <100.00%> (ø)
tests/test_visitors.py 99.19% <100.00%> (ø)
... and 5 more

... and 1 file 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
Contributor Author

Ah, codecov failed.. one sec

@cadenmyers13
Copy link
Contributor Author

Since there were a lot of calls to .setValue changed to .set_value in tests, codecov is failing. I think we can just ignore this since we're technically not missing any coverage

@sbillinge
Copy link
Contributor

Since there were a lot of calls to .setValue changed to .set_value in tests, codecov is failing. I think we can just ignore this since we're technically not missing any coverage

Don't we have tests for set_value though? Please check, because if we do, then these lines should have coverage, no?

@cadenmyers13
Copy link
Contributor Author

@sbillinge Okay I figured out the root cause. the test_speed.py has a bunch of tests called speedTest*(). This file is a benchmarking test and not a unit test. According to ChatGPT, benchmark tests like these are usually excluded from tests (which is why, im assuming, the naming convention is speedTest* and not testSpeed* because the former is skipped).

On this PR, i changed it to skip these tests more formally. if performance wants to be tested, the dev can comment out the line

@sbillinge sbillinge merged commit 61d845d into diffpy:v3.3.0 Mar 6, 2026
6 checks passed
@sbillinge
Copy link
Contributor

nice, thanks @cadenmyers13

@cadenmyers13 cadenmyers13 deleted the setvalue-dep branch March 6, 2026 22:27
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