Releases: fuzzylite/pyfuzzylite
Releases · fuzzylite/pyfuzzylite
pyfuzzylite 8.0.4
pyfuzzylite 8.0.3
Version 8.0.3
- Renamed
requirements.txt
torequirements-dev.txt
- Added
__author__
,__copyright__
and__license__
tofuzzylite.__init__.py
andfuzzylite.library.information
- Removed
Limited
inFuzzyLite Limited
everywhere, 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
Self
type annotation fromBenchmark
because thetyping_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 Pythonfloat
also works seamlessly fuzzylite/types.py
to store library annotation types- type
fl.Scalar = float | numpy.Array
replacesfloat
everywhere 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.scalar
to convert any argument to afl.Scalar
- function
fl.array
maps tonp.array
- function
fl.to_float
converts any argument to afloat
, which was the behaviour offl.Op.scalar
. - linguistic terms
Arc
andSemiEllipse
- 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 singletonlibrary.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__
inVariable
,RuleBlock
to get number of components withlen(x)
,
but also means that implicit boolean statements likeif component
will evaluate toFalse
when
component is None
orlen(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.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
(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
doxygen
togoogle
style library.settings
for default absolute tolerance changed from1e-5
to1e-3
to match the default 3 decimals- Formatting: code
line-width=100
instead of88
- 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
andTerm
IntegralDefuzzifier
s are simpler, support vectorization, usenumpy
, and the default resolution is 1000WeightedDefuzzifier
s are simpler and useAggregated.grouped_terms
to iterate over the terms and aggregate them
accordingly- Get components by name or index with
Engine.input_variable()
,Engine.output_variable()
orEngine.rule_block()
PythonExporter
exports code to Python using single-statement constructorsFldExporter
uses vectorization to export datasets, so for now only works with theGeneral
activation method- Operators and functions in
FunctionFactory
map to their equivalent methods innumpy
- Vectorization support in class
activation.General
, and
modulesdefuzzifier
,engine
,hedge
,norm
,rule
,term
,variable
- type
Rule.triggered
to an array of bools to support vectorization - type
Rule.activation_degree
toScalar
to support vectorization - renamed parameters of
Op.scale
fromfrom_[minimum|maximum]
tox_[min|max]
, andto_[minimum|maximum]
toy_[min|max]
- function
Term.discretize
usesOp.midpoints
to discretize - function
Term.discretize
usesresolution = 10
instead of100
- function
Aggregated.activation_degree
to support vectorization, so now returnsfl.Scalar
- function
fuzzy_value
returnsArray[np.str_]
instead ofstr
to account for vectorization - function
highest_membership
returnsActivated | None
instead oftuple[float, Term | None]
Removed
- class
library.Library
removed and split intolibrary.Settings
andlibrary.Information
- singleton
fl.lib
. Seelibrary.py
for settings - functions
fl.isnan
andfl.isinf
moved toOp
(use now:fl.Op.isnan
,fl.Op.isinf
) - function
class_name
fromActivation
,Defuzzifier
,Exporter
,Importer
,ConstructionFactory
,CloningFactory
,Norm
,Term
;
useOp.class_name
instead - parameter
decimals
from functionOp.str()
- class
Discrete.Pair
pyhamcrest
dependency for tests
Bug fixes
- Bug fix:
Rule.antecedent
andRule.consequent
instantiations inRule
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 parametery
instead of incorrectly
computingmembership(activation_degree)
- Bug fix: function
Ramp.tsukamoto
uses 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
numpy
means engines operate more efficiently thanks to vectorization, but the regular operation
with Pythonfloat
also works seamlessly fuzzylite/types.py
to store library annotation types- type
fl.Scalar = float | numpy.Array
replacesfloat
everywhere 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.scalar
to convert any argument to afl.Scalar
- function
fl.array
maps tonp.array
- function
fl.to_float
converts any argument to afloat
, which was the behaviour offl.Op.scalar
. - linguistic terms
Arc
andSemiEllipse
- 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 singletonlibrary.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__
inVariable
,RuleBlock
to get number of components withlen(x)
,
but also means that implicit boolean statements likeif component
will evaluate toFalse
when
component is None
orlen(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.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
(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
doxygen
togoogle
style library.settings
for default absolute tolerance changed from1e-5
to1e-3
to match the default 3 decimals- Formatting: code
line-width=100
instead of88
- 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
andTerm
IntegralDefuzzifier
s are simpler, support vectorization, usenumpy
, and the default resolution is 1000WeightedDefuzzifier
s are simpler and useAggregated.grouped_terms
to iterate over the terms and aggregate them
accordingly- Get components by name or index with
Engine.input_variable()
,Engine.output_variable()
orEngine.rule_block()
PythonExporter
exports code to Python using single-statement constructorsFldExporter
uses vectorization to export datasets, so for now only works with theGeneral
activation method- Operators and functions in
FunctionFactory
map to their equivalent methods innumpy
- Vectorization support in class
activation.General
, and
modulesdefuzzifier
,engine
,hedge
,norm
,rule
,term
,variable
- type
Rule.triggered
to an array of bools to support vectorization - type
Rule.activation_degree
toScalar
to support vectorization - renamed parameters of
Op.scale
fromfrom_[minimum|maximum]
tox_[min|max]
, andto_[minimum|maximum]
toy_[min|max]
- function
Term.discretize
usesOp.midpoints
to discretize - function
Term.discretize
usesresolution = 10
instead of100
- function
Aggregated.activation_degree
to support vectorization, so now returnsfl.Scalar
- function
fuzzy_value
returnsArray[np.str_]
instead ofstr
to account for vectorization - function
highest_membership
returnsActivated | None
instead oftuple[float, Term | None]
Removed
- class
library.Library
removed and split intolibrary.Settings
andlibrary.Information
- singleton
fl.lib
. Seelibrary.py
for settings - functions
fl.isnan
andfl.isinf
moved toOp
(use now:fl.Op.isnan
,fl.Op.isinf
) - function
class_name
fromActivation
,Defuzzifier
,Exporter
,Importer
,ConstructionFactory
,CloningFactory
,Norm
,Term
;
useOp.class_name
instead - parameter
decimals
from functionOp.str()
- class
Discrete.Pair
pyhamcrest
dependency for tests
Bug fixes
- Bug fix:
Rule.antecedent
andRule.consequent
instantiations inRule
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 parametery
instead of incorrectly
computingmembership(activation_degree)
- Bug fix: function
Ramp.tsukamoto
uses 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
pyfuzzylite 7.0b2
Release: 7.0b2. Fixed packaging.