Skip to content

[Crop and Soil][Manure] Set daily spread manure type from user input - #3207

Open
matthew7838 wants to merge 5 commits into
devfrom
input-dailyspread-type
Open

[Crop and Soil][Manure] Set daily spread manure type from user input#3207
matthew7838 wants to merge 5 commits into
devfrom
input-dailyspread-type

Conversation

@matthew7838

Copy link
Copy Markdown
Collaborator

Makes daily spread manure applications use the manure_type set by the user in the manure schedule's daily_spread block, instead of always treating daily spread manure as solid.

Context

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

What

  • Removes DailySpread from STORAGE_CLASS_TO_TYPE in manure_manager.py, since daily spread manure has no manure type of its own.
  • Adds ManureManager._effective_storage_manure_type(), which returns the requested type for DailySpread storages and the class-mapped type for all others.
  • Uses that helper in _aggregate_storage_nutrients() and _remove_nutrients_from_storage(), the two places that filter storages by manure type.

Why

The user input existed and reached the nutrient request, but the manure manager compared it against a hard-coded solid type for DailySpread. A "liquid" daily spread request matched no storage, so the request was fulfilled with nothing and the run finished normally with no manure applied. Manure type also changes crop and soil outcomes: only liquid manure adds manure water to the field.

How

Manure type is now taken from the request, which carries the user input, rather than from the storage class. Solid behavior is unchanged.

Test plan

  • Parametrized test_handle_nutrient_request_for_storages_pools_daily_spread and test_remove_nutrients_from_storage_daily_spread over both manure types, and added test_effective_storage_manure_type. The new liquid cases fail on dev and pass here.
  • Full manure and crop and soil test suites pass (2414 tests).
  • Ran two 1-year freestall simulations, liquid and solid, with lactating pen manure routed to the dailyspread processor and a 5 kg N/day daily spread target. Both finished with 0 errors and fulfilled 364 of 365 daily requests per field (1820 kg N, ~403 t manure). Before this change the liquid run applied nothing. The liquid run added ~3.3 mm of manure water per field over the year; the solid run added none, as expected.

Input Changes

  • N/A. daily_spread.manure_type already exists and already accepts liquid or solid; it is now actually used.

Output Changes

  • N/A

Filter

@matthew7838 matthew7838 changed the title Set daily spread manure type from user input [Crop and Soil][Manure] Set daily spread manure type from user input Aug 14, 2026
@matthew7838 matthew7838 self-assigned this Aug 14, 2026
@github-actions
github-actions Bot force-pushed the input-dailyspread-type branch from cfe10f6 to c5d5883 Compare August 14, 2026 05:19
@github-actions
github-actions Bot force-pushed the input-dailyspread-type branch from c5d5883 to 40672d2 Compare August 14, 2026 05:19
@github-actions

Copy link
Copy Markdown
Contributor

Current Coverage: 99%

Mypy errors on input-dailyspread-type branch: 1135
Mypy errors on dev branch: 1134
1 more errors on input-dailyspread-type branch

@elle-andreen

Copy link
Copy Markdown
Contributor

@matthew7838 This looks good to me, but in testing this, I noticed that the manure type value for each manure request result is not actually outputted to output manager. It would be helpful for users to be able to see manure type directly in the outputs. I checked with Clay and Kristan on this, and we agreed that the record_manure_application function in field.py would be a logical place to add this output. Is that ask small and related enough that it could also go in this PR, or would you prefer a separate issue be opened? Let me know!

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.

[Manure][Crop & Soil] Set manure type for daily spread by user input

2 participants