# minlong1/neo architecture

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

- Interactive diagram: https://gitdiagram.com/minlong1/neo
- Repository: https://github.com/minlong1/neo

## Overview

NEO is a scientific fitting framework: users provide spectra or measurement data and fit settings, a physics module prepares a domain-specific optimization problem, and an optimization algorithm produces fit results. The shared solver framework serves EXAFS, NanoIndentation, and Raman; EXAFS also documents a direct DE-step route, while XPS maintains its own optimization loop. The graph retains documented fitting capabilities and GUIs. Several application internals were not sampled, so uncertain implementation links are omitted; dashed links mark documented but not source-traced integration.

Main entry points: [`Solvers/__init__.py`](https://github.com/minlong1/neo/blob/main/Solvers/__init__.py) (Solver registry), [`Solvers/core/base_solver.py`](https://github.com/minlong1/neo/blob/main/Solvers/core/base_solver.py) (Solver lifecycle), [`PhysicsModules/AstroNeo/astro_neo/problem.py`](https://github.com/minlong1/neo/blob/main/PhysicsModules/AstroNeo/astro_neo/problem.py) (Cash-statistic fit), [`PhysicsModules/EXAFS/exafs_neo/exafs_pop.py`](https://github.com/minlong1/neo/blob/main/PhysicsModules/EXAFS/exafs_neo/exafs_pop.py) (EXAFS generation fit)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_framework["Solver framework"]
  node_solver_api["Solver registry<br/>[__init__.py]"]
  node_base_solver["Solver lifecycle<br/>[base_solver.py]"]
  node_population["Population scoring<br/>[population.py]"]
  node_parameter_space["Parameter space<br/>[parameter_space.py]"]
  node_solver_families["Optimization methods"]
  node_demcmc["DE-BNN sampling<br/>[demcmc_solver.py]"]
  node_posterior["Posterior prediction<br/>[posterior.py]"]
end

subgraph group_exafs["EXAFS fitting"]
  node_exafs_input["EXAFS input<br/>[parser.py]"]
  node_exafs_fit["EXAFS generation fit<br/>[exafs_pop.py]"]
  node_exafs_analysis["EXAFS analysis<br/>[EXAFS_Analysis.py]"]
  node_exafs_gui["EXAFS GUI<br/>[XAFS_GUI.py]"]
end

subgraph group_otherfits["Other shared fits"]
  node_nano_input["Nano input<br/>[parser.py]"]
  node_nano_fit["Oliver-Pharr fit<br/>[nano_indent.py]"]
  node_nano_gui["Nano GUI analysis"]
  node_raman_input["Raman input<br/>[parser.py]"]
  node_raman_fit["Raman band fitting<br/>[problem.py]"]
  node_raman_analysis["Raman analysis<br/>[raman_analysis.py]"]
end

subgraph group_xps["XPS fitting"]
  node_xps_input["XPS configuration<br/>[ini_parser.py]"]
  node_xps_loop["XPS fit loop<br/>[xps.py]"]
  node_xps_model["Peak and background models<br/>[xps_fit.py]"]
  node_xps_gui["XPS GUI<br/>[xps_neo_gui.py]"]
end

subgraph group_astro["Astro fitting"]
  node_astro_input["Astro input<br/>[parser.py]"]
  node_astro_model["X-ray spectral model<br/>[model.py]"]
  node_astro_problem["Cash-statistic fit<br/>[problem.py]"]
end

node_user(("Research user"))

node_user -->|"supplies settings"| node_exafs_input
node_user -->|"supplies settings"| node_nano_input
node_user -->|"supplies settings"| node_raman_input
node_user -->|"supplies settings"| node_xps_input
node_user -->|"supplies settings"| node_astro_input
node_solver_api -.->|"creates solver"| node_base_solver
node_base_solver -->|"runs generations"| node_population
node_population -.->|"samples parameters"| node_parameter_space
node_solver_families -->|"extends lifecycle"| node_base_solver
node_demcmc -->|"extends lifecycle"| node_base_solver
node_demcmc -->|"collects samples"| node_posterior
node_exafs_input -.->|"configures fit"| node_exafs_fit
node_exafs_fit -->|"uses DE step"| node_solver_families
node_exafs_analysis -.->|"analyzes fit"| node_exafs_fit
node_exafs_gui -->|"opens analysis"| node_exafs_analysis
node_nano_input -.->|"configures fit"| node_nano_fit
node_nano_fit -.->|"uses shared solvers"| node_solver_api
node_nano_gui -.->|"supports fitting"| node_nano_fit
node_raman_input -.->|"configures fit"| node_raman_fit
node_raman_fit -.->|"uses shared solvers"| node_solver_api
node_raman_analysis -->|"scores spectra"| node_raman_fit
node_xps_input -.->|"configures fit"| node_xps_loop
node_xps_loop -.->|"fits peaks"| node_xps_model
node_xps_gui -.->|"launches workflow"| node_xps_loop
node_astro_input -.->|"configures fit"| node_astro_problem
node_astro_problem -.->|"evaluates model"| node_astro_model
node_astro_problem -.->|"uses shared solvers"| node_solver_api

click node_solver_api "https://github.com/minlong1/neo/blob/main/Solvers/__init__.py"
click node_base_solver "https://github.com/minlong1/neo/blob/main/Solvers/core/base_solver.py"
click node_population "https://github.com/minlong1/neo/blob/main/Solvers/core/population.py"
click node_parameter_space "https://github.com/minlong1/neo/blob/main/Solvers/core/parameter_space.py"
click node_solver_families "https://github.com/minlong1/neo/tree/main/Solvers"
click node_demcmc "https://github.com/minlong1/neo/blob/main/Solvers/demcmc/demcmc_solver.py"
click node_posterior "https://github.com/minlong1/neo/blob/main/Solvers/demcmc/posterior.py"
click node_exafs_input "https://github.com/minlong1/neo/blob/main/PhysicsModules/EXAFS/exafs_neo/parser.py"
click node_exafs_fit "https://github.com/minlong1/neo/blob/main/PhysicsModules/EXAFS/exafs_neo/exafs_pop.py"
click node_exafs_analysis "https://github.com/minlong1/neo/blob/main/PhysicsModules/EXAFS/exafs_neo/analysis/EXAFS_Analysis.py"
click node_exafs_gui "https://github.com/minlong1/neo/blob/main/PhysicsModules/EXAFS/exafs_neo/gui/XAFS_GUI.py"
click node_nano_input "https://github.com/minlong1/neo/blob/main/PhysicsModules/NanoIndentation/nanoindentation_neo/parser.py"
click node_nano_fit "https://github.com/minlong1/neo/blob/main/PhysicsModules/NanoIndentation/nanoindentation_neo/nano_indent.py"
click node_nano_gui "https://github.com/minlong1/neo/blob/main/PhysicsModules/NanoIndentation/nanoindentation_neo/gui/NanoIndent_Analysis.py"
click node_raman_input "https://github.com/minlong1/neo/blob/main/PhysicsModules/Raman/raman_neo/parser.py"
click node_raman_fit "https://github.com/minlong1/neo/blob/main/PhysicsModules/Raman/raman_neo/problem.py"
click node_raman_analysis "https://github.com/minlong1/neo/blob/main/PhysicsModules/Raman/raman_neo/analysis/raman_analysis.py"
click node_xps_input "https://github.com/minlong1/neo/blob/main/PhysicsModules/XPS/xps_neo/ini_parser.py"
click node_xps_loop "https://github.com/minlong1/neo/blob/main/PhysicsModules/XPS/xps_neo/xps.py"
click node_xps_model "https://github.com/minlong1/neo/blob/main/PhysicsModules/XPS/xps_neo/xps_fit.py"
click node_xps_gui "https://github.com/minlong1/neo/blob/main/PhysicsModules/XPS/xps_neo/gui/xps_neo_gui.py"
click node_astro_input "https://github.com/minlong1/neo/blob/main/PhysicsModules/AstroNeo/astro_neo/parser.py"
click node_astro_model "https://github.com/minlong1/neo/blob/main/PhysicsModules/AstroNeo/astro_neo/model.py"
click node_astro_problem "https://github.com/minlong1/neo/blob/main/PhysicsModules/AstroNeo/astro_neo/problem.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_solver_api,node_base_solver,node_population,node_parameter_space,node_solver_families,node_demcmc,node_posterior,node_user toneBlue
class node_exafs_input,node_exafs_fit,node_exafs_analysis,node_exafs_gui toneAmber
class node_nano_input,node_nano_fit,node_nano_gui,node_raman_input,node_raman_fit,node_raman_analysis toneMint
class node_xps_input,node_xps_loop,node_xps_model,node_xps_gui toneRose
class node_astro_input,node_astro_model,node_astro_problem toneIndigo
```

## Components

### Solver framework

- [Solver registry](https://github.com/minlong1/neo/blob/main/Solvers/__init__.py): `Solvers/__init__.py`
- [Solver lifecycle](https://github.com/minlong1/neo/blob/main/Solvers/core/base_solver.py): `Solvers/core/base_solver.py`
- [Population scoring](https://github.com/minlong1/neo/blob/main/Solvers/core/population.py): `Solvers/core/population.py`
- [Parameter space](https://github.com/minlong1/neo/blob/main/Solvers/core/parameter_space.py): `Solvers/core/parameter_space.py`
- [Optimization methods](https://github.com/minlong1/neo/tree/main/Solvers): `Solvers`
- [DE-BNN sampling](https://github.com/minlong1/neo/blob/main/Solvers/demcmc/demcmc_solver.py): `Solvers/demcmc/demcmc_solver.py`
- [Posterior prediction](https://github.com/minlong1/neo/blob/main/Solvers/demcmc/posterior.py): `Solvers/demcmc/posterior.py`

### EXAFS fitting

- [EXAFS input](https://github.com/minlong1/neo/blob/main/PhysicsModules/EXAFS/exafs_neo/parser.py): `PhysicsModules/EXAFS/exafs_neo/parser.py`
- [EXAFS generation fit](https://github.com/minlong1/neo/blob/main/PhysicsModules/EXAFS/exafs_neo/exafs_pop.py): `PhysicsModules/EXAFS/exafs_neo/exafs_pop.py`
- [EXAFS analysis](https://github.com/minlong1/neo/blob/main/PhysicsModules/EXAFS/exafs_neo/analysis/EXAFS_Analysis.py): `PhysicsModules/EXAFS/exafs_neo/analysis/EXAFS_Analysis.py`
- [EXAFS GUI](https://github.com/minlong1/neo/blob/main/PhysicsModules/EXAFS/exafs_neo/gui/XAFS_GUI.py): `PhysicsModules/EXAFS/exafs_neo/gui/XAFS_GUI.py`

### Other shared fits

- [Nano input](https://github.com/minlong1/neo/blob/main/PhysicsModules/NanoIndentation/nanoindentation_neo/parser.py): `PhysicsModules/NanoIndentation/nanoindentation_neo/parser.py`
- [Oliver-Pharr fit](https://github.com/minlong1/neo/blob/main/PhysicsModules/NanoIndentation/nanoindentation_neo/nano_indent.py): `PhysicsModules/NanoIndentation/nanoindentation_neo/nano_indent.py`
- [Nano GUI analysis](https://github.com/minlong1/neo/blob/main/PhysicsModules/NanoIndentation/nanoindentation_neo/gui/NanoIndent_Analysis.py): `PhysicsModules/NanoIndentation/nanoindentation_neo/gui/NanoIndent_Analysis.py`
- [Raman input](https://github.com/minlong1/neo/blob/main/PhysicsModules/Raman/raman_neo/parser.py): `PhysicsModules/Raman/raman_neo/parser.py`
- [Raman band fitting](https://github.com/minlong1/neo/blob/main/PhysicsModules/Raman/raman_neo/problem.py): `PhysicsModules/Raman/raman_neo/problem.py`
- [Raman analysis](https://github.com/minlong1/neo/blob/main/PhysicsModules/Raman/raman_neo/analysis/raman_analysis.py): `PhysicsModules/Raman/raman_neo/analysis/raman_analysis.py`

### XPS fitting

- [XPS configuration](https://github.com/minlong1/neo/blob/main/PhysicsModules/XPS/xps_neo/ini_parser.py): `PhysicsModules/XPS/xps_neo/ini_parser.py`
- [XPS fit loop](https://github.com/minlong1/neo/blob/main/PhysicsModules/XPS/xps_neo/xps.py): `PhysicsModules/XPS/xps_neo/xps.py`
- [Peak and background models](https://github.com/minlong1/neo/blob/main/PhysicsModules/XPS/xps_neo/xps_fit.py): `PhysicsModules/XPS/xps_neo/xps_fit.py`
- [XPS GUI](https://github.com/minlong1/neo/blob/main/PhysicsModules/XPS/xps_neo/gui/xps_neo_gui.py): `PhysicsModules/XPS/xps_neo/gui/xps_neo_gui.py`

### Astro fitting

- [Astro input](https://github.com/minlong1/neo/blob/main/PhysicsModules/AstroNeo/astro_neo/parser.py): `PhysicsModules/AstroNeo/astro_neo/parser.py`
- [X-ray spectral model](https://github.com/minlong1/neo/blob/main/PhysicsModules/AstroNeo/astro_neo/model.py): `PhysicsModules/AstroNeo/astro_neo/model.py`
- [Cash-statistic fit](https://github.com/minlong1/neo/blob/main/PhysicsModules/AstroNeo/astro_neo/problem.py): `PhysicsModules/AstroNeo/astro_neo/problem.py`

### Other components

- **Research user**

## Connections

- Research user → EXAFS input: supplies settings (evidence: `README.md`)
- Research user → Nano input: supplies settings (evidence: `README.md`)
- Research user → Raman input: supplies settings (evidence: `README.md`)
- Research user → XPS configuration: supplies settings (evidence: `README.md`)
- Research user → Astro input: supplies settings (evidence: `README.md`)
- Solver registry → Solver lifecycle: creates solver
- Solver lifecycle → Population scoring: runs generations (evidence: `Solvers/core/base_solver.py`)
- Population scoring → Parameter space: samples parameters
- Optimization methods → Solver lifecycle: extends lifecycle (evidence: `Solvers/de/de_solver.py`)
- DE-BNN sampling → Solver lifecycle: extends lifecycle (evidence: `Solvers/demcmc/demcmc_solver.py`)
- DE-BNN sampling → Posterior prediction: collects samples (evidence: `Solvers/demcmc/demcmc_solver.py`)
- EXAFS input → EXAFS generation fit: configures fit
- EXAFS generation fit → Optimization methods: uses DE step (evidence: `README.md`)
- EXAFS analysis → EXAFS generation fit: analyzes fit
- EXAFS GUI → EXAFS analysis: opens analysis
- Nano input → Oliver-Pharr fit: configures fit
- Oliver-Pharr fit → Solver registry: uses shared solvers
- Nano GUI analysis → Oliver-Pharr fit: supports fitting
- Raman input → Raman band fitting: configures fit
- Raman band fitting → Solver registry: uses shared solvers
- Raman analysis → Raman band fitting: scores spectra (evidence: `PhysicsModules/Raman/raman_neo/analysis/raman_analysis.py`)
- XPS configuration → XPS fit loop: configures fit
- XPS fit loop → Peak and background models: fits peaks
- XPS GUI → XPS fit loop: launches workflow
- Astro input → Cash-statistic fit: configures fit
- Cash-statistic fit → X-ray spectral model: evaluates model
- Cash-statistic fit → Solver registry: uses shared solvers
