Commit Graph
16 Commits
Author SHA1 Message Date
Christian Clauss 0525ef5da8 ruff rule ANN202 missing-return-type-private-function (#15298)
* ruff rule ANN202 missing-return-type-private-function

* ruff rule ANN202 missing-return-type-private-function
2026-09-12 21:47:08 +02:00
Ant19801108andAnt19801108 d031e8fb0a fix: correct argument order in fuzzy set union (#15273)
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>
2026-09-11 07:40:48 +02:00
priya-sundaram-dev c1ad752917 TLC for fuzzy_logic/: restore disabled demo dependency-free + add README (#15166)
* 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)
2026-09-03 06:48:03 +02:00
apples53andTianyi Zheng 9b5641d2d3 balance parenthesis (add closing bracket) (#11563)
* balance parenthesis (add closing bracket)

* Apply suggestions from code review

---------

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
2024-09-24 00:30:36 -07:00
Maxim Smolskiy 79dc7c97ac Enable ruff RUF001 rule (#11378)
* Enable ruff RUF001 rule

* Fix

* Fix
2024-04-22 21:45:24 +02:00
Shreya123714pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Christian Clauss
f2436318ce Add FuzzySet Class for Triangular Fuzzy Sets (#11036)
* 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>
2023-10-28 20:32:12 +02:00
Christian Claussandgithub-actions 0f4e51245f Upgrade to Python 3.12 (#9576)
* 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>
2023-10-03 14:47:10 +05:30
CenTdemeern1pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Dhruv Manilawala
04698538d8 Misc fixes across multiple algorithms (#6912)
Source: Snyk code quality
Add scikit-fuzzy to requirements

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
2022-10-16 10:55:38 +05:30
Maxim SmolskiyandChristian Clauss 729aaf6427 Improve Project Euler problem 014 solution 2 (#5744)
* 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>
2021-11-04 17:01:21 +01:00
Dhruv 48357cea5b Add __init__.py files in all the directories (#2503) 2020-09-28 19:42:36 +02:00
Christian Claussandgithub-actions 5f4da5d616 isort --profile black . (#2181)
* updating DIRECTORY.md

* isort --profile black .

* Black after

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2020-07-06 09:44:19 +02:00
Christian Claussandgithub-actions 9316e7c014 Set the Python file maximum line length to 88 characters (#2122)
* flake8 --max-line-length=88

* fixup! Format Python code with psf/black push

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2020-06-16 10:09:19 +02:00
matkosoricandJohn Law 7f04e5cd34 contribution guidelines checks (#1787)
* 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>
2020-03-04 13:40:28 +01:00
Mantas Zimnickas 12f69a86f5 Remove code with side effects from main (#1577)
* 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
2019-11-17 19:38:48 +01:00
Ankur Chattopadhyay 7592cba417 psf/black code formatting (#1421)
* added sol3.py for problem_20

* added sol4.py for problem_06

* ran `black .` on `\Python`
2019-10-22 19:13:48 +02:00
Jigyasa G a7f3851939 fuzzy operations added (#1310)
* fuzzy operations added

* fuzzy inference system added

* unnecessary files removed

* requirements added

* Modified requirements for travis ci

* Modified requirements for travis ci

* Add scikit-fuzzy to requirements.txt
2019-10-18 20:26:48 +02:00