From 256f5065966245d3e5ff6079ad7ce436520dbd1d Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Tue, 27 Oct 2026 13:37:47 -0400 Subject: [PATCH] fix: rename RecipeOrganizer.get_constrained_parmeters to get_constrained_parameters 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 --- news/fix-typo.rst | 23 +++++++++++++++++++ src/diffpy/srfit/fitbase/recipeorganizer.py | 8 +++---- .../test_recipeorganizer_deprecations.py | 4 ++-- tests/test_recipeorganizer.py | 2 +- 4 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 news/fix-typo.rst diff --git a/news/fix-typo.rst b/news/fix-typo.rst new file mode 100644 index 00000000..bd8c2188 --- /dev/null +++ b/news/fix-typo.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* 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. + +**Security:** + +* diff --git a/src/diffpy/srfit/fitbase/recipeorganizer.py b/src/diffpy/srfit/fitbase/recipeorganizer.py index 2649e2bf..108b5cc1 100644 --- a/src/diffpy/srfit/fitbase/recipeorganizer.py +++ b/src/diffpy/srfit/fitbase/recipeorganizer.py @@ -107,7 +107,7 @@ getConstrainedPars_deprecation_msg = build_deprecation_message( recipeorganizer_base, "getConstrainedPars", - "get_constrained_parmeters", + "get_constrained_parameters", removal_version, ) @@ -1313,7 +1313,7 @@ def unconstrain(self, *pars): self.remove_constraint(*pars) return - def get_constrained_parmeters(self, recurse=False): + def get_constrained_parameters(self, recurse=False): """Get the constrained managed Parameters in this object. Parameters @@ -1338,10 +1338,10 @@ def getConstrainedPars(self, recurse=False): version 4.0.0. Please use - diffpy.srfit.fitbase.recipeorganizer.RecipeOrganizer.get_constrained_parmeters + diffpy.srfit.fitbase.recipeorganizer.RecipeOrganizer.get_constrained_parameters instead. """ - return self.get_constrained_parmeters(recurse=recurse) + return self.get_constrained_parameters(recurse=recurse) def clear_all_constraints(self, recurse=False): """Clear all constraints managed by this organizer. diff --git a/tests/deprecated/test_recipeorganizer_deprecations.py b/tests/deprecated/test_recipeorganizer_deprecations.py index 0cbf0355..9dc90fa8 100644 --- a/tests/deprecated/test_recipeorganizer_deprecations.py +++ b/tests/deprecated/test_recipeorganizer_deprecations.py @@ -185,8 +185,8 @@ def _call_organizer_method(organizer, method_name, args): ("unconstrain", "remove_constraint", ("y",)), # C7: getConstrainedPars gets the constrained Parameters. # Expected: Warns and gives the same result as - # get_constrained_parmeters. - ("getConstrainedPars", "get_constrained_parmeters", ()), + # get_constrained_parameters. + ("getConstrainedPars", "get_constrained_parameters", ()), # C8: clearConstraints removes all constraints. # Expected: Warns and gives the same result as # clear_all_constraints. diff --git a/tests/test_recipeorganizer.py b/tests/test_recipeorganizer.py index e71c8542..bf2fa5ed 100644 --- a/tests/test_recipeorganizer.py +++ b/tests/test_recipeorganizer.py @@ -372,7 +372,7 @@ def _get_constraint_state(organizer, parameter): organizer.is_constrained(parameter), [ constrained.name - for constrained in organizer.get_constrained_parmeters() + for constrained in organizer.get_constrained_parameters() ], len(organizer._constraints), )