Releases: fuzzylite/pyfuzzylite
Releases · fuzzylite/pyfuzzylite
pyfuzzylite 8.0.6
Fix bug when output variables lock output values and the engine is used with scalars instead of numpy arrays (fuzzylite/help#14)
8.0.5
pyfuzzylite 8.0.4
Updated poetry to v2 and workflow package to publish.
pyfuzzylite 8.0.3
Version 8.0.3
- Renamed
requirements.txttorequirements-dev.txt - Added
__author__,__copyright__and__license__tofuzzylite.__init__.pyandfuzzylite.library.information - Removed
LimitedinFuzzyLite Limitedeverywhere, eg,fuzzylite.information.company = "FuzzyLite" RuleBlock: AddedRuleBlock.rule(int)to get rule by indexFunction: 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
Bug fix: engine.[input|output]_values
pyfuzzylite 8.0.1
Version 8.0.1
Bug fixes
- On Python 3.10|3.11: Removed
Selftype annotation fromBenchmarkbecause thetyping_extensionsmodule
cannot be found - On Python 3.12: Explicitly increasing values of
fl.Representationto avoid errors from new values
Version 8.0.0
Summary
New
- integration with
numpymeans engines operate more efficiently thanks to vectorization, but the regular operation
with Pythonfloatalso works seamlessly fuzzylite/types.pyto store library annotation types- type
fl.Scalar = float | numpy.Arrayreplacesfloateverywhere vectorization can be used
(seefuzzylite/types.py) - type
fl.ScalarArray = numpy.Array[float]used in places where an array of floats is needed (
seefuzzylite/types.py) - function
fl.scalarto convert any argument to afl.Scalar - function
fl.arraymaps tonp.array - function
fl.to_floatconverts any argument to afloat, which was the behaviour offl.Op.scalar. - linguistic terms
ArcandSemiEllipse - indexable components:
Engine: get variables or rule blocks by name using square brackets, eg,engine["light"].valueVariable: 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
Benchmarkto benchmark engines from __future__ import annotationsin every file to use better type annotations- class
library.Settingsto configure general settings in singletonlibrary.settings - class
library.Representationto easily convert objects to Python code - documentation significantly improved and configured using
mkdocs-material, available
at: fuzzylite.github.io/pyfuzzylite - function
__len__inVariable,RuleBlockto get number of components withlen(x),
but also means that implicit boolean statements likeif componentwill evaluate toFalsewhen
component is Noneorlen(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
newfl.library.Representationclass - 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
(seetests/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,
egfrom fuzzylite.examples.mamdani.obstacle_avoidance import ObstacleAvoidance - Documentation updated and format changed from
doxygentogooglestyle library.settingsfor default absolute tolerance changed from1e-5to1e-3to match the default 3 decimals- Formatting: code
line-width=100instead of88 - Many functions now map or use to
numpyfunctions to support vectorization - The following classes are now
abstract:Activation,Defuzzifier,Exporter,Hedge,Importer,Norm,SNorm,TNorm,Expression
andTerm IntegralDefuzzifiers are simpler, support vectorization, usenumpy, and the default resolution is 1000WeightedDefuzzifiers are simpler and useAggregated.grouped_termsto iterate over the terms and aggregate them
accordingly- Get components by name or index with
Engine.input_variable(),Engine.output_variable()orEngine.rule_block() PythonExporterexports code to Python using single-statement constructorsFldExporteruses vectorization to export datasets, so for now only works with theGeneralactivation method- Operators and functions in
FunctionFactorymap to their equivalent methods innumpy - Vectorization support in class
activation.General, and
modulesdefuzzifier,engine,hedge,norm,rule,term,variable - type
Rule.triggeredto an array of bools to support vectorization - type
Rule.activation_degreetoScalarto support vectorization - renamed parameters of
Op.scalefromfrom_[minimum|maximum]tox_[min|max], andto_[minimum|maximum]
toy_[min|max] - function
Term.discretizeusesOp.midpointsto discretize - function
Term.discretizeusesresolution = 10instead of100 - function
Aggregated.activation_degreeto support vectorization, so now returnsfl.Scalar - function
fuzzy_valuereturnsArray[np.str_]instead ofstrto account for vectorization - function
highest_membershipreturnsActivated | Noneinstead oftuple[float, Term | None]
Removed
- class
library.Libraryremoved and split intolibrary.Settingsandlibrary.Information - singleton
fl.lib. Seelibrary.pyfor settings - functions
fl.isnanandfl.isinfmoved toOp(use now:fl.Op.isnan,fl.Op.isinf) - function
class_name
fromActivation,Defuzzifier,Exporter,Importer,ConstructionFactory,CloningFactory,Norm,Term;
useOp.class_nameinstead - parameter
decimalsfrom functionOp.str() - class
Discrete.Pair pyhamcrestdependency for tests
Bug fixes
- Bug fix:
Rule.antecedentandRule.consequentinstantiations inRuleconstructor - Bug fix:
Function.update_referenceloads function if not loaded - Bug fix: function
Term.tsukamotouses the height in all monotonic terms - Bug fix: function
Concave.tsukamotouses parameteryinstead of incorrectly
computingmembership(activation_degree) - Bug fix: function
Ramp.tsukamotouses height correctly
pyfuzzylite 8.0.0
⛔️ Use pyfuzzylite 8.0.1 ⛔️
⛔️ This release only works on Python 3.9 ⛔️
(extract from HISTORY.md)
Summary
New
- integration with
numpymeans engines operate more efficiently thanks to vectorization, but the regular operation
with Pythonfloatalso works seamlessly fuzzylite/types.pyto store library annotation types- type
fl.Scalar = float | numpy.Arrayreplacesfloateverywhere vectorization can be used
(seefuzzylite/types.py) - type
fl.ScalarArray = numpy.Array[float]used in places where an array of floats is needed (
seefuzzylite/types.py) - function
fl.scalarto convert any argument to afl.Scalar - function
fl.arraymaps tonp.array - function
fl.to_floatconverts any argument to afloat, which was the behaviour offl.Op.scalar. - linguistic terms
ArcandSemiEllipse - indexable components:
Engine: get variables or rule blocks by name using square brackets, eg,engine["light"].valueVariable: 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
Benchmarkto benchmark engines from __future__ import annotationsin every file to use better type annotations- class
library.Settingsto configure general settings in singletonlibrary.settings - class
library.Representationto easily convert objects to Python code - documentation significantly improved and configured using
mkdocs-material, available
at: fuzzylite.github.io/pyfuzzylite - function
__len__inVariable,RuleBlockto get number of components withlen(x),
but also means that implicit boolean statements likeif componentwill evaluate toFalsewhen
component is Noneorlen(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
newfl.library.Representationclass - 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
(seetests/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,
egfrom fuzzylite.examples.mamdani.obstacle_avoidance import ObstacleAvoidance - Documentation updated and format changed from
doxygentogooglestyle library.settingsfor default absolute tolerance changed from1e-5to1e-3to match the default 3 decimals- Formatting: code
line-width=100instead of88 - Many functions now map or use to
numpyfunctions to support vectorization - The following classes are now
abstract:Activation,Defuzzifier,Exporter,Hedge,Importer,Norm,SNorm,TNorm,Expression
andTerm IntegralDefuzzifiers are simpler, support vectorization, usenumpy, and the default resolution is 1000WeightedDefuzzifiers are simpler and useAggregated.grouped_termsto iterate over the terms and aggregate them
accordingly- Get components by name or index with
Engine.input_variable(),Engine.output_variable()orEngine.rule_block() PythonExporterexports code to Python using single-statement constructorsFldExporteruses vectorization to export datasets, so for now only works with theGeneralactivation method- Operators and functions in
FunctionFactorymap to their equivalent methods innumpy - Vectorization support in class
activation.General, and
modulesdefuzzifier,engine,hedge,norm,rule,term,variable - type
Rule.triggeredto an array of bools to support vectorization - type
Rule.activation_degreetoScalarto support vectorization - renamed parameters of
Op.scalefromfrom_[minimum|maximum]tox_[min|max], andto_[minimum|maximum]
toy_[min|max] - function
Term.discretizeusesOp.midpointsto discretize - function
Term.discretizeusesresolution = 10instead of100 - function
Aggregated.activation_degreeto support vectorization, so now returnsfl.Scalar - function
fuzzy_valuereturnsArray[np.str_]instead ofstrto account for vectorization - function
highest_membershipreturnsActivated | Noneinstead oftuple[float, Term | None]
Removed
- class
library.Libraryremoved and split intolibrary.Settingsandlibrary.Information - singleton
fl.lib. Seelibrary.pyfor settings - functions
fl.isnanandfl.isinfmoved toOp(use now:fl.Op.isnan,fl.Op.isinf) - function
class_name
fromActivation,Defuzzifier,Exporter,Importer,ConstructionFactory,CloningFactory,Norm,Term;
useOp.class_nameinstead - parameter
decimalsfrom functionOp.str() - class
Discrete.Pair pyhamcrestdependency for tests
Bug fixes
- Bug fix:
Rule.antecedentandRule.consequentinstantiations inRuleconstructor - Bug fix:
Function.update_referenceloads function if not loaded - Bug fix: function
Term.tsukamotouses the height in all monotonic terms - Bug fix: function
Concave.tsukamotouses parameteryinstead of incorrectly
computingmembership(activation_degree) - Bug fix: function
Ramp.tsukamotouses height correctly
pyfuzzylite 7.1.1
- Fix project metadata on licensing
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: 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
Release: 7.0b3