Skip to content

Deprecate: deprecate methods in RecipeOrganizer pt1#168

Merged
sbillinge merged 14 commits intodiffpy:v3.3.0from
cadenmyers13:recipeorg-dep1
Mar 8, 2026
Merged

Deprecate: deprecate methods in RecipeOrganizer pt1#168
sbillinge merged 14 commits intodiffpy:v3.3.0from
cadenmyers13:recipeorg-dep1

Conversation

@cadenmyers13
Copy link
Contributor

No description provided.

from functools import partial
from itertools import chain, groupby

import six
Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed deprecated six stuff

yield par
for parameter in list(self._parameters.values()):
if regexp.search(parameter.name):
yield parameter
Copy link
Contributor Author

Choose a reason for hiding this comment

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

in this file, i changed every par to parameter

@codecov
Copy link

codecov bot commented Mar 6, 2026

Codecov Report

❌ Patch coverage is 98.57143% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 78.25%. Comparing base (bb99611) to head (1c11b31).
⚠️ Report is 16 commits behind head on v3.3.0.

Files with missing lines Patch % Lines
tests/test_pdf.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           v3.3.0     #168      +/-   ##
==========================================
+ Coverage   77.94%   78.25%   +0.31%     
==========================================
  Files          24       24              
  Lines        3622     3674      +52     
==========================================
+ Hits         2823     2875      +52     
  Misses        799      799              
Files with missing lines Coverage Δ
tests/test_builder.py 100.00% <100.00%> (ø)
tests/test_contribution.py 99.58% <100.00%> (ø)
tests/test_recipeorganizer.py 99.73% <100.00%> (+0.04%) ⬆️
tests/test_pdf.py 43.29% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

params : dict, optional
The dictionary of Parameters, indexed by name, that are used in the
equation string but are not part of the RecipeOrganizer
(default is {}).
Copy link
Contributor Author

Choose a reason for hiding this comment

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

made the arg names better for constrain and restrain. I don't feel like we need to spend time deprecating the variable names. If someones code breaks because we change the variable names I feel like the user should be able to figure it out pretty quickly. TLDR, I think it would be more time than its worth.

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, I agree.

expected_constrained_params = [p1.name]

assert actual_constrained_params == expected_constrained_params

Copy link
Contributor Author

Choose a reason for hiding this comment

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

add simple test for new and deprecated functions

eq = self.m.register_string_function("g/x - 1", "pdf")
self.assertTrue(numpy.array_equal(g(x) / x - 1, eq()))

return
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Had to duplicate this test bc register calculator is only referenced once (the test below this)

self.assertEqual(36, self.m.evaluate_equation("3 * x"))
self.assertEqual(0, len(self.m._eqfactory.equations))
return

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Another test i had to dupliucate for the same reason

@cadenmyers13
Copy link
Contributor Author

@sbillinge Ready for review. I spent some good time tidying up docstrings and var names :)

@sbillinge sbillinge merged commit 5e91f9b into diffpy:v3.3.0 Mar 8, 2026
6 checks passed
@sbillinge
Copy link
Contributor

Thanks for this work, it is really appreciated.

@cadenmyers13 cadenmyers13 deleted the recipeorg-dep1 branch March 8, 2026 00:09
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