← Back to Skills Marketplace
zhonghao1995

Swmm Plot

by Zhonghao Zhang · GitHub ↗ · v0.7.3 · MIT-0
cross-platform ✓ Security Clean
38
Downloads
0
Stars
0
Active Installs
2
Versions
Install in OpenClaw
/install swmm-plot
Description
Publication-grade plotting for SWMM rainfall–runoff time-series figures. Use when an agent needs to produce a paired rainfall (top, inverted) + node flow (bo...
README (SKILL.md)

SWMM Plot (publication spec)

Part of Agentic SWMM — install the project first for the executable toolchain (aiswmm CLI, SWMM solver, MCP servers).

Before calling plot — ask the user

When the user asks to plot, always ask these questions first before calling any plot tool:

  1. Which entity? A specific node (junction / outfall) — by name — or a specific link (conduit) — by name?
    • List 3–5 high-peak-flow candidates from the run's RPT Link Flow Summary so the user can pick.
  2. Which attribute? Node options: Total_inflow, Depth_above_invert, Volume_stored_ponded, Flow_lost_flooding. Link options: Flow_rate, Velocity, Depth.
  3. Time window? Default is the full simulation (24h). Offer to limit to a focus day or HH:MM-HH:MM window if peaks occur in a short period.

Do NOT silently pick defaults. The user needs control — different plots answer different questions (peak inspection vs continuity vs flooding).

What this skill provides

  • A plotting script that reads:
    • rainfall TIMESERIES from a SWMM .inp (one named series at a time);
    • flow series from a SWMM .out binary (via swmmtoolbox).
  • Renders a paired rainfall + node-flow figure with a fixed publication style:
    • SI units (rain in mm per timestep or mm/h depending on rainKind);
    • rainfall on the top axis, inverted (depth grows downward);
    • flow on the bottom axis;
    • inward ticks, Arial, no auto title;
    • optional focusDay to crop to a single day; optional windowStart/windowEnd (HH:MM, only together with focusDay) for a sub-day window.

When to use this skill

Use after swmm-runner.swmm_run has produced both .inp and .out, and you want a single rainfall-vs-flow figure for one node (typically the model's outfall or the assigned upstream junction of a subcatchment of interest).

Do not use this skill for multi-node ensemble plots, exceedance curves, or sensitivity scans — those would belong to swmm-uncertainty / swmm-calibration (no plot tools there yet).

MCP tools

This skill backs three LLM-facing tools. plot_rain_runoff_si is routed through the MCP server; inspect_plot_options and map_run are direct Python handlers in the tool registry (agentic_swmm/agent/tool_handlers/swmm_plot.py and swmm_map.py).

  1. inspect_plot_options — inspect a run directory (or an explicit .inp / .out path) and return the available rainfall series names, node IDs, and node output attributes. Call this before plot_run so you can pass real names instead of placeholders. Required args: run_dir (or inp_path + out_file). Read-only; auto-approved under the QUICK permission profile.

  2. map_run — render the spatial network layout (subcatchments + conduits + outfalls) as a PNG. Reads the INP from the run directory automatically; pass inp to override. Required arg: run_dir. Optional: out_png, dpi, no_subcatchments, no_vertices.

  3. plot_run (proxies to plot_rain_runoff_si on the MCP server) — create a paired rainfall + node-flow figure from a run directory. Required arg: run_dir. Supply either node or link (mutually exclusive) to select the lower panel. Optional: rain_ts, rain_kind, node_attr, out_png. Day-window cropping: pass focus_day (YYYY-MM-DD) to crop the axis to one calendar day; pass window_start and window_end (both HH:MM) to further narrow to a sub-day window — both require focus_day (the server rejects window_start/window_end without focus_day).

mcp/swmm-plot/server.js exposes one underlying tool:

  1. plot_rain_runoff_si — low-level render call used by plot_run. Prefer plot_run (which accepts run_dir) over calling this directly.
    • Args:
      • inp (required): path to the SWMM .inp (the rainfall TIMESERIES is read from here).
      • out (required): path to the SWMM .out binary.
      • outPng (required): where to write the PNG.
      • rainTs (no usable default — the schema ships the self-documenting placeholder \x3Crainfall-series-name>, which fails at render time if not replaced; always supply the actual series name from the .inp [TIMESERIES] section via inspect_plot_options): name of the rainfall TIMESERIES inside the .inp.
      • rainKind (default "depth_mm_per_dt"): one of intensity_mm_per_hr, depth_mm_per_dt, cumulative_depth_mm.
      • dtMin (default 5): timestep of the rainfall series in minutes.
      • node (no usable default — the schema ships the self-documenting placeholder \x3Coutfall-or-junction>, which fails at render time if not replaced; always supply a real outfall or junction name via inspect_plot_options): node ID to plot from the .out.
      • nodeAttr (default "Total_inflow"): which swmmtoolbox attribute (e.g. Total_inflow, Lateral_inflow, Flow_lost_flooding).
      • dpi (default 300).
      • focusDay (optional, YYYY-MM-DD): crop axis to a single day plus padding.
      • windowStart / windowEnd (optional, HH:MM; only valid together with focusDay): sub-day time window within the focus day. Rejected with a clear error if used without focusDay.
      • padHours (default 2).

Recommended orchestration

inspect_plot_options  →  list available series + node names
swmm-runner.run_swmm_inp  →  model.inp + model.out
plot_run              →  outfall_flow.png  (or junction_flow.png)

Call inspect_plot_options first to get the real rainfall series name and outfall node name, then pass those to plot_run. If multiple nodes need to be plotted, call plot_run once per node with a different out_png path.

Conventions

  • Strict publication style: do not write a title in the plot; titles belong to the surrounding document.
  • SI units only.
  • Rainfall axis is always inverted; depth grows downward so it doesn't overlap the flow series visually.

Known limitations

  • Only one rainfall series is plotted at a time (rainTs is a single name); multi-gauge inputs need separate figures.
Usage Guidance
Before installing, note that this skill is useful only with the Agentic SWMM/SWMM plotting toolchain and will read local model/run files you point it at. Review output paths when invoking it, since the scripts create parent directories and write PNG files at the requested location.
Capability Tags
crypto
Capability Assessment
Purpose & Capability
The artifacts match the stated purpose: plotting rainfall-runoff time series and SWMM network layouts from .inp, .out, and optional geoparquet run artifacts.
Instruction Scope
Runtime instructions emphasize user selection of entities, attributes, and time windows before plotting, and the scripts fail clearly on placeholder defaults instead of silently choosing targets.
Install Mechanism
The skill points users to install the broader Agentic SWMM project for the executable toolchain, but the included artifact itself contains only the skill documentation and two plotting scripts.
Credentials
File reads are limited to user-supplied SWMM model/output/geoparquet files, and writes are limited to user-specified PNG output paths and parent directory creation for those outputs.
Persistence & Privilege
No credential use, background execution, privilege escalation, autorun persistence, destructive file operations, or network activity was found in the artifacts.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install swmm-plot
  3. After installation, invoke the skill by name or use /swmm-plot
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v0.7.3
Add project link back to the Agentic SWMM repository (install the project for the executable toolchain).
v0.7.2
Initial ClawHub release, aligned with agentic-swmm-workflow v0.7.2.
Metadata
Slug swmm-plot
Version 0.7.3
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 2
Frequently Asked Questions

What is Swmm Plot?

Publication-grade plotting for SWMM rainfall–runoff time-series figures. Use when an agent needs to produce a paired rainfall (top, inverted) + node flow (bo... It is an AI Agent Skill for Claude Code / OpenClaw, with 38 downloads so far.

How do I install Swmm Plot?

Run "/install swmm-plot" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Swmm Plot free?

Yes, Swmm Plot is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Swmm Plot support?

Swmm Plot is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Swmm Plot?

It is built and maintained by Zhonghao Zhang (@zhonghao1995); the current version is v0.7.3.

💬 Comments