Skip to content

Releases: fuzzylite/pyfuzzylite

pyfuzzylite 8.0.3

17 May 01:11
7029711
Compare
Choose a tag to compare

Version 8.0.3

  • Renamed requirements.txt to requirements-dev.txt
  • Added __author__, __copyright__ and __license__ to fuzzylite.__init__.py and fuzzylite.library.information
  • Removed Limited in FuzzyLite Limited everywhere, eg, fuzzylite.information.company = "FuzzyLite"
  • RuleBlock: Added RuleBlock.rule(int) to get rule by index
  • Function: Unary functions can be defined in either left or right nodes
  • Upgraded dependencies: nox, poetry, mypy, pyright, black, ruff
  • Improved tests
  • Shortened preamble in every file

pyfuzzylite 8.0.2

26 Apr 03:52
6252cdc
Compare
Choose a tag to compare

Bug fix: engine.[input|output]_values

pyfuzzylite 8.0.1

11 Jan 00:28
aadb341
Compare
Choose a tag to compare

Version 8.0.1

Bug fixes

  • On Python 3.10|3.11: Removed Self type annotation from Benchmark because the typing_extensions module
    cannot be found
  • On Python 3.12: Explicitly increasing values of fl.Representation to avoid errors from new values

Version 8.0.0

Summary

New

  • integration with numpy means engines operate more efficiently thanks to vectorization, but the regular operation
    with Python float also works seamlessly
  • fuzzylite/types.py to store library annotation types
  • type fl.Scalar = float | numpy.Array replaces float everywhere vectorization can be used
    (see fuzzylite/types.py)
  • type fl.ScalarArray = numpy.Array[float] used in places where an array of floats is needed (
    see fuzzylite/types.py)
  • function fl.scalar to convert any argument to a fl.Scalar
  • function fl.array maps to np.array
  • function fl.to_float converts any argument to a float, which was the behaviour of fl.Op.scalar.
  • linguistic terms Arc and SemiEllipse
  • indexable components:
    • Engine: get variables or rule blocks by name using square brackets, eg, engine["light"].value
    • Variable: get terms by name using square brackets, eg, variable["low"].membership(value)
    • Factory: get constructors and objects by name using square brackets,
      eg, factory["Triangle"](), factory["sin"](3.14)
  • class Benchmark to benchmark engines
  • from __future__ import annotations in every file to use better type annotations
  • class library.Settings to configure general settings in singleton library.settings
  • class library.Representation to easily convert objects to Python code
  • documentation significantly improved and configured using mkdocs-material, available
    at: fuzzylite.github.io/pyfuzzylite
  • function __len__ in Variable, RuleBlock to get number of components with len(x),
    but also means that implicit boolean statements like if component will evaluate to False when
    component is None or len(component) == 0
  • tsukamoto functions Sigmoid.tsukamoto, SShape.tsukamoto, ZShape.tsukamoto
  • tests, tests and more tests, reaching 95% of code coverage

Changed

  • Requires Python >= 3.9
  • Dual license: GNU GPL and paid proprietary license for commercial purposes
  • All enum values are automatically assigned with enum.auto(), instead of manual assignments
  • Almost all classes redefine __repr__ to return the object as a Python constructor using the
    new fl.library.Representation class
  • Almost all classes redefine __str__ to return the equivalent FuzzyLite Language (if possible)
  • Many more tests and better structure for tests
  • Aggregation operator is now used in TakagiSugeno/Tsukamoto engines on activations of the same term
    (see tests/test_engine.py:test_takagi_sugeno_aggregation_operator)
  • Examples: all file names have been changed to snake_case, and engines wrapped in classes
  • Examples: all examples can be easily imported,
    eg from fuzzylite.examples.mamdani.obstacle_avoidance import ObstacleAvoidance
  • Documentation updated and format changed from doxygen to google style
  • library.settings for default absolute tolerance changed from 1e-5 to 1e-3 to match the default 3 decimals
  • Formatting: code line-width=100 instead of 88
  • Many functions now map or use to numpy functions to support vectorization
  • The following classes are now
    abstract: Activation, Defuzzifier, Exporter, Hedge, Importer, Norm, SNorm, TNorm, Expression
    and Term
  • IntegralDefuzzifiers are simpler, support vectorization, use numpy, and the default resolution is 1000
  • WeightedDefuzzifiers are simpler and use Aggregated.grouped_terms to iterate over the terms and aggregate them
    accordingly
  • Get components by name or index with Engine.input_variable(), Engine.output_variable() or Engine.rule_block()
  • PythonExporter exports code to Python using single-statement constructors
  • FldExporter uses vectorization to export datasets, so for now only works with the General activation method
  • Operators and functions in FunctionFactory map to their equivalent methods in numpy
  • Vectorization support in class activation.General, and
    modules defuzzifier, engine, hedge, norm, rule, term, variable
  • type Rule.triggered to an array of bools to support vectorization
  • type Rule.activation_degree to Scalar to support vectorization
  • renamed parameters of Op.scale from from_[minimum|maximum] to x_[min|max], and to_[minimum|maximum]
    to y_[min|max]
  • function Term.discretize uses Op.midpoints to discretize
  • function Term.discretize uses resolution = 10 instead of 100
  • function Aggregated.activation_degree to support vectorization, so now returns fl.Scalar
  • function fuzzy_value returns Array[np.str_] instead of str to account for vectorization
  • function highest_membership returns Activated | None instead of tuple[float, Term | None]

Removed

  • class library.Library removed and split into library.Settings and library.Information
  • singleton fl.lib. See library.py for settings
  • functions fl.isnan and fl.isinf moved to Op (use now: fl.Op.isnan, fl.Op.isinf)
  • function class_name
    from Activation, Defuzzifier, Exporter, Importer, ConstructionFactory, CloningFactory, Norm, Term;
    use Op.class_name instead
  • parameter decimals from function Op.str()
  • class Discrete.Pair
  • pyhamcrest dependency for tests

Bug fixes

  • Bug fix: Rule.antecedent and Rule.consequent instantiations in Rule constructor
  • Bug fix: Function.update_reference loads function if not loaded
  • Bug fix: function Term.tsukamoto uses the height in all monotonic terms
  • Bug fix: function Concave.tsukamoto uses parameter y instead of incorrectly
    computing membership(activation_degree)
  • Bug fix: function Ramp.tsukamoto uses height correctly

pyfuzzylite 8.0.0

10 Jan 21:49
b8bdbdc
Compare
Choose a tag to compare

⛔️ Use pyfuzzylite 8.0.1 ⛔️

⛔️ This release only works on Python 3.9 ⛔️

(extract from HISTORY.md)

Summary

New

  • integration with numpy means engines operate more efficiently thanks to vectorization, but the regular operation
    with Python float also works seamlessly
  • fuzzylite/types.py to store library annotation types
  • type fl.Scalar = float | numpy.Array replaces float everywhere vectorization can be used
    (see fuzzylite/types.py)
  • type fl.ScalarArray = numpy.Array[float] used in places where an array of floats is needed (
    see fuzzylite/types.py)
  • function fl.scalar to convert any argument to a fl.Scalar
  • function fl.array maps to np.array
  • function fl.to_float converts any argument to a float, which was the behaviour of fl.Op.scalar.
  • linguistic terms Arc and SemiEllipse
  • indexable components:
    • Engine: get variables or rule blocks by name using square brackets, eg, engine["light"].value
    • Variable: get terms by name using square brackets, eg, variable["low"].membership(value)
    • Factory: get constructors and objects by name using square brackets,
      eg, factory["Triangle"](), factory["sin"](3.14)
  • class Benchmark to benchmark engines
  • from __future__ import annotations in every file to use better type annotations
  • class library.Settings to configure general settings in singleton library.settings
  • class library.Representation to easily convert objects to Python code
  • documentation significantly improved and configured using mkdocs-material, available
    at: fuzzylite.github.io/pyfuzzylite
  • function __len__ in Variable, RuleBlock to get number of components with len(x),
    but also means that implicit boolean statements like if component will evaluate to False when
    component is None or len(component) == 0
  • tsukamoto functions Sigmoid.tsukamoto, SShape.tsukamoto, ZShape.tsukamoto
  • tests, tests and more tests, reaching 95% of code coverage

Changed

  • Requires Python >= 3.9
  • Dual license: GNU GPL and paid proprietary license for commercial purposes
  • All enum values are automatically assigned with enum.auto(), instead of manual assignments
  • Almost all classes redefine __repr__ to return the object as a Python constructor using the
    new fl.library.Representation class
  • Almost all classes redefine __str__ to return the equivalent FuzzyLite Language (if possible)
  • Many more tests and better structure for tests
  • Aggregation operator is now used in TakagiSugeno/Tsukamoto engines on activations of the same term
    (see tests/test_engine.py:test_takagi_sugeno_aggregation_operator)
  • Examples: all file names have been changed to snake_case, and engines wrapped in classes
  • Examples: all examples can be easily imported,
    eg from fuzzylite.examples.mamdani.obstacle_avoidance import ObstacleAvoidance
  • Documentation updated and format changed from doxygen to google style
  • library.settings for default absolute tolerance changed from 1e-5 to 1e-3 to match the default 3 decimals
  • Formatting: code line-width=100 instead of 88
  • Many functions now map or use to numpy functions to support vectorization
  • The following classes are now
    abstract: Activation, Defuzzifier, Exporter, Hedge, Importer, Norm, SNorm, TNorm, Expression
    and Term
  • IntegralDefuzzifiers are simpler, support vectorization, use numpy, and the default resolution is 1000
  • WeightedDefuzzifiers are simpler and use Aggregated.grouped_terms to iterate over the terms and aggregate them
    accordingly
  • Get components by name or index with Engine.input_variable(), Engine.output_variable() or Engine.rule_block()
  • PythonExporter exports code to Python using single-statement constructors
  • FldExporter uses vectorization to export datasets, so for now only works with the General activation method
  • Operators and functions in FunctionFactory map to their equivalent methods in numpy
  • Vectorization support in class activation.General, and
    modules defuzzifier, engine, hedge, norm, rule, term, variable
  • type Rule.triggered to an array of bools to support vectorization
  • type Rule.activation_degree to Scalar to support vectorization
  • renamed parameters of Op.scale from from_[minimum|maximum] to x_[min|max], and to_[minimum|maximum]
    to y_[min|max]
  • function Term.discretize uses Op.midpoints to discretize
  • function Term.discretize uses resolution = 10 instead of 100
  • function Aggregated.activation_degree to support vectorization, so now returns fl.Scalar
  • function fuzzy_value returns Array[np.str_] instead of str to account for vectorization
  • function highest_membership returns Activated | None instead of tuple[float, Term | None]

Removed

  • class library.Library removed and split into library.Settings and library.Information
  • singleton fl.lib. See library.py for settings
  • functions fl.isnan and fl.isinf moved to Op (use now: fl.Op.isnan, fl.Op.isinf)
  • function class_name
    from Activation, Defuzzifier, Exporter, Importer, ConstructionFactory, CloningFactory, Norm, Term;
    use Op.class_name instead
  • parameter decimals from function Op.str()
  • class Discrete.Pair
  • pyhamcrest dependency for tests

Bug fixes

  • Bug fix: Rule.antecedent and Rule.consequent instantiations in Rule constructor
  • Bug fix: Function.update_reference loads function if not loaded
  • Bug fix: function Term.tsukamoto uses the height in all monotonic terms
  • Bug fix: function Concave.tsukamoto uses parameter y instead of incorrectly
    computing membership(activation_degree)
  • Bug fix: function Ramp.tsukamoto uses height correctly

pyfuzzylite 7.1.1

30 Mar 20:46
5684da3
Compare
Choose a tag to compare
  • Fix project metadata on licensing

pyfuzzylite 7.1.0

27 Mar 02:37
8cfe88c
Compare
Choose a tag to compare
  • Dual license: GNU GPL and MIT
  • Requires Python >=3.7
  • Improved tooling (poetry, nox, Github Actions)
  • Documentation everywhere
  • Renamed constructor parameters of term.Spike: inflection->center, slope->width
  • Renamed parameters of term.Triangle: vertex_a->left, vertex_b->top, vertex_c->right
  • Renamed parameters of term.Trapezoid: vertex_a->bottom_left, vertex_b->top_left, vertex_c->top_right, vertex_d->bottom_right

pyfuzzylite 7.0b3

05 Apr 21:53
Compare
Choose a tag to compare
Release: 7.0b3

pyfuzzylite 7.0b2

17 Dec 07:50
Compare
Choose a tag to compare
pyfuzzylite 7.0b2 Pre-release
Pre-release
Release: 7.0b2. Fixed packaging.