# rogerlew/wepppy architecture

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

- Interactive diagram: https://gitdiagram.com/rogerlew/wepppy
- Repository: https://github.com/rogerlew/wepppy

## Overview

WEPPpy is the modeling and orchestration core behind WEPPcloud, supporting watershed erosion simulations and wildfire-response analysis. The main workflow starts with a user submitting a run, proceeds through queued preparation of watershed, climate, soils, and land-use inputs, then runs WEPP and exposes results for querying and export. NoDb controllers manage run state; Redis supports coordination and caching. The README documents additional telemetry and extension capabilities. Some subsystem links rely on that documentation because their implementation was not sampled.

Main entry points: [`wepppy/rq/rq_worker.py`](https://github.com/rogerlew/wepppy/blob/master/wepppy/rq/rq_worker.py) (RQ workers), [`wepppy/nodb/base.py`](https://github.com/rogerlew/wepppy/blob/master/wepppy/nodb/base.py) (NoDb controllers), [`wepppy/microservices/rq_engine/landuse_routes.py`](https://github.com/rogerlew/wepppy/blob/master/wepppy/microservices/rq_engine/landuse_routes.py) (Run API), [`wepppy/rq/wepp_rq_pipeline.py`](https://github.com/rogerlew/wepppy/blob/master/wepppy/rq/wepp_rq_pipeline.py) (RQ workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Run entry"]
  node_rq_api["Run API<br/>[landuse_routes.py]"]
  node_rq_pipeline["RQ workflow"]
  node_worker["RQ workers<br/>[rq_worker.py]"]
end

subgraph group_workflow["Simulation workflow"]
  node_watershed["Watershed prep<br/>[watershed.py]"]
  node_climate["Climate inputs<br/>[climate.py]"]
  node_soils["Soils inputs<br/>[soils.py]"]
  node_landuse["Land-use inputs<br/>[landuse.py]"]
  node_wepp["WEPP simulation<br/>[wepp.py]"]
  node_omni["Scenario runs"]
end

subgraph group_state["Run state"]
  node_nodb["NoDb controllers<br/>[base.py]"]
  node_redis[("Redis coordination<br/>[redis_settings.py]")]
  node_run_files[("Run files")]
end

subgraph group_results["Results and extensions"]
  node_mods["Model extensions<br/>[disturbed.py]"]
  node_query["Query engine<br/>[server.py]"]
  node_exports["Result exports<br/>[export.py]"]
end

subgraph group_platform["Platform services"]
  node_telemetry["Live telemetry<br/>[server.go]"]
  node_climate_services["Climate services<br/>[metquery_client.py]"]
end

node_user(("WEPPcloud user"))
node_external(("External data sources"))

node_user -->|"submits run"| node_rq_api
node_rq_api -->|"enqueues work"| node_rq_pipeline
node_rq_pipeline -->|"queues jobs"| node_worker
node_worker -.->|"prepares watershed"| node_watershed
node_worker -->|"prepares climate"| node_climate
node_worker -->|"prepares soils"| node_soils
node_worker -.->|"prepares land use"| node_landuse
node_worker -->|"runs simulation"| node_wepp
node_worker -.->|"uses run state"| node_nodb
node_nodb -->|"persists state"| node_run_files
node_nodb -->|"caches and locks"| node_redis
node_worker -.->|"runs scenarios"| node_omni
node_omni -->|"runs watershed"| node_wepp
node_worker -.->|"uses extensions"| node_mods
node_user -->|"requests results"| node_query
node_query -.->|"queries run data"| node_run_files
node_worker -.->|"exports results"| node_exports
node_worker -->|"publishes status"| node_telemetry
node_climate_services -->|"requests climate data"| node_external
node_worker -.->|"acquires climate"| node_climate_services

click node_rq_api "https://github.com/rogerlew/wepppy/blob/master/wepppy/microservices/rq_engine/landuse_routes.py"
click node_rq_pipeline "https://github.com/rogerlew/wepppy/blob/master/wepppy/rq/wepp_rq_pipeline.py"
click node_worker "https://github.com/rogerlew/wepppy/blob/master/wepppy/rq/rq_worker.py"
click node_watershed "https://github.com/rogerlew/wepppy/blob/master/wepppy/nodb/core/watershed.py"
click node_climate "https://github.com/rogerlew/wepppy/blob/master/wepppy/nodb/core/climate.py"
click node_soils "https://github.com/rogerlew/wepppy/blob/master/wepppy/nodb/core/soils.py"
click node_landuse "https://github.com/rogerlew/wepppy/blob/master/wepppy/nodb/core/landuse.py"
click node_wepp "https://github.com/rogerlew/wepppy/blob/master/wepppy/nodb/core/wepp.py"
click node_nodb "https://github.com/rogerlew/wepppy/blob/master/wepppy/nodb/base.py"
click node_redis "https://github.com/rogerlew/wepppy/blob/master/wepppy/config/redis_settings.py"
click node_omni "https://github.com/rogerlew/wepppy/blob/master/wepppy/nodb/mods/omni/omni_run_orchestration_service.py"
click node_mods "https://github.com/rogerlew/wepppy/blob/master/wepppy/nodb/mods/disturbed/disturbed.py"
click node_query "https://github.com/rogerlew/wepppy/blob/master/wepppy/query_engine/app/server.py"
click node_exports "https://github.com/rogerlew/wepppy/blob/master/wepppy/export/export.py"
click node_telemetry "https://github.com/rogerlew/wepppy/blob/master/services/status2/internal/server/server.go"
click node_climate_services "https://github.com/rogerlew/wepppy/blob/master/wepppy/climates/metquery_client.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_rq_api,node_rq_pipeline,node_worker,node_user toneBlue
class node_watershed,node_climate,node_soils,node_landuse,node_wepp,node_omni toneAmber
class node_nodb,node_redis,node_run_files toneMint
class node_mods,node_query,node_exports toneRose
class node_telemetry,node_climate_services,node_external toneIndigo
```

## Components

### Run entry

- [Run API](https://github.com/rogerlew/wepppy/blob/master/wepppy/microservices/rq_engine/landuse_routes.py): `wepppy/microservices/rq_engine/landuse_routes.py`
- [RQ workflow](https://github.com/rogerlew/wepppy/blob/master/wepppy/rq/wepp_rq_pipeline.py): `wepppy/rq/wepp_rq_pipeline.py`
- [RQ workers](https://github.com/rogerlew/wepppy/blob/master/wepppy/rq/rq_worker.py): `wepppy/rq/rq_worker.py`

### Simulation workflow

- [Watershed prep](https://github.com/rogerlew/wepppy/blob/master/wepppy/nodb/core/watershed.py): `wepppy/nodb/core/watershed.py`
- [Climate inputs](https://github.com/rogerlew/wepppy/blob/master/wepppy/nodb/core/climate.py): `wepppy/nodb/core/climate.py`
- [Soils inputs](https://github.com/rogerlew/wepppy/blob/master/wepppy/nodb/core/soils.py): `wepppy/nodb/core/soils.py`
- [Land-use inputs](https://github.com/rogerlew/wepppy/blob/master/wepppy/nodb/core/landuse.py): `wepppy/nodb/core/landuse.py`
- [WEPP simulation](https://github.com/rogerlew/wepppy/blob/master/wepppy/nodb/core/wepp.py): `wepppy/nodb/core/wepp.py`
- [Scenario runs](https://github.com/rogerlew/wepppy/blob/master/wepppy/nodb/mods/omni/omni_run_orchestration_service.py): `wepppy/nodb/mods/omni/omni_run_orchestration_service.py`

### Run state

- [NoDb controllers](https://github.com/rogerlew/wepppy/blob/master/wepppy/nodb/base.py): `wepppy/nodb/base.py`
- [Redis coordination](https://github.com/rogerlew/wepppy/blob/master/wepppy/config/redis_settings.py): `wepppy/config/redis_settings.py`
- **Run files**

### Results and extensions

- [Model extensions](https://github.com/rogerlew/wepppy/blob/master/wepppy/nodb/mods/disturbed/disturbed.py): `wepppy/nodb/mods/disturbed/disturbed.py`
- [Query engine](https://github.com/rogerlew/wepppy/blob/master/wepppy/query_engine/app/server.py): `wepppy/query_engine/app/server.py`
- [Result exports](https://github.com/rogerlew/wepppy/blob/master/wepppy/export/export.py): `wepppy/export/export.py`

### Platform services

- [Live telemetry](https://github.com/rogerlew/wepppy/blob/master/services/status2/internal/server/server.go): `services/status2/internal/server/server.go`
- [Climate services](https://github.com/rogerlew/wepppy/blob/master/wepppy/climates/metquery_client.py): `wepppy/climates/metquery_client.py`

### Other components

- **WEPPcloud user**
- **External data sources**

## Connections

- WEPPcloud user → Run API: submits run
- Run API → RQ workflow: enqueues work (evidence: `wepppy/microservices/rq_engine/landuse_routes.py`)
- RQ workflow → RQ workers: queues jobs
- RQ workers → Watershed prep: prepares watershed
- RQ workers → Climate inputs: prepares climate
- RQ workers → Soils inputs: prepares soils
- RQ workers → Land-use inputs: prepares land use
- RQ workers → WEPP simulation: runs simulation
- RQ workers → NoDb controllers: uses run state
- NoDb controllers → Run files: persists state
- NoDb controllers → Redis coordination: caches and locks (evidence: `wepppy/nodb/base.py`)
- RQ workers → Scenario runs: runs scenarios
- Scenario runs → WEPP simulation: runs watershed (evidence: `wepppy/nodb/mods/omni/omni_run_orchestration_service.py`)
- RQ workers → Model extensions: uses extensions
- WEPPcloud user → Query engine: requests results
- Query engine → Run files: queries run data
- RQ workers → Result exports: exports results
- RQ workers → Live telemetry: publishes status
- Climate services → External data sources: requests climate data (evidence: `wepppy/climates/metquery_client.py`)
- RQ workers → Climate services: acquires climate
