Skip to content

Commit fd18f84

Browse files
cadenmyers13claude
andauthored
fix: rename RecipeOrganizer.get_constrained_parmeters to get_constrained_parameters (#239)
Correct the typo in the snake_case name added in 3.4.0, and point the getConstrainedPars forwarder and its deprecation test at the corrected name. This is a plain rename with no deprecation period; the misspelled name was only just released. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 2894e8a commit fd18f84

4 files changed

Lines changed: 30 additions & 7 deletions

File tree

‎news/fix-typo.rst‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
**Added:**
2+
3+
* <news item>
4+
5+
**Changed:**
6+
7+
* <news item>
8+
9+
**Deprecated:**
10+
11+
* <news item>
12+
13+
**Removed:**
14+
15+
* <news item>
16+
17+
**Fixed:**
18+
19+
* Fix the misspelled method name ``RecipeOrganizer.get_constrained_parmeters``, added in 3.4.0. It is now ``RecipeOrganizer.get_constrained_parameters``, and ``getConstrainedPars`` points to the corrected name.
20+
21+
**Security:**
22+
23+
* <news item>

‎src/diffpy/srfit/fitbase/recipeorganizer.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
getConstrainedPars_deprecation_msg = build_deprecation_message(
108108
recipeorganizer_base,
109109
"getConstrainedPars",
110-
"get_constrained_parmeters",
110+
"get_constrained_parameters",
111111
removal_version,
112112
)
113113

@@ -1313,7 +1313,7 @@ def unconstrain(self, *pars):
13131313
self.remove_constraint(*pars)
13141314
return
13151315

1316-
def get_constrained_parmeters(self, recurse=False):
1316+
def get_constrained_parameters(self, recurse=False):
13171317
"""Get the constrained managed Parameters in this object.
13181318
13191319
Parameters
@@ -1338,10 +1338,10 @@ def getConstrainedPars(self, recurse=False):
13381338
version 4.0.0.
13391339
13401340
Please use
1341-
diffpy.srfit.fitbase.recipeorganizer.RecipeOrganizer.get_constrained_parmeters
1341+
diffpy.srfit.fitbase.recipeorganizer.RecipeOrganizer.get_constrained_parameters
13421342
instead.
13431343
"""
1344-
return self.get_constrained_parmeters(recurse=recurse)
1344+
return self.get_constrained_parameters(recurse=recurse)
13451345

13461346
def clear_all_constraints(self, recurse=False):
13471347
"""Clear all constraints managed by this organizer.

‎tests/deprecated/test_recipeorganizer_deprecations.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ def _call_organizer_method(organizer, method_name, args):
185185
("unconstrain", "remove_constraint", ("y",)),
186186
# C7: getConstrainedPars gets the constrained Parameters.
187187
# Expected: Warns and gives the same result as
188-
# get_constrained_parmeters.
189-
("getConstrainedPars", "get_constrained_parmeters", ()),
188+
# get_constrained_parameters.
189+
("getConstrainedPars", "get_constrained_parameters", ()),
190190
# C8: clearConstraints removes all constraints.
191191
# Expected: Warns and gives the same result as
192192
# clear_all_constraints.

‎tests/test_recipeorganizer.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ def _get_constraint_state(organizer, parameter):
372372
organizer.is_constrained(parameter),
373373
[
374374
constrained.name
375-
for constrained in organizer.get_constrained_parmeters()
375+
for constrained in organizer.get_constrained_parameters()
376376
],
377377
len(organizer._constraints),
378378
)

0 commit comments

Comments
 (0)