[Animal] Wire per-additive dose fields into methane mitigation calculation#3164
Open
matthew7838 wants to merge 8 commits into
Open
[Animal] Wire per-additive dose fields into methane mitigation calculation#3164matthew7838 wants to merge 8 commits into
matthew7838 wants to merge 8 commits into
Conversation
github-actions
Bot
force-pushed
the
methane-mitigation-additive-dose
branch
from
July 25, 2026 07:59
fc941c9 to
4ea49b0
Compare
github-actions
Bot
force-pushed
the
methane-mitigation-additive-dose
branch
from
July 25, 2026 08:01
4ea49b0 to
432141c
Compare
Contributor
|
Current Coverage: 99% Mypy errors on methane-mitigation-additive-dose branch: 1136 |
Contributor
|
🚨 Unauthorized changes detected in protected files. Please remove these changes if they are not intended. |
Contributor
|
Current Coverage: 99% Mypy errors on methane-mitigation-additive-dose branch: 1136 |
Contributor
|
🚨 Unauthorized changes detected in protected files. Please remove these changes if they are not intended. |
…' into methane-mitigation-additive-dose
matthew7838
marked this pull request as ready for review
July 25, 2026 08:47
Contributor
|
Current Coverage: 99% Mypy errors on methane-mitigation-additive-dose branch: 1136 |
Contributor
|
🚨 Unauthorized changes detected in protected files. Please remove these changes if they are not intended. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Feeds the dose of the selected methane mitigation additive into the enteric methane equations, reading it from that additive's own input field instead of a separate generic field.
Context
Issue(s) closed by this pull request: closes #3030
What
AnimalConfiggains_METHANE_MITIGATION_DOSE_FIELDS, mapping eachmethane_mitigation_methodto the input field holding its dose.AnimalConfig.set_from_data()resolvesmethane_mitigation_additive_amountthrough that mapping."None"and any unrecognized method resolve to0.0.methane_mitigation_additive_amountinput fromdefault.json,example_freestall_animal.json,example_open_lot_animal.json, and the herd manager test fixture.animal_cross_validation.jsonblocks that existed to keep the generic field in sync with the per-additive fields.Why
The animal config carried two overlapping sets of inputs: a generic
methane_mitigation_additive_amount, which was the only one Python read, and the four named per-additive fields (3-NOP_additive_amount,monensin_additive_amount,essential_oils_additive_amount,seaweed_additive_amount), which had descriptions and recommended min/max ranges but were never read.How
set_from_data()looks up the selected method in_METHANE_MITIGATION_DOSE_FIELDSand reads that field. A method with no entry in the mapping (including"None") yields0.0, which is what the mitigation equations already fall through to.With the dose now derived rather than user-supplied, the generic input and the five cross-validation rules that policed it are redundant and are deleted. Every one of those rules aliased
animal.methane_mitigation.methane_mitigation_additive_amount, so they had to go with the field.Test plan
Input Changes
animal.methane_mitigation.methane_mitigation_additive_amountfromRUFAS/input/metadata/properties/default.json. The dose is now derived frommethane_mitigation_method, not supplied by the user.input/data/animal/example_freestall_animal.jsonandinput/data/animal/example_open_lot_animal.json.input/metadata/cross_validation/animal_cross_validation.json("When methane mitigation method is None / 3-NOP / monensin / essential_oils / seaweed_additive, ...").methane_mitigation_additive_amountcontinue to load; the key is ignored.Output Changes
Filter
No output changes, so no filter is needed.