Skip to content

[Cross Validation][Crop and Soil] Implement new cross validations rules related to the additional daily spread manure schedule inputs #3097

@matthew7838

Description

@matthew7838

Is your feature request related to a problem? Please describe.
The daily_spread manure configuration added in #2623 can be set up in ways that pass
input validation but silently apply no manure, which is hard to diagnose. The schema
validates each field in isolation and can't catch cross-file or conditional
inconsistencies. Misconfigurations seen during review:

  1. A field has daily_spread.is_daily_spreading: true, but the manure processor
    configuration contains no DailySpread storage, so daily-spread requests pull from a
    non-existent pool and nothing is ever applied.
  2. spread_all_available_manure: true while is_daily_spreading: falseis_daily_spreading
    is the master switch, so daily spreading is silently off and spread_all has no effect,
    despite the user clearly intending to daily spread.
  3. is_daily_spreading: true with spread_all_available_manure: false but both
    nitrogen_spread_amount and phosphorus_spread_amount are 0 — the daily-spread event is
    created and then immediately discarded, so daily spreading is effectively off despite
    being "on."

Describe the solution you'd like
Add cross-validation rule(s) under input/metadata/cross_validation/ for daily spread:

  1. (Cross-file) If any manure schedule has daily_spread.is_daily_spreading: true, the manure
    processor config (manure_management.storage) must contain at least one entry with
    processor_type: "DailySpread".
  2. spread_all_available_manure: true requires is_daily_spreading: true (equivalently, if
    is_daily_spreading is false then spread_all_available_manure must be false).
  3. If is_daily_spreading: true and spread_all_available_manure: false, then at least one of
    nitrogen_spread_amount / phosphorus_spread_amount must be > 0.
  4. daily_spread.manure_type must be "solid" (or must match the type of an available
    DailySpread storage).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions