# 00sodj/weather-prediction-model architecture

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

- Interactive diagram: https://gitdiagram.com/00sodj/weather-prediction-model
- Repository: https://github.com/00sodj/weather-prediction-model

## Overview

This repository is a China-wide temperature forecasting system that collects and repairs weather data, trains per-city ARIMA forecasts, and produces a self-contained interactive report. The main workflow is run_predict.py: update recent daily and hourly observations, invoke historical gap repair, run modeling and evaluation, then generate the report. The report also presents hourly weather analysis. The README documents a separate initial full-data collection and an automated publication workflow; those deployment mechanics are not expanded here. The sampled excerpts establish the main runtime wiring, but not every detail of the initial collector or report interactions.

Main entry points: [`mox/run_predict.py`](https://github.com/00sodj/weather-prediction-model/blob/main/mox/run_predict.py) (Pipeline runner), [`mox/weather_predict.py`](https://github.com/00sodj/weather-prediction-model/blob/main/mox/weather_predict.py) (ARIMA training), [`mox/generate_standalone_html.py`](https://github.com/00sodj/weather-prediction-model/blob/main/mox/generate_standalone_html.py) (Report generator), [`mox/weather_data/过去一年气温数据_逐日.csv`](https://github.com/00sodj/weather-prediction-model/blob/main/mox/weather_data/%E8%BF%87%E5%8E%BB%E4%B8%80%E5%B9%B4%E6%B0%94%E6%B8%A9%E6%95%B0%E6%8D%AE_%E9%80%90%E6%97%A5.csv) (Daily weather CSV)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Data collection"]
  node_runner["Pipeline runner<br/>[run_predict.py]"]
  node_collector["Full data collector"]
  node_recent["Recent backfill"]
  node_gapfix["Gap repair"]
end

subgraph group_modeling["Forecasting"]
  node_predictor["ARIMA training<br/>[weather_predict.py]"]
end

subgraph group_reporting["Reporting"]
  node_generator["Report generator"]
  node_report["Interactive report<br/>[天气温度预测系统.html]"]
  node_pages_entry["Pages entry<br/>[index.html]"]
end

subgraph group_runtime["Runtime data"]
  node_daily_csv[("Daily weather CSV<br/>[过去一年气温数据_逐日.csv]")]
  node_hourly_csv[("Hourly weather CSV<br/>[过去24小时气象数据_逐小时.csv]")]
  node_order_cache[("Order cache<br/>[order_cache.json]")]
  node_arima_results[("Forecast results<br/>[arima_results.json]")]
  node_training_summary[("Training summary")]
  node_hourly_analysis[("Hourly analysis")]
end

node_operator(("Operator"))
node_weather_api["Open-Meteo API"]
node_browser(("Browser viewer"))
node_echarts["ECharts CDN"]

node_operator -->|"starts"| node_runner
node_runner -->|"fetches data"| node_weather_api
node_runner -->|"updates"| node_daily_csv
node_runner -->|"writes"| node_hourly_csv
node_runner -->|"calls repair"| node_gapfix
node_gapfix -->|"fetches gaps"| node_weather_api
node_gapfix -->|"repairs"| node_daily_csv
node_collector -->|"fetches history"| node_weather_api
node_collector -->|"writes"| node_daily_csv
node_collector -->|"writes"| node_hourly_csv
node_recent -->|"fetches history"| node_weather_api
node_recent -->|"merges data"| node_daily_csv
node_runner -->|"runs"| node_predictor
node_predictor -->|"reads"| node_daily_csv
node_predictor -->|"reads"| node_hourly_csv
node_predictor -->|"reads and writes"| node_order_cache
node_predictor -->|"writes forecasts"| node_arima_results
node_predictor -->|"writes metrics"| node_training_summary
node_predictor -->|"writes analysis"| node_hourly_analysis
node_runner -->|"runs"| node_generator
node_generator -->|"reads"| node_arima_results
node_generator -->|"reads"| node_training_summary
node_generator -->|"reads"| node_hourly_analysis
node_generator -->|"generates"| node_report
node_browser -->|"opens"| node_pages_entry
node_pages_entry -->|"redirects to"| node_report
node_browser -->|"views"| node_report
node_report -.->|"loads charts"| node_echarts

click node_runner "https://github.com/00sodj/weather-prediction-model/blob/main/mox/run_predict.py"
click node_collector "https://github.com/00sodj/weather-prediction-model/blob/main/mox/fetch_weather_data.py"
click node_recent "https://github.com/00sodj/weather-prediction-model/blob/main/mox/fetch_missing_v2.py"
click node_gapfix "https://github.com/00sodj/weather-prediction-model/blob/main/mox/backfill_missing_days.py"
click node_daily_csv "https://github.com/00sodj/weather-prediction-model/blob/main/mox/weather_data/%E8%BF%87%E5%8E%BB%E4%B8%80%E5%B9%B4%E6%B0%94%E6%B8%A9%E6%95%B0%E6%8D%AE_%E9%80%90%E6%97%A5.csv"
click node_hourly_csv "https://github.com/00sodj/weather-prediction-model/blob/main/mox/weather_data/%E8%BF%87%E5%8E%BB24%E5%B0%8F%E6%97%B6%E6%B0%94%E8%B1%A1%E6%95%B0%E6%8D%AE_%E9%80%90%E5%B0%8F%E6%97%B6.csv"
click node_predictor "https://github.com/00sodj/weather-prediction-model/blob/main/mox/weather_predict.py"
click node_order_cache "https://github.com/00sodj/weather-prediction-model/blob/main/mox/model_outputs/order_cache.json"
click node_arima_results "https://github.com/00sodj/weather-prediction-model/blob/main/mox/model_outputs/arima_results.json"
click node_training_summary "https://github.com/00sodj/weather-prediction-model/blob/main/mox/model_outputs/training_summary.json"
click node_hourly_analysis "https://github.com/00sodj/weather-prediction-model/blob/main/mox/model_outputs/hourly_analysis.json"
click node_generator "https://github.com/00sodj/weather-prediction-model/blob/main/mox/generate_standalone_html.py"
click node_report "https://github.com/00sodj/weather-prediction-model/blob/main/mox/%E5%A4%A9%E6%B0%94%E6%B8%A9%E5%BA%A6%E9%A2%84%E6%B5%8B%E7%B3%BB%E7%BB%9F.html"
click node_pages_entry "https://github.com/00sodj/weather-prediction-model/blob/main/index.html"

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_runner,node_collector,node_recent,node_gapfix,node_browser toneBlue
class node_predictor toneAmber
class node_generator,node_report,node_pages_entry,node_weather_api toneMint
class node_daily_csv,node_hourly_csv,node_order_cache,node_arima_results,node_training_summary,node_hourly_analysis toneRose
class node_operator,node_echarts toneIndigo
```

## Components

### Data collection

- [Pipeline runner](https://github.com/00sodj/weather-prediction-model/blob/main/mox/run_predict.py): `mox/run_predict.py`
- [Full data collector](https://github.com/00sodj/weather-prediction-model/blob/main/mox/fetch_weather_data.py): `mox/fetch_weather_data.py`
- [Recent backfill](https://github.com/00sodj/weather-prediction-model/blob/main/mox/fetch_missing_v2.py): `mox/fetch_missing_v2.py`
- [Gap repair](https://github.com/00sodj/weather-prediction-model/blob/main/mox/backfill_missing_days.py): `mox/backfill_missing_days.py`

### Forecasting

- [ARIMA training](https://github.com/00sodj/weather-prediction-model/blob/main/mox/weather_predict.py): `mox/weather_predict.py`

### Reporting

- [Report generator](https://github.com/00sodj/weather-prediction-model/blob/main/mox/generate_standalone_html.py): `mox/generate_standalone_html.py`
- [Interactive report](https://github.com/00sodj/weather-prediction-model/blob/main/mox/%E5%A4%A9%E6%B0%94%E6%B8%A9%E5%BA%A6%E9%A2%84%E6%B5%8B%E7%B3%BB%E7%BB%9F.html): `mox/天气温度预测系统.html`
- [Pages entry](https://github.com/00sodj/weather-prediction-model/blob/main/index.html): `index.html`

### Runtime data

- [Daily weather CSV](https://github.com/00sodj/weather-prediction-model/blob/main/mox/weather_data/%E8%BF%87%E5%8E%BB%E4%B8%80%E5%B9%B4%E6%B0%94%E6%B8%A9%E6%95%B0%E6%8D%AE_%E9%80%90%E6%97%A5.csv): `mox/weather_data/过去一年气温数据_逐日.csv`
- [Hourly weather CSV](https://github.com/00sodj/weather-prediction-model/blob/main/mox/weather_data/%E8%BF%87%E5%8E%BB24%E5%B0%8F%E6%97%B6%E6%B0%94%E8%B1%A1%E6%95%B0%E6%8D%AE_%E9%80%90%E5%B0%8F%E6%97%B6.csv): `mox/weather_data/过去24小时气象数据_逐小时.csv`
- [Order cache](https://github.com/00sodj/weather-prediction-model/blob/main/mox/model_outputs/order_cache.json): `mox/model_outputs/order_cache.json`
- [Forecast results](https://github.com/00sodj/weather-prediction-model/blob/main/mox/model_outputs/arima_results.json): `mox/model_outputs/arima_results.json`
- [Training summary](https://github.com/00sodj/weather-prediction-model/blob/main/mox/model_outputs/training_summary.json): `mox/model_outputs/training_summary.json`
- [Hourly analysis](https://github.com/00sodj/weather-prediction-model/blob/main/mox/model_outputs/hourly_analysis.json): `mox/model_outputs/hourly_analysis.json`

### Other components

- **Operator**
- **Open-Meteo API**
- **Browser viewer**
- **ECharts CDN**

## Connections

- Operator → Pipeline runner: starts
- Pipeline runner → Open-Meteo API: fetches data
- Pipeline runner → Daily weather CSV: updates
- Pipeline runner → Hourly weather CSV: writes
- Pipeline runner → Gap repair: calls repair
- Gap repair → Open-Meteo API: fetches gaps
- Gap repair → Daily weather CSV: repairs
- Full data collector → Open-Meteo API: fetches history
- Full data collector → Daily weather CSV: writes
- Full data collector → Hourly weather CSV: writes
- Recent backfill → Open-Meteo API: fetches history
- Recent backfill → Daily weather CSV: merges data
- Pipeline runner → ARIMA training: runs
- ARIMA training → Daily weather CSV: reads
- ARIMA training → Hourly weather CSV: reads
- ARIMA training → Order cache: reads and writes
- ARIMA training → Forecast results: writes forecasts
- ARIMA training → Training summary: writes metrics
- ARIMA training → Hourly analysis: writes analysis
- Pipeline runner → Report generator: runs
- Report generator → Forecast results: reads
- Report generator → Training summary: reads
- Report generator → Hourly analysis: reads
- Report generator → Interactive report: generates
- Browser viewer → Pages entry: opens
- Pages entry → Interactive report: redirects to
- Browser viewer → Interactive report: views
- Interactive report → ECharts CDN: loads charts
