Skip to content

[Crop and Soil] Implement pasture crop type#3163

Open
matthew7838 wants to merge 10 commits into
devfrom
pasture-crop-type
Open

[Crop and Soil] Implement pasture crop type#3163
matthew7838 wants to merge 10 commits into
devfrom
pasture-crop-type

Conversation

@matthew7838

@matthew7838 matthew7838 commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Adds a pasture crop type for grazing, modeled after Tall Fescue, whose harvest deposits all cut biomass into the field as residue rather than removing it as harvested yield.

Context

Issue(s) closed by this pull request: closes #3131

What

  • Adds a new pasture crop configuration (perennial, based on the Tall Fescue hay parameters) that is available for use in crop rotations.
  • Adds a new optional crop-configuration flag, deposit_all_residue_at_harvest (default false).
  • When that flag is set, harvest operations collect no yield and deposit all cut biomass into the field as residue; no harvested crop is sent to feed storage.

Why

A pasture crop type is needed so animals can graze. For a grazed crop, forage removal is handled by grazing rather than by the harvest operation, so a "harvest" of a pasture should leave all cut biomass in the field as residue instead of removing it as stored yield.

How

  • Adds deposit_all_residue_at_harvest: bool = False to CropData, to the CropConfiguration TypedDict (as NotRequired), and to the crop-configuration schema in RUFAS/input/metadata/properties/default.json with "default": false (so the existing configurations auto-fill the field and are unaffected).
  • In CropManagement.manage_harvest, when the flag is set the crop is cut with collected_fraction=0.0 and _get_harvested_crop is skipped, so the method returns None and all cut biomass flows to the field as residue via the existing residue-transfer path.
  • Adds the pasture configuration to input/data/crop_configurations/default_crop_configs.json with the flag set to true.
  • Tightens the manage_harvest / manage_crop_harvest return type to HarvestedCrop | None (the method already returned None for kill-only operations) and widens the two field.py call-site annotations to match; this also removes a pre-existing mypy error.

Test plan

  • Run with updated unit tests.
  • SME output checks.

Input Changes

  • Adds an optional deposit_all_residue_at_harvest boolean (default false) to each crop configuration under crop_configuration_properties.
  • Adds a new pasture crop configuration to input/data/crop_configurations/default_crop_configs.json.
  • Existing crop configurations are unchanged; the new field auto-fills to false for all of them.

Output Changes

  • N/A

Filter

@github-actions
github-actions Bot force-pushed the pasture-crop-type branch from b7ae487 to c6865f4 Compare July 24, 2026 08:21
@github-actions
github-actions Bot force-pushed the pasture-crop-type branch from c6865f4 to 6d785a4 Compare July 24, 2026 08:21
@github-actions

Copy link
Copy Markdown
Contributor

Current Coverage: 99%

Mypy errors on pasture-crop-type branch: 1137
Mypy errors on dev branch: 1136
1 more errors on pasture-crop-type branch

@matthew7838
matthew7838 marked this pull request as ready for review July 24, 2026 08:34
@matthew7838
matthew7838 requested review from allisterakun, ew3361zh and morrowcj and removed request for ew3361zh July 24, 2026 09:15
@github-actions

Copy link
Copy Markdown
Contributor

Current Coverage: 99%

Mypy errors on pasture-crop-type branch: 1135
Mypy errors on dev branch: 1136
1 fewer errors on pasture-crop-type branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Soil & Crop]Implement a "pasture" crop type for grazing

1 participant