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#11871
Signed-off-by: Ant19801108 <Ant19801108@users.noreply.github.com>
Co-authored-by: Ant19801108 <Ant19801108@users.noreply.github.com>
* TLC for fuzzy_logic/: restore disabled demo dependency-free + add README
- Restore fuzzy_operations.py.DISABLED.txt as fuzzy_set_operations.py,
rewritten to drop the scikit-fuzzy dependency (NumPy only). Implements the
Zadeh operators on sampled membership vectors: union, intersection,
complement, difference, algebraic sum/product, bounded sum/difference, plus a
triangular_membership helper. Every function has doctests; the __main__ block
reproduces the original 'young vs. middle-aged' demo and degrades gracefully
when matplotlib is absent.
- Add fuzzy_logic/README.md covering both modules with Wikipedia links and a
runnable example.
- Remove the obsolete .DISABLED.txt (its intent is now the working module).
Credit to Jigyasa Gandhi (original scikit-fuzzy demo) and @Shreya123714
(FuzzySet). Passes pytest --doctest-modules, ruff check, ruff format --check.
* fuzzy_logic: descriptive parameter names + drop __future__ annotations
Address review on #15166:
- rename single-letter params (x->grid, a/b->membership_a/membership_b,
fuzzy_complement arg -> membership) per algorithms-keeper + cclauss
- drop 'from __future__ import annotations' (repo is Python 3.14t-only)
* fuzzy_logic: descriptive parameter names + drop __future__ annotations
Address review on #15166:
- rename single-letter params (x->grid, a/b->membership_a/membership_b,
fuzzy_complement arg -> membership) per algorithms-keeper + cclauss
- drop 'from __future__ import annotations' (repo is Python 3.14t-only)
* Added Opertation for triangular fuzzy sets
* Added Sources
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix the bug , for which test were failing
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Add type hints and improve parameter names
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Add Test For fuzzy_operations.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix the bug in fuzzy_operations.py
* Add test_fuzzy_logic.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix the bug in fuzzy_operations.py & deleted test
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fixed the typo error
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Again done
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* corrected wrong intendation due to which test fail
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* bug fixed
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Add test_fuzzy_logic
* Modified fuzzy_operations.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fixed the bug, made a FuzzySet dataclass
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Replaced assertEqual of unittest to assert python
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* lets see
* Changed test
* orderd the import statements
* Add docstring and dataclass the FuzzySet
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update fuzzy_operations.py
* Delete fuzzy_logic/test_fuzzy_logic.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* https://en.wikipedia.org/wiki/Fuzzy_set
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* DRAFT: GitHub Actions: Test on Python 3.12
Repeats #8777
* #8777
Some of our dependencies will not be ready yet.
* Python 3.12: Disable qiskit and tensorflow algorithms
* updating DIRECTORY.md
---------
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Improve solution
* Uncomment code that has been commented due to slow execution affecting Travis
* Fix
* scikit-fuzzy is causing broken builds
* fuzz = None
* Update fuzzy_operations.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* spelling corrections
* review
* improved documentation, removed redundant variables, added testing
* added type hint
* camel case to snake case
* spelling fix
* review
* python --> Python # it is a brand name, not a snake
* explicit cast to int
* spaces in int list
* "!= None" to "is not None"
* Update comb_sort.py
* various spelling corrections in documentation & several variables naming conventions fix
* + char in file name
* import dependency - bug fix
Co-authored-by: John Law <johnlaw.po@gmail.com>
* Remove code with side effects from main
When running tests withy pytest, some modules execute code in main scope
and open plot or browser windows.
Moves such code under `if __name__ == "__main__"`.
* fixup! Format Python code with psf/black push