Skip to content
Back to skills

Docs

ASecurity

> **Stage ID**: s8_execution > **Pipeline order**: 8 of 10 > **Depends on**: s7_model_assembly

  • 200 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 11, 2026
devopspython

Security analysis

A100/100

Pro scans all 16 files and shows the line behind each finding

Scanned September 11, 2026

npx -y skills add lzwei196/KISS---Knowledge-Infrastructure-for-Scientific-Simulation --skill docs --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Docs?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Docs
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/lzwei196-docs-775513a0/badge)](https://www.skillsdirectory.com/skills/lzwei196-docs-775513a0)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Model Execution -- Skill Document

> **Stage ID**: s8_execution
> **Pipeline order**: 8 of 10
> **Depends on**: s7_model_assembly

## Purpose

Execute the AquaCrop simulation. The model steps through each day, computing canopy development, transpiration, soil water balance, biomass accumulation, and yield formation. Unlike VIC or DSSAT (external executables with file I/O), AquaCrop-OSPy runs entirely in-memory as Python code.

## Prerequisites

- [ ] AquaCropModel assembled (S7 complete)
- [ ] No unresolved validation warnings from S7

## Inputs

| Input | Type | Source | Description |
|-------|------|--------|-------------|
| model | AquaCropModel | S7 | Assembled model object |

## Procedure

### Step 1: Run to completion

```python
success = model.run_model(till_termination=True)
assert success == True, "Model did not complete"
```

### Step 2: Alternative -- step-by-step execution

For real-time applications or progress monitoring:

```python
# Initialize and run first 30 days:
model.run_model(num_steps=30, initialize_model=True)
# Continue for 30 more days:
model.run_model(num_steps=30, initialize_model=False)
# Run to end:
model.run_model(till_termination=True, initialize_model=False)
```

### Step 3: Check completion

```python
info = model.get_additional_information()
print(f"Finished: {info['has_model_finished']}")
print(f"Runtime: {info['execution_time']:.2f} seconds")
```

### Step 4: Verify outputs exist

```python
final = model.get_simulation_results()
assert final is not False, "Model not finished (get_simulation_results returned False)"
assert len(final) > 0, "No seasonal results -- check if crop reached harvest"
```

## Expected Outputs

| Output | Path | Verification |
|--------|------|--------------|
| Execution success | boolean | `run_model()` returns True |
| Output DataFrames | in-memory | `get_simulation_results()` returns DataFrame |

## Validation Checks

1. **Return value**: `run_model()` returns True
   - If False or exception: Check dt_014 (zero yield scenarios)

2. **Results available**: `get_simulation_results()` returns DataFrame, not False
   - If False: Model has not finished. Run more steps.

3. **Yield sanity**: `Dry yield > 0` for at least one season
   - If zero: See dt_014 for silent crop death causes

## Common Pitfalls

> **PITFALL**: Calling get_simulation_results() before model finishes
> If run_model() was called with num_steps (not till_termination) and the model has not reached the end, get_simulation_results() returns False.
> **Do this instead**: Either use `till_termination=True`, or check `get_additional_information()['has_model_finished']` before accessing results.

> **PITFALL**: Calling run_model() twice with initialize_model=True
> The second call reinitializes the model, losing all previous simulation state.
> **Do this instead**: Set `initialize_model=False` for subsequent calls.

> **PITFALL**: Silent crop death
> The model may run to completion with yield=0 if the crop dies from extreme water stress, heat stress, or waterlogging. No error is raised.
> **Do this instead**: Check canopy_cover trajectory in crop_growth output. If canopy never develops, the crop died.
> See diagnostic triplet dt_008, dt_014.

---

*This skill document is part of the aquacrop-ospy-knowledge infrastructure.*
*Stage 8 of 10 | Tools used: run_aquacrop | Related triplets: dt_008, dt_014*

Files in this skill

  • REFERENCES.md1.6 KB
  • format_spec.yaml35.8 KB
  • model_couplings.yaml13.5 KB
  • papers.json4.9 KB
  • s10_water_productivity_skill.md7.1 KB
  • s1_crop_selection_skill.md4.5 KB
  • s2_soil_profile_skill.md4 KB
  • s3_weather_prep_skill.md5.7 KB
  • s4_initial_conditions_skill.md3.4 KB
  • s5_irrigation_skill.md5.7 KB
  • s6_field_management_skill.md2.9 KB
  • s7_model_assembly_skill.md4 KB
  • s8_execution_skill.md3.3 KB
  • s9_output_analysis_skill.md5.3 KB
  • validation_convention.yaml23 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…