Skip to content

Deprecate: deprecate setValue and remove deprecated Python2 objects#167

Open
cadenmyers13 wants to merge 3 commits intodiffpy:v3.3.0from
cadenmyers13:setvalue-dep
Open

Deprecate: deprecate setValue and remove deprecated Python2 objects#167
cadenmyers13 wants to merge 3 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 53.52113% with 66 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.81%. Comparing base (08478d4) to head (6d0de27).
⚠️ Report is 1 commits behind head on v3.3.0.

Files with missing lines Patch % Lines
tests/test_speed.py 0.00% 49 Missing ⚠️
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%   72.81%           
=======================================
  Files          25       25           
  Lines        3896     3896           
=======================================
  Hits         2837     2837           
  Misses       1059     1059           
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 6 more
🚀 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?

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