Draft
Conversation
tomhuhh
reviewed
Apr 9, 2026
| + 0.022 * body_weight | ||
| + (-0.689 - 1.87 * parity_adjustment_factor) * body_condition_score_5 | ||
| ) * (1 - (0.212 + parity_adjustment_factor * 0.136) * exp(-0.053 * days_in_milk)) | ||
| if RationManager.lac_cow_dry_matter_intake == 0: |
Collaborator
There was a problem hiding this comment.
Hi @JoeWaddell ! Do you think null might be a better design choice here?
null means "no value provided, use the model." 0 means zero — which is physically impossible.
It also eliminates the float comparison issue. == 0 on a float is fragile. if RationManager.lac_cow_dry_matter_intake is None is exact and unambiguous.
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.
Context
Issue(s) closed by this pull request: closes #
What
Adds new input to override the NASEM (not added for NRC logic) calculation of dry matter intake for lactating cows. Now will use the user provided value in the Feed input file. If user inputs 0, the NASEM equation will be used as normal.
Why
Useful to compare ration and eCH4 production across systems, fixing the DMI to a specific value.
How
Test plan
No tests updated yet.
Input Changes
added
lac_cow_dry_matter_intakeas an input in Feed file.Output Changes
Filter