settings.py

Overview

The settings.py file serves as a configuration module within the InfiniFlow project. It defines global constants that are used across the system to maintain consistency and control specific parameters related to numerical precision and algorithmic constraints.

Currently, this file contains two constants:

By centralizing these values in settings.py, the project ensures easy maintenance and adjustment of key parameters without scattering "magic numbers" throughout the codebase.


Constants

FLOAT_ZERO

FLOAT_ZERO = 1e-8
from settings import FLOAT_ZERO

def is_effectively_zero(value: float) -> bool:
    return abs(value) < FLOAT_ZERO

# Usage
val = 1e-9
if is_effectively_zero(val):
    print("Value is effectively zero.")

PARAM_MAXDEPTH

PARAM_MAXDEPTH = 5
from settings import PARAM_MAXDEPTH

def recursive_function(current_depth=0):
    if current_depth > PARAM_MAXDEPTH:
        return
    # Continue processing
    recursive_function(current_depth + 1)

Interaction with Other System Components

Since this file currently only defines constants, it does not directly interact with other parts via function calls or class instances but serves as a dependency for configuration values.


Diagram: Constants Overview

flowchart TD
    A[settings.py] --> B[FLOAT_ZERO]
    A --> C[PARAM_MAXDEPTH]
    B -->|Used in| D[Floating-point comparisons]
    C -->|Used in| E[Depth-limited algorithms]

Summary


If future expansions add classes or functions, this documentation should be updated accordingly to include their detailed descriptions and usage.