Recent Releases of pyfuzzylite

pyfuzzylite - 8.0.5

What's Changed

  • Fix: output variable can set default values by @jcrada in https://github.com/fuzzylite/pyfuzzylite/pull/92

Full Changelog: https://github.com/fuzzylite/pyfuzzylite/compare/8.0.4...8.0.5

- Python
Published by jcrada 11 months ago

pyfuzzylite - pyfuzzylite 8.0.4

Updated poetry to v2 and workflow package to publish.

- Python
Published by jcrada over 1 year ago

pyfuzzylite - pyfuzzylite 8.0.3

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

- Python
Published by jcrada about 2 years ago

pyfuzzylite - pyfuzzylite 8.0.2

Bug fix: engine.[input|output]_values

- Python
Published by jcrada about 2 years ago

pyfuzzylite - pyfuzzylite 8.0.1

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

- Python
Published by jcrada over 2 years ago

pyfuzzylite - pyfuzzylite 8.0.0

(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

- Python
Published by jcrada over 2 years ago

pyfuzzylite - pyfuzzylite 7.1.1

  • Fix project metadata on licensing

- Python
Published by jcrada about 3 years ago

pyfuzzylite - pyfuzzylite 7.1.0

  • 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: vertexa->left, vertexb->top, vertex_c->right
  • Renamed parameters of term.Trapezoid: vertexa->bottomleft, vertexb->topleft, vertexc->topright, vertexd->bottomright

- Python
Published by jcrada about 3 years ago

pyfuzzylite - pyfuzzylite 7.0b3

- Python
Published by jcrada about 6 years ago

pyfuzzylite - pyfuzzylite 7.0b2

- Python
Published by jcrada over 6 years ago