# tsipkens/pydias architecture

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

- Interactive diagram: https://gitdiagram.com/tsipkens/pydias
- Repository: https://github.com/tsipkens/pydias

## Overview

PYDIAS is a scientific Python toolkit for aerosol transfer-function evaluation and one- and two-dimensional inversion. Its example workflows configure classifier measurements, build response kernels, invert measured or generated data, and visualize or transform the resulting distributions. The README identifies transfer functions, unidimensional inversion, and tandem-measurement bidimensional inversion as distinct capabilities. Edges reflect the sampled examples and source references; other documented capabilities are included without inferring unsampled call paths.

Main entry points: [`main_invert2_aams.py`](https://github.com/tsipkens/pydias/blob/main/main_invert2_aams.py) (Tandem inversion example), [`main_invert_pma.py`](https://github.com/tsipkens/pydias/blob/main/main_invert_pma.py) (PMA inversion example), [`tfer/tfer.py`](https://github.com/tsipkens/pydias/blob/main/tfer/tfer.py) (Classifier models), [`main_tfer.py`](https://github.com/tsipkens/pydias/blob/main/main_tfer.py) (Transfer evaluation example)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_examples["Example workflows"]
  node_two_d_example["Tandem inversion example"]
  node_one_d_example["PMA inversion example<br/>[main_invert_pma.py]"]
  node_transfer_example["Transfer evaluation example<br/>[main_tfer.py]"]
end

subgraph group_transfer["Transfer functions"]
  node_transfer_models["Classifier models<br/>[tfer.py]"]
end

subgraph group_one_d["Unidimensional inversion"]
  node_one_d_kernels["1D response kernels<br/>[kernel.py]"]
  node_one_d_solver["1D inversion methods<br/>[invert.py]"]
end

subgraph group_two_d["Bidimensional inversion"]
  node_two_d_kernels["2D response kernels<br/>[kernel.py]"]
  node_grid["Distribution grids<br/>[Grid.py]"]
  node_two_d_solver["2D inversion methods<br/>[invert.py]"]
  node_phantom["Synthetic distributions<br/>[Phantom.py]"]
  node_transform["Distribution transforms<br/>[tools.py]"]
  node_bidias_io["Bidimensional data I/O<br/>[io.py]"]
  node_utilities["Color and display utilities<br/>[cmap.py]"]
end

node_scientist(("Researcher"))

node_scientist -.->|"runs example"| node_two_d_example
node_scientist -.->|"runs example"| node_one_d_example
node_scientist -.->|"runs example"| node_transfer_example
node_two_d_example -->|"creates distribution"| node_phantom
node_two_d_example -->|"configures grid"| node_grid
node_two_d_example -->|"builds response"| node_two_d_kernels
node_two_d_kernels -->|"evaluates responses"| node_transfer_models
node_two_d_example -->|"inverts data"| node_two_d_solver
node_two_d_solver -->|"uses solver engine"| node_one_d_solver
node_two_d_example -->|"transforms estimate"| node_transform
node_grid -->|"uses display tools"| node_utilities
node_one_d_example -->|"sets classifier points"| node_transfer_models
node_one_d_example -->|"builds response"| node_one_d_kernels
node_one_d_kernels -->|"evaluates responses"| node_transfer_models
node_one_d_example -->|"inverts data"| node_one_d_solver
node_transfer_example -->|"evaluates functions"| node_transfer_models

click node_two_d_example "https://github.com/tsipkens/pydias/blob/main/main_invert2_aams.py"
click node_one_d_example "https://github.com/tsipkens/pydias/blob/main/main_invert_pma.py"
click node_transfer_example "https://github.com/tsipkens/pydias/blob/main/main_tfer.py"
click node_transfer_models "https://github.com/tsipkens/pydias/blob/main/tfer/tfer.py"
click node_one_d_kernels "https://github.com/tsipkens/pydias/blob/main/odias/kernel.py"
click node_one_d_solver "https://github.com/tsipkens/pydias/blob/main/odias/invert.py"
click node_two_d_kernels "https://github.com/tsipkens/pydias/blob/main/bidias/kernel.py"
click node_grid "https://github.com/tsipkens/pydias/blob/main/bidias/Grid.py"
click node_two_d_solver "https://github.com/tsipkens/pydias/blob/main/bidias/invert.py"
click node_phantom "https://github.com/tsipkens/pydias/blob/main/bidias/Phantom.py"
click node_transform "https://github.com/tsipkens/pydias/blob/main/bidias/tools.py"
click node_bidias_io "https://github.com/tsipkens/pydias/blob/main/bidias/io.py"
click node_utilities "https://github.com/tsipkens/pydias/blob/main/cmap.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_two_d_example,node_one_d_example,node_transfer_example toneBlue
class node_transfer_models toneAmber
class node_one_d_kernels,node_one_d_solver toneMint
class node_two_d_kernels,node_grid,node_two_d_solver,node_phantom,node_transform,node_bidias_io,node_utilities toneRose
class node_scientist toneIndigo
```

## Components

### Example workflows

- [Tandem inversion example](https://github.com/tsipkens/pydias/blob/main/main_invert2_aams.py): `main_invert2_aams.py`
- [PMA inversion example](https://github.com/tsipkens/pydias/blob/main/main_invert_pma.py): `main_invert_pma.py`
- [Transfer evaluation example](https://github.com/tsipkens/pydias/blob/main/main_tfer.py): `main_tfer.py`

### Transfer functions

- [Classifier models](https://github.com/tsipkens/pydias/blob/main/tfer/tfer.py): `tfer/tfer.py`

### Unidimensional inversion

- [1D response kernels](https://github.com/tsipkens/pydias/blob/main/odias/kernel.py): `odias/kernel.py`
- [1D inversion methods](https://github.com/tsipkens/pydias/blob/main/odias/invert.py): `odias/invert.py`

### Bidimensional inversion

- [2D response kernels](https://github.com/tsipkens/pydias/blob/main/bidias/kernel.py): `bidias/kernel.py`
- [Distribution grids](https://github.com/tsipkens/pydias/blob/main/bidias/Grid.py): `bidias/Grid.py`
- [2D inversion methods](https://github.com/tsipkens/pydias/blob/main/bidias/invert.py): `bidias/invert.py`
- [Synthetic distributions](https://github.com/tsipkens/pydias/blob/main/bidias/Phantom.py): `bidias/Phantom.py`
- [Distribution transforms](https://github.com/tsipkens/pydias/blob/main/bidias/tools.py): `bidias/tools.py`
- [Bidimensional data I/O](https://github.com/tsipkens/pydias/blob/main/bidias/io.py): `bidias/io.py`
- [Color and display utilities](https://github.com/tsipkens/pydias/blob/main/cmap.py): `cmap.py`

### Other components

- **Researcher**

## Connections

- Researcher → Tandem inversion example: runs example
- Researcher → PMA inversion example: runs example
- Researcher → Transfer evaluation example: runs example
- Tandem inversion example → Synthetic distributions: creates distribution (evidence: `main_invert2_aams.py`)
- Tandem inversion example → Distribution grids: configures grid (evidence: `main_invert2_aams.py`)
- Tandem inversion example → 2D response kernels: builds response (evidence: `main_invert2_aams.py`)
- 2D response kernels → Classifier models: evaluates responses (evidence: `bidias/kernel.py`)
- Tandem inversion example → 2D inversion methods: inverts data (evidence: `main_invert2_aams.py`)
- 2D inversion methods → 1D inversion methods: uses solver engine (evidence: `bidias/invert.py`)
- Tandem inversion example → Distribution transforms: transforms estimate (evidence: `main_invert2_aams.py`)
- Distribution grids → Color and display utilities: uses display tools (evidence: `bidias/Grid.py`)
- PMA inversion example → Classifier models: sets classifier points (evidence: `main_invert_pma.py`)
- PMA inversion example → 1D response kernels: builds response (evidence: `main_invert_pma.py`)
- 1D response kernels → Classifier models: evaluates responses (evidence: `odias/kernel.py`)
- PMA inversion example → 1D inversion methods: inverts data (evidence: `main_invert_pma.py`)
- Transfer evaluation example → Classifier models: evaluates functions (evidence: `main_tfer.py`)
