xiaohongshu
xiaohongshu
executing-hms-runs
Executes HEC-HMS simulations using HmsCmdr.compute_run(), handles parallel execution across multiple runs, and manages Jython script generation. Use when running HMS simulations, executing runs, computing models, or setting up parallel computation workflows. Handles HMS 3.x and 4.x version differ...
Full skill instructions
from hms_commander import init_hms_project, HmsCmdr
# Initialize project
init_hms_project(r"C:\Projects\watershed")
# Execute single run
HmsCmdr.compute_run("Run 1")
# Execute multiple runs in parallel
HmsCmdr.compute_parallel(["Run 1", "Run 2", "Run 3"], max_workers=2)
Code (Authoritative API):
hms_commander/HmsCmdr.py - Execution engine with complete docstringshms_commander/HmsJython.py - Script generation and version detectionExamples (Working Demonstrations):
examples/01_multi_version_execution.ipynb - Complete workflowexamples/04_hms_workflow.ipynb - End-to-end simulationRules (Patterns & Decisions):
.claude/rules/hec-hms/execution.md - Execution patterns.claude/rules/hec-hms/version-support.md - HMS 3.x vs 4.x differencesTrigger Scenarios:
Pattern: Initialize → Compute → Verify
See reference/compute_run.md for complete API details.
Key Decision: When to use compute_run() vs compute_test_mode()
compute_run() for actual simulationcompute_test_mode() to validate setup without runningPattern: Batch runs across multiple workers
See reference/parallel.md for parallel execution strategies.
Key Decision: How many workers?
os.cpu_count() - 1Pattern: Generate version-appropriate script → Execute via HMS
See reference/jython.md for script generation details.
Critical Decision: HMS 3.x vs 4.x
python2_compatible=TrueThis skill handles BOTH HMS 3.x and 4.x:
| Aspect | HMS 3.x | HMS 4.x |
|---|---|---|
| Architecture | 32-bit | 64-bit |
| Python Syntax | Python 2 (print "x") | Python 3 (print("x")) |
| Script Flag | python2_compatible=True | Default |
| Max Memory | ~1.3 GB | 32+ GB |
| Install Path | Program Files (x86) | Program Files |
See: .claude/rules/hec-hms/version-support.md for complete differences
from hms_commander import init_hms_project, HmsCmdr
init_hms_project(r"C:\Projects\watershed")
HmsCmdr.compute_run("Run 1")
See: examples/basic-run.md for complete walkthrough
runs = ["Baseline", "Alternative_1", "Alternative_2"]
HmsCmdr.compute_batch(runs)
See: examples/batch-runs.md for batch strategies
runs = ["Run_1", "Run_2", "Run_3", "Run_4"]
HmsCmdr.compute_parallel(runs, max_workers=2)
See: reference/parallel.md for worker allocation
from hms_commander import HmsJython
# Generate Python 2 compatible script
script = HmsJython.generate_compute_script(
project_path=r"C:\Projects\old_project",
run_name="Run 1",
python2_compatible=True # CRITICAL for HMS 3.x!
)
# Execute with HMS 3.x
success, stdout, stderr = HmsJython.execute_script(
script_content=script,
hms_exe_path=r"C:\Program Files (x86)\HEC\HEC-HMS\3.5"
)
See: .claude/rules/hec-hms/version-support.md for legacy workflows
Common Issues:
reference/jython.md#finding-hmsreference/jython.md#memory-allocation.claude/rules/hec-hms/version-support.mdreference/parallel.md#debuggingBefore Execution:
HmsBasin to modify parameters (see parsing-basin-models skill)HmsMet to update precipitation (see updating-met-models skill)HmsControl to set time window (see .claude/rules/hec-hms/control-files.md)After Execution:
HmsDss to extract results (see extracting-dss-results skill)HmsResults for analysis (see .claude/rules/hec-hms/dss-operations.md)Detailed API Documentation (load on-demand):
reference/compute_run.md - HmsCmdr.compute_run() complete APIreference/parallel.md - Parallel execution strategiesreference/jython.md - Script generation and executionreference/troubleshooting.md - Common issues and solutionsComplete Examples (working code):
examples/basic-run.md - Simple single runexamples/batch-runs.md - Sequential batch executionexamples/parallel-runs.md - Parallel execution with worker allocationexamples/legacy-3x.md - HMS 3.x compatibilityUse real HMS projects for testing:
from hms_commander import HmsExamples
# Extract example project
HmsExamples.extract_project("tifton")
# Test execution
init_hms_project("tifton/tifton")
HmsCmdr.compute_run("1970_simulation")
See: .claude/rules/testing/tdd-approach.md for testing philosophy
HMS creates output in the project folder. For organized results:
# Results go to project_folder/results/RUN_<run_name>.results
# DSS file location specified in .run file
Decision: HMS writes to project folder, not a separate destination folder like RAS.
from pathlib import Path
hms_path = Path(r"C:\Program Files (x86)\HEC\HEC-HMS\3.5")
is_3x = "(x86)" in str(hms_path) # 32-bit = HMS 3.x
python2_compatible = is_3x
Decision: Use install path pattern for version detection, not HMS version file.
try:
HmsCmdr.compute_run("Run 1")
except Exception as e:
# Check HMS log file for details
log_file = hms.project_folder / f"RUN_Run 1.log"
if log_file.exists():
print(log_file.read_text())
raise
Decision: HMS errors appear in log files, check those for diagnostics.
Navigation: This skill points to primary sources. For complete API details, read the code docstrings in hms_commander/HmsCmdr.py and hms_commander/HmsJython.py.
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience