Skip to content
Back to skills

Docs

ASecurity

> **Stage ID**: s7_model_assembly > **Pipeline order**: 7 of 10 > **Depends on**: s1_crop_selection, s2_soil_profile, s3_weather_prep, s4_initial_conditions, s5_irrigation, s6_field_management

  • 200 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 11, 2026
testingpython

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-74fdc5ae/badge)](https://www.skillsdirectory.com/skills/lzwei196-docs-74fdc5ae)

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 Assembly -- Skill Document

> **Stage ID**: s7_model_assembly
> **Pipeline order**: 7 of 10
> **Depends on**: s1_crop_selection, s2_soil_profile, s3_weather_prep, s4_initial_conditions, s5_irrigation, s6_field_management

## Purpose

Combine all prepared components (crop, soil, weather, initial conditions, irrigation, field management) into a single AquaCropModel object ready for execution. This stage validates compatibility between components and sets simulation timing.

## Prerequisites

- [ ] Crop object created (S1)
- [ ] Soil object created (S2)
- [ ] Weather DataFrame prepared with ET0 (S3)
- [ ] InitialWaterContent object created (S4)
- [ ] IrrigationManagement object created (S5, optional -- defaults to rainfed)
- [ ] FieldMngt object created (S6, optional -- defaults to no management)

## Inputs

| Input | Type | Source | Description |
|-------|------|--------|-------------|
| sim_start_time | string | User | Simulation start date, format 'YYYY/MM/DD' |
| sim_end_time | string | User | Simulation end date, format 'YYYY/MM/DD' |
| weather_df | DataFrame | S3 | Daily weather data |
| soil | Soil | S2 | Soil profile |
| crop | Crop | S1 | Crop parameters |
| initial_water_content | InitialWaterContent | S4 | Initial soil water |
| irrigation_management | IrrigationManagement | S5 | Irrigation strategy (optional) |
| field_management | FieldMngt | S6 | Field management (optional) |
| off_season | bool | User | Simulate off-season periods (default False) |

## Procedure

### Step 1: Verify date format

Dates MUST use **slash separators**: `'YYYY/MM/DD'`

```python
sim_start = '2000/01/01'   # CORRECT
sim_end   = '2005/12/31'   # CORRECT
# sim_start = '2000-01-01'  # WRONG -- raises ValueError
```

### Step 2: Verify weather coverage

The weather DataFrame must cover the entire simulation period:
```python
assert weather_df.Date.min() <= pd.Timestamp(sim_start)
assert weather_df.Date.max() >= pd.Timestamp(sim_end)
```

### Step 3: Assemble model

```python
from aquacrop import AquaCropModel

model = AquaCropModel(
    sim_start_time=sim_start,
    sim_end_time=sim_end,
    weather_df=weather_df,
    soil=soil,
    crop=crop,
    initial_water_content=iwc,
    irrigation_management=irr,     # defaults to rainfed if omitted
    field_management=field,         # defaults to FieldMngt() if omitted
    off_season=False,               # True for multi-year continuous simulation
)
```

### Step 4: Pre-flight checks

Run tool `validate_model_config`:
- Date format correct (slashes not dashes)
- Weather covers simulation period
- Planting date falls within simulation period
- Soil depth >= crop max root depth
- IWC layers match soil layers

## Expected Outputs

| Output | Path | Verification |
|--------|------|--------------|
| AquaCropModel instance | in-memory | No ValueError raised during construction |

## Validation Checks

1. **Date format**: Uses '/' separator. See dt_009.
2. **Weather coverage**: DataFrame dates span simulation period
3. **Planting within sim**: Crop planting date falls between start and end
4. **Multi-season**: If `off_season=False` and sim spans multiple years, only one growing season is simulated per year

## Common Pitfalls

> **PITFALL**: Date format with dashes instead of slashes
> `'2000-01-01'` raises ValueError: "sim_start_time format must be 'YYYY/MM/DD'".
> **Do this instead**: Always use slashes: `'2000/01/01'`.
> See diagnostic triplet dt_009.

> **PITFALL**: Simulation period does not cover planting to maturity
> If sim_end_time is before expected maturity, the crop will not complete its cycle and yield will be zero or partial.
> **Do this instead**: Ensure sim_end_time is at least ~200 days after planting for grain crops.

> **PITFALL**: off_season=False skips inter-season periods
> With off_season=False (default), the model jumps from harvest to next planting. For continuous soil moisture tracking, set off_season=True.

---

*This skill document is part of the aquacrop-ospy-knowledge infrastructure.*
*Stage 7 of 10 | Tools used: assemble_model, validate_model_config | Related triplets: dt_009, dt_010*

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…