Library
Information
dataclass
¶
Information about the library.
Attributes¶
copyright
class-attribute
instance-attribute
¶
copyright: Final[str] = 'Copyright (C) 2010-2024 FuzzyLite by Juan Rada-Vilela. All rights reserved.'
description
class-attribute
instance-attribute
¶
version
property
¶
version: str
Automatic version of the library handled by poetry using [tool.poetry_bumpversion.file."fuzzylite/library.py"]
.
Returns:
Type | Description |
---|---|
str
|
version of the library |
Functions¶
__init__
¶
__init__(
name: Final[str] = "fuzzylite",
description: Final[str] = "a fuzzy logic control library in Python",
license: Final[str] = "FuzzyLite License",
author: Final[str] = "Juan Rada-Vilela, PhD",
author_email: Final[str] = "jcrada@fuzzylite.com",
company: Final[str] = "FuzzyLite",
website: Final[str] = "https://fuzzylite.com/",
copyright: Final[str] = "Copyright (C) 2010-2024 FuzzyLite by Juan Rada-Vilela. All rights reserved.",
) -> None
Representation
¶
Bases: Repr
Representation class for the library.
Attributes¶
Functions¶
__repr__
¶
__repr__() -> str
Return code to construct the representation in Python.
Returns:
Type | Description |
---|---|
str
|
code to construct the representation in Python |
as_constructor
¶
as_constructor(
x: T, /, fields: dict[str, Any] | None = None, *, positional: bool = False, cast_as: type[T] | None = None
) -> str
Return the Python code to use the constructor of the object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
T
|
object to construct |
required |
fields
|
dict[str, Any] | None
|
override the parameters and arguments to use in the constructor |
None
|
positional
|
bool
|
use positional parameters if |
False
|
cast_as
|
type[T] | None
|
type to upcast the object (useful in inheritance approaches) |
None
|
Returns:
Type | Description |
---|---|
str
|
Python code to use the constructor of the object. |
construction_arguments
¶
construction_arguments(
x: T, /, fields: dict[str, Any] | None = None, *, positional: bool = False, cast_as: type[T] | None = None
) -> list[str]
Return the list of parameters and arguments for the constructor of the object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
T
|
object to construct |
required |
fields
|
dict[str, Any] | None
|
override the parameters and arguments to use in the constructor |
None
|
positional
|
bool
|
use positional parameters if |
False
|
cast_as
|
type[T] | None
|
type to upcast the object (useful in inheritance approaches) |
None
|
Returns:
Type | Description |
---|---|
list[str]
|
list of parameters and arguments for the constructor of the object. |
import_statement
¶
import_statement() -> str
Return the library's import statement based on the alias in the settings.
related
Returns:
Type | Description |
---|---|
str
|
library's import statement based on the alias in the settings. |
package_of
¶
repr_float
¶
repr_ndarray
¶
Settings
¶
Settings for the library.
Attributes¶
factory_manager
property
writable
¶
factory_manager: FactoryManager
Get/Set the factory manager.
Getter¶
Returns:
Type | Description |
---|---|
FactoryManager
|
factory manager |
Setter¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
FactoryManager
|
factory manager |
required |
Functions¶
__init__
¶
__init__(
float_type: Any = float64,
decimals: int = 3,
atol: float = 0.001,
rtol: float = 0.0,
alias: str = "fl",
logger: Logger | None = None,
factory_manager: FactoryManager | None = None,
) -> None
Constructor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
float_type
|
Any
|
floating point type. |
float64
|
decimals
|
int
|
number of decimals. |
3
|
atol
|
float
|
absolute tolerance. |
0.001
|
rtol
|
float
|
relative tolerance. |
0.0
|
alias
|
str
|
alias to use when representing objects (ie, |
'fl'
|
logger
|
Logger | None
|
logger. |
None
|
factory_manager
|
FactoryManager | None
|
factory manager. |
None
|
__repr__
¶
__repr__() -> str
Return code to construct the settings in Python.
Returns:
Type | Description |
---|---|
str
|
code to construct the settings in Python |
context
¶
context(
*,
float_type: Any | None = None,
decimals: int | None = None,
atol: float | None = None,
rtol: float | None = None,
alias: str | None = None,
logger: Logger | None = None,
factory_manager: FactoryManager | None = None
) -> Generator[None, None, None]
Create a context with specific settings.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
float_type
|
Any | None
|
floating point type |
None
|
decimals
|
int | None
|
number of decimals. |
None
|
atol
|
float | None
|
absolute tolerance. |
None
|
rtol
|
float | None
|
relative tolerance. |
None
|
alias
|
str | None
|
alias for the library. |
None
|
logger
|
Logger | None
|
logger. |
None
|
factory_manager
|
FactoryManager | None
|
factory manager. |
None
|
Returns:
Type | Description |
---|---|
None
|
context with specific settings. |
scalar
¶
Convert the values into a floating point value defined by the library.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
Sequence[Any] | Array[Any] | Any
|
value to convert. |
required |
**kwargs
|
Any
|
keyword arguments to pass to numpy.asarray |
{}
|
Returns:
Type | Description |
---|---|
ScalarArray | Scalar
|
array of converted values |