# dhi/modelskill architecture

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

- Interactive diagram: https://gitdiagram.com/dhi/modelskill
- Repository: https://github.com/dhi/modelskill

## Overview

ModelSkill evaluates model outputs against observations. Users define observation and model-result objects, match them in space and time, then use the resulting comparer collection for skill metrics and plots. The graph preserves the documented point, track, and vertical workflows plus network and grid model support, skill summaries, and plotting capabilities. Connections are limited to README statements and source-index references; unsampled implementations are represented at their existing directory paths, and uncertain internal call sequences are omitted.

Main entry points: [`src/modelskill/matching.py`](https://github.com/dhi/modelskill/blob/main/src/modelskill/matching.py) (Matching), [`src/modelskill/timeseries/_timeseries.py`](https://github.com/dhi/modelskill/blob/main/src/modelskill/timeseries/_timeseries.py) (Time-series data), [`src/modelskill/comparison/_comparison.py`](https://github.com/dhi/modelskill/blob/main/src/modelskill/comparison/_comparison.py) (Comparer), [`src/modelskill/comparison/_collection.py`](https://github.com/dhi/modelskill/blob/main/src/modelskill/comparison/_collection.py) (Comparer collection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Inputs and data"]
  node_observations["Observations<br/>[obs.py]"]
  node_point_model["Point models<br/>[point.py]"]
  node_track_model["Track models<br/>[track.py]"]
  node_vertical_model["Vertical models<br/>[vertical.py]"]
  node_network_model["Network models<br/>[network.py]"]
  node_grid_model["Grid and DFSU<br/>[grid.py]"]
  node_timeseries["Time-series data<br/>[_timeseries.py]"]
  node_coordinates["Coordinates<br/>[_coords.py]"]
  node_quantities["Quantity metadata<br/>[quantity.py]"]
end

subgraph group_matching["Spatial matching"]
  node_matcher["Matching<br/>[matching.py]"]
end

subgraph group_assessment["Comparison and skill"]
  node_comparer["Comparer<br/>[_comparison.py]"]
  node_collection["Comparer collection<br/>[_collection.py]"]
  node_metrics["Skill metrics<br/>[metrics.py]"]
  node_skill["Skill tables<br/>[skill.py]"]
  node_skill_grid["Spatial skill<br/>[skill_grid.py]"]
  node_skill_profile["Profile skill<br/>[skill_profile.py]"]
end

subgraph group_visualization["Plotting and reports"]
  node_comparison_plots["Comparison plots"]
  node_single_plots["Comparer plots"]
  node_plotting["Plot types<br/>[_scatter.py]"]
  node_timeseries_plot["Time-series plots<br/>[_plotter.py]"]
end

node_user(("Analyst"))

node_user -->|"defines"| node_observations
node_user -->|"defines"| node_point_model
node_user -->|"defines"| node_track_model
node_user -->|"matches"| node_matcher
node_observations -->|"uses base"| node_timeseries
node_point_model -->|"uses base"| node_timeseries
node_track_model -->|"uses base"| node_timeseries
node_vertical_model -->|"uses base"| node_timeseries
node_network_model -->|"uses base"| node_timeseries
node_matcher -->|"matches"| node_observations
node_matcher -->|"extracts data"| node_point_model
node_matcher -->|"extracts data"| node_track_model
node_matcher -->|"extracts data"| node_vertical_model
node_matcher -->|"extracts data"| node_network_model
node_matcher -->|"extracts data"| node_grid_model
node_matcher -->|"creates comparisons"| node_comparer
node_comparer -.->|"collected as"| node_collection
node_collection -->|"calculates"| node_metrics
node_comparer -->|"calculates"| node_metrics
node_collection -->|"builds skill"| node_skill
node_comparer -->|"supports skill"| node_skill_grid
node_comparer -->|"supports skill"| node_skill_profile
node_collection -->|"plots collection"| node_comparison_plots
node_comparer -->|"plots comparer"| node_single_plots
node_comparison_plots -->|"uses plot types"| node_plotting
node_single_plots -->|"uses plot types"| node_plotting
node_timeseries -->|"provides plotting"| node_timeseries_plot
node_timeseries -->|"uses coordinates"| node_coordinates
node_timeseries -->|"uses metadata"| node_quantities

click node_observations "https://github.com/dhi/modelskill/blob/main/src/modelskill/obs.py"
click node_point_model "https://github.com/dhi/modelskill/blob/main/src/modelskill/model/point.py"
click node_track_model "https://github.com/dhi/modelskill/blob/main/src/modelskill/model/track.py"
click node_vertical_model "https://github.com/dhi/modelskill/blob/main/src/modelskill/model/vertical.py"
click node_network_model "https://github.com/dhi/modelskill/blob/main/src/modelskill/model/network.py"
click node_grid_model "https://github.com/dhi/modelskill/blob/main/src/modelskill/model/grid.py"
click node_timeseries "https://github.com/dhi/modelskill/blob/main/src/modelskill/timeseries/_timeseries.py"
click node_coordinates "https://github.com/dhi/modelskill/blob/main/src/modelskill/timeseries/_coords.py"
click node_quantities "https://github.com/dhi/modelskill/blob/main/src/modelskill/quantity.py"
click node_matcher "https://github.com/dhi/modelskill/blob/main/src/modelskill/matching.py"
click node_comparer "https://github.com/dhi/modelskill/blob/main/src/modelskill/comparison/_comparison.py"
click node_collection "https://github.com/dhi/modelskill/blob/main/src/modelskill/comparison/_collection.py"
click node_metrics "https://github.com/dhi/modelskill/blob/main/src/modelskill/metrics.py"
click node_skill "https://github.com/dhi/modelskill/blob/main/src/modelskill/skill.py"
click node_skill_grid "https://github.com/dhi/modelskill/blob/main/src/modelskill/skill_grid.py"
click node_skill_profile "https://github.com/dhi/modelskill/blob/main/src/modelskill/skill_profile.py"
click node_comparison_plots "https://github.com/dhi/modelskill/blob/main/src/modelskill/comparison/_collection_plotter.py"
click node_single_plots "https://github.com/dhi/modelskill/blob/main/src/modelskill/comparison/_comparer_plotter.py"
click node_plotting "https://github.com/dhi/modelskill/blob/main/src/modelskill/plotting/_scatter.py"
click node_timeseries_plot "https://github.com/dhi/modelskill/blob/main/src/modelskill/timeseries/_plotter.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_observations,node_point_model,node_track_model,node_vertical_model,node_network_model,node_grid_model,node_timeseries,node_coordinates,node_quantities toneBlue
class node_matcher toneAmber
class node_comparer,node_collection,node_metrics,node_skill,node_skill_grid,node_skill_profile toneMint
class node_comparison_plots,node_single_plots,node_plotting,node_timeseries_plot toneRose
class node_user toneIndigo
```

## Components

### Inputs and data

- [Observations](https://github.com/dhi/modelskill/blob/main/src/modelskill/obs.py): `src/modelskill/obs.py`
- [Point models](https://github.com/dhi/modelskill/blob/main/src/modelskill/model/point.py): `src/modelskill/model/point.py`
- [Track models](https://github.com/dhi/modelskill/blob/main/src/modelskill/model/track.py): `src/modelskill/model/track.py`
- [Vertical models](https://github.com/dhi/modelskill/blob/main/src/modelskill/model/vertical.py): `src/modelskill/model/vertical.py`
- [Network models](https://github.com/dhi/modelskill/blob/main/src/modelskill/model/network.py): `src/modelskill/model/network.py`
- [Grid and DFSU](https://github.com/dhi/modelskill/blob/main/src/modelskill/model/grid.py): `src/modelskill/model/grid.py`
- [Time-series data](https://github.com/dhi/modelskill/blob/main/src/modelskill/timeseries/_timeseries.py): `src/modelskill/timeseries/_timeseries.py`
- [Coordinates](https://github.com/dhi/modelskill/blob/main/src/modelskill/timeseries/_coords.py): `src/modelskill/timeseries/_coords.py`
- [Quantity metadata](https://github.com/dhi/modelskill/blob/main/src/modelskill/quantity.py): `src/modelskill/quantity.py`

### Spatial matching

- [Matching](https://github.com/dhi/modelskill/blob/main/src/modelskill/matching.py): `src/modelskill/matching.py`

### Comparison and skill

- [Comparer](https://github.com/dhi/modelskill/blob/main/src/modelskill/comparison/_comparison.py): `src/modelskill/comparison/_comparison.py`
- [Comparer collection](https://github.com/dhi/modelskill/blob/main/src/modelskill/comparison/_collection.py): `src/modelskill/comparison/_collection.py`
- [Skill metrics](https://github.com/dhi/modelskill/blob/main/src/modelskill/metrics.py): `src/modelskill/metrics.py`
- [Skill tables](https://github.com/dhi/modelskill/blob/main/src/modelskill/skill.py): `src/modelskill/skill.py`
- [Spatial skill](https://github.com/dhi/modelskill/blob/main/src/modelskill/skill_grid.py): `src/modelskill/skill_grid.py`
- [Profile skill](https://github.com/dhi/modelskill/blob/main/src/modelskill/skill_profile.py): `src/modelskill/skill_profile.py`

### Plotting and reports

- [Comparison plots](https://github.com/dhi/modelskill/blob/main/src/modelskill/comparison/_collection_plotter.py): `src/modelskill/comparison/_collection_plotter.py`
- [Comparer plots](https://github.com/dhi/modelskill/blob/main/src/modelskill/comparison/_comparer_plotter.py): `src/modelskill/comparison/_comparer_plotter.py`
- [Plot types](https://github.com/dhi/modelskill/blob/main/src/modelskill/plotting/_scatter.py): `src/modelskill/plotting/_scatter.py`
- [Time-series plots](https://github.com/dhi/modelskill/blob/main/src/modelskill/timeseries/_plotter.py): `src/modelskill/timeseries/_plotter.py`

### Other components

- **Analyst**

## Connections

- Analyst → Observations: defines
- Analyst → Point models: defines
- Analyst → Track models: defines
- Analyst → Matching: matches
- Observations → Time-series data: uses base (evidence: `src/modelskill/obs.py`)
- Point models → Time-series data: uses base (evidence: `src/modelskill/model/point.py`)
- Track models → Time-series data: uses base (evidence: `src/modelskill/model/track.py`)
- Vertical models → Time-series data: uses base (evidence: `src/modelskill/model/vertical.py`)
- Network models → Time-series data: uses base (evidence: `src/modelskill/model/network.py`)
- Matching → Observations: matches (evidence: `src/modelskill/matching.py`)
- Matching → Point models: extracts data (evidence: `src/modelskill/matching.py`)
- Matching → Track models: extracts data (evidence: `src/modelskill/matching.py`)
- Matching → Vertical models: extracts data (evidence: `src/modelskill/matching.py`)
- Matching → Network models: extracts data (evidence: `src/modelskill/matching.py`)
- Matching → Grid and DFSU: extracts data (evidence: `src/modelskill/matching.py`)
- Matching → Comparer: creates comparisons (evidence: `src/modelskill/matching.py`)
- Comparer → Comparer collection: collected as (evidence: `src/modelskill/comparison/_comparison.py`)
- Comparer collection → Skill metrics: calculates (evidence: `src/modelskill/comparison/_collection.py`)
- Comparer → Skill metrics: calculates (evidence: `src/modelskill/comparison/_comparison.py`)
- Comparer collection → Skill tables: builds skill (evidence: `src/modelskill/comparison/_collection.py`)
- Comparer → Spatial skill: supports skill (evidence: `src/modelskill/comparison/_comparison.py`)
- Comparer → Profile skill: supports skill (evidence: `src/modelskill/comparison/_vertical_comparison.py`)
- Comparer collection → Comparison plots: plots collection (evidence: `src/modelskill/comparison/_collection_plotter.py`)
- Comparer → Comparer plots: plots comparer (evidence: `src/modelskill/comparison/_comparer_plotter.py`)
- Comparison plots → Plot types: uses plot types (evidence: `src/modelskill/comparison/_collection_plotter.py`)
- Comparer plots → Plot types: uses plot types (evidence: `src/modelskill/comparison/_comparer_plotter.py`)
- Time-series data → Time-series plots: provides plotting (evidence: `src/modelskill/timeseries/_timeseries.py`)
- Time-series data → Coordinates: uses coordinates (evidence: `src/modelskill/timeseries/_timeseries.py`)
- Time-series data → Quantity metadata: uses metadata (evidence: `src/modelskill/timeseries/_timeseries.py`)
