Skip to content

Settings

Settings

Settings for the library.

Attributes

_factory_manager instance-attribute

_factory_manager = factory_manager

alias instance-attribute

alias = alias

atol instance-attribute

atol = atol

debugging property writable

debugging: bool

Get/Set the library in debug mode.

Getter

Returns:

Type Description
bool

whether the library is in debug mode

Setter

Parameters:

Name Type Description Default
value bool

set logging level to DEBUG if true, and to ERROR otherwise

required

decimals instance-attribute

decimals = decimals

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

float_type instance-attribute

float_type = float_type

logger instance-attribute

logger = logger or getLogger('fuzzylite')

rtol instance-attribute

rtol = rtol

Functions

__init__

__init__(
    float_type: Any = np.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, __repr__()). Cases: - fully qualified package when alias == "" (eg, fuzzylite.term.Constant(name="A", height=1.0)) - no prefixes when alias == "*" (eg, Constant(name="A", height=1.0)) - alias otherwise (eg, {alias}.Constant(name="A", height=1.0)

'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
Generator[None, None, None]

context with specific settings.