# alessio-28/sdfl architecture

> Architecture diagram of the GitHub repository alessio-28/sdfl, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/alessio-28/sdfl
- Repository: https://github.com/alessio-28/sdfl

## Overview

SDFL is a command-line runner for a stochastic derivative-free linesearch optimization algorithm. Users select a built-in benchmark or provide a problem in problem.py, configure limits and algorithm parameters, then run the optimizer and receive a result; verbose mode is available. The graph also shows the configuration and problem-loading branches. The CLI-to-runner and configuration links are visible in excerpts, but the implementation of the test runner and problem manager was not sampled, so their algorithm-dispatch and catalog-loading links are left unverified.

Main entry points: [`src/scripts/cli.py`](https://github.com/alessio-28/sdfl/blob/main/src/scripts/cli.py) (CLI), [`src/scripts/data_json.py`](https://github.com/alessio-28/sdfl/blob/main/src/scripts/data_json.py) (Configuration I/O), [`src/sdfl/core/sdfl.py`](https://github.com/alessio-28/sdfl/blob/main/src/sdfl/core/sdfl.py) (SDFL algorithm), [`run.py`](https://github.com/alessio-28/sdfl/blob/main/run.py) (Launcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI entry"]
  node_launcher["Launcher<br/>[run.py]"]
  node_cli["CLI<br/>[cli.py]"]
end

subgraph group_inputs["Problem inputs"]
  node_manager["Problem manager<br/>[problem_manager.py]"]
  node_benchmarks["Benchmarks"]
  node_file_loader["File problem loader"]
  node_custom_problem["Custom problem<br/>[problem.py]"]
end

subgraph group_config["Run configuration"]
  node_json_config["JSON configuration<br/>[data.json]"]
  node_config_io["Configuration I/O<br/>[data_json.py]"]
  node_config_defaults["Defaults and schema<br/>[constants.py]"]
  node_run_data["Run data<br/>[sdfl_data.py]"]
end

subgraph group_engine["Optimization engine"]
  node_parameters["Algorithm parameters<br/>[parameters.py]"]
  node_runner["Test runner<br/>[run_test.py]"]
  node_algorithm["SDFL algorithm<br/>[sdfl.py]"]
  node_types["Objective types<br/>[typing.py]"]
end

node_user(("User"))

node_user -->|"runs"| node_launcher
node_launcher -->|"invokes"| node_cli
node_cli -->|"selects benchmark"| node_manager
node_cli -->|"loads custom problem"| node_file_loader
node_file_loader -->|"loads"| node_custom_problem
node_manager -.->|"provides problems"| node_benchmarks
node_cli -->|"reads and updates"| node_config_io
node_config_io -->|"reads and writes"| node_json_config
node_config_io -->|"uses defaults"| node_config_defaults
node_config_io -->|"constructs"| node_parameters
node_config_io -->|"builds"| node_run_data
node_cli -->|"runs"| node_runner
node_runner -.->|"dispatches to"| node_algorithm
node_algorithm -.->|"uses"| node_parameters
node_algorithm -->|"uses types"| node_types

click node_launcher "https://github.com/alessio-28/sdfl/blob/main/run.py"
click node_cli "https://github.com/alessio-28/sdfl/blob/main/src/scripts/cli.py"
click node_manager "https://github.com/alessio-28/sdfl/blob/main/src/test/problem_manager.py"
click node_benchmarks "https://github.com/alessio-28/sdfl/tree/main/src/test/problems"
click node_file_loader "https://github.com/alessio-28/sdfl/blob/main/src/scripts/problem_from_file.py"
click node_custom_problem "https://github.com/alessio-28/sdfl/blob/main/problem.py"
click node_json_config "https://github.com/alessio-28/sdfl/blob/main/data.json"
click node_config_io "https://github.com/alessio-28/sdfl/blob/main/src/scripts/data_json.py"
click node_config_defaults "https://github.com/alessio-28/sdfl/blob/main/src/scripts/constants.py"
click node_run_data "https://github.com/alessio-28/sdfl/blob/main/src/scripts/sdfl_data.py"
click node_parameters "https://github.com/alessio-28/sdfl/blob/main/src/sdfl/core/parameters.py"
click node_runner "https://github.com/alessio-28/sdfl/blob/main/src/test/run_test.py"
click node_algorithm "https://github.com/alessio-28/sdfl/blob/main/src/sdfl/core/sdfl.py"
click node_types "https://github.com/alessio-28/sdfl/blob/main/src/sdfl/core/typing.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_launcher,node_cli,node_user toneBlue
class node_manager,node_benchmarks,node_file_loader,node_custom_problem toneAmber
class node_json_config,node_config_io,node_config_defaults,node_run_data toneMint
class node_parameters,node_runner,node_algorithm,node_types toneRose
```

## Components

### CLI entry

- [Launcher](https://github.com/alessio-28/sdfl/blob/main/run.py): `run.py`
- [CLI](https://github.com/alessio-28/sdfl/blob/main/src/scripts/cli.py): `src/scripts/cli.py`

### Problem inputs

- [Problem manager](https://github.com/alessio-28/sdfl/blob/main/src/test/problem_manager.py): `src/test/problem_manager.py`
- [Benchmarks](https://github.com/alessio-28/sdfl/tree/main/src/test/problems): `src/test/problems`
- [File problem loader](https://github.com/alessio-28/sdfl/blob/main/src/scripts/problem_from_file.py): `src/scripts/problem_from_file.py`
- [Custom problem](https://github.com/alessio-28/sdfl/blob/main/problem.py): `problem.py`

### Run configuration

- [JSON configuration](https://github.com/alessio-28/sdfl/blob/main/data.json): `data.json`
- [Configuration I/O](https://github.com/alessio-28/sdfl/blob/main/src/scripts/data_json.py): `src/scripts/data_json.py`
- [Defaults and schema](https://github.com/alessio-28/sdfl/blob/main/src/scripts/constants.py): `src/scripts/constants.py`
- [Run data](https://github.com/alessio-28/sdfl/blob/main/src/scripts/sdfl_data.py): `src/scripts/sdfl_data.py`

### Optimization engine

- [Algorithm parameters](https://github.com/alessio-28/sdfl/blob/main/src/sdfl/core/parameters.py): `src/sdfl/core/parameters.py`
- [Test runner](https://github.com/alessio-28/sdfl/blob/main/src/test/run_test.py): `src/test/run_test.py`
- [SDFL algorithm](https://github.com/alessio-28/sdfl/blob/main/src/sdfl/core/sdfl.py): `src/sdfl/core/sdfl.py`
- [Objective types](https://github.com/alessio-28/sdfl/blob/main/src/sdfl/core/typing.py): `src/sdfl/core/typing.py`

### Other components

- **User**

## Connections

- User → Launcher: runs (evidence: `README.md`)
- Launcher → CLI: invokes (evidence: `run.py`)
- CLI → Problem manager: selects benchmark (evidence: `src/scripts/cli.py`)
- CLI → File problem loader: loads custom problem (evidence: `src/scripts/cli.py`)
- File problem loader → Custom problem: loads (evidence: `src/scripts/problem_from_file.py`)
- Problem manager → Benchmarks: provides problems
- CLI → Configuration I/O: reads and updates (evidence: `src/scripts/cli.py`)
- Configuration I/O → JSON configuration: reads and writes (evidence: `src/scripts/data_json.py`)
- Configuration I/O → Defaults and schema: uses defaults (evidence: `src/scripts/data_json.py`)
- Configuration I/O → Algorithm parameters: constructs (evidence: `src/scripts/data_json.py`)
- Configuration I/O → Run data: builds (evidence: `src/scripts/data_json.py`)
- CLI → Test runner: runs (evidence: `src/scripts/cli.py`)
- Test runner → SDFL algorithm: dispatches to
- SDFL algorithm → Algorithm parameters: uses (evidence: `src/sdfl/core/sdfl.py`)
- SDFL algorithm → Objective types: uses types (evidence: `src/sdfl/core/sdfl.py`)
