fix: correct argument order in fuzzy set union - #15273
Conversation
FuzzySet is declared as (name, left_boundary, peak, right_boundary), but union passed (name, min_left, max_right, avg_peak), so peak and right_boundary were swapped. Swap the last two arguments and update both doctests. Fixes TheAlgorithms#11871 Signed-off-by: Ant19801108 <[email protected]>
|
@priya-sundaram-dev please evaluate this as a fix for #11871. If it is not the right fix then please create a pull request that closes this pull request and 11871. |
|
Confirmed — this is the right fix for #11871. ✅ The dataclass is declared Verified on the PR head:
Diff is minimal and scoped to the bug. LGTM — this closes #11871. |
cclauss
left a comment
There was a problem hiding this comment.
Awesome work. Thanks to both of you.
Description
Fixes #11871 — the fuzzy
unionmethod passed constructor arguments in the wrong order.FuzzySetis declared as(name, left_boundary, peak, right_boundary), butunioncalledFuzzySet(name, min_left, max_right, avg_peak), sopeakandright_boundarywere swapped. This swaps the last two arguments and corrects both doctests.Type of change
Checklist
python -m doctest fuzzy_logic/fuzzy_operations.pypasses (22 doctests, 0 failures).