Conversation
…rmSystems/MASM into calf_ration_implement
|
Current Coverage: 95% Mypy errors on calf_ration_implement branch: 3577 |
|
🚨 Please update the changelog. This PR cannot be merged until |
Updated the order of the code to make it more streamlined.
tomhuhh
left a comment
There was a problem hiding this comment.
Good job Joe! I did not spot major issues with the code. I noticed that in the calculation of the intake of starters, the original code did not consider the dry matter content of the starter while it considered the dry matter content of whole milk and milk replacer. Also, I could not find the scientific documentation for calf ration calculations on Basecamp so I cannot verify the equation. A quick search on Google with these key words and the parameters also did not result in the information I was looking for. I would like to learn what your and others' thoughts are on whether or not to consider the dry matter content of starters. Thanks!
|
Also, I would like to document that with the current version and the default input files, if I set the user defined ration to be true, the resulted daily dry matter intake per day is 84.4% to 102.2% of the previously fixed dry matter intake estimates (6 kg/head/d). |
There was a problem hiding this comment.
Does this If-else statement eliminate the need for the user input for "milk_type"? If so, can we delete it while keeping the model backwards compatible for input files that have this input? Or, maybe we just make an issue about user input adjustments that need to be made?
There was a problem hiding this comment.
Correct! The intent here was that it could streamline the feed inputs a little bit...with the user simply selecting the feed IDs for calves as they do for the other animal classes, since it's currently a little redundant.
We could still keep this input, but we'd have to think through the logic of when (or if) it should ever override the user defined feeds.
If we do deprecate it: to maintain backwards compatibility (especially with FARM ES) what I thought is that we could keep the option in the metadata, and simply not let it get to the codebase itself. I think we could/should capture it and flag a warning that the input has been deprecated, and the user should specify the feeds in the feed input JSON (we may want to think about a process for any input field deprecation we do in the future).
|
Current Coverage: 89% Mypy errors on calf_ration_implement branch: 3263 |
|
🚨 Please update the changelog. This PR cannot be merged until |
…rmSystems/RuFaS into calf_ration_implement
|
Current Coverage: % Mypy errors on calf_ration_implement branch: 3216 |
|
🚨 Please update the changelog. This PR cannot be merged until |
|
Current Coverage: % Mypy errors on calf_ration_implement branch: 3216 |
|
🚨 Please update the changelog. This PR cannot be merged until |

Context
Issue(s) closed by this pull request: more completely closes #1137
and #1337 , also should close #2517 and #2016 for calves
What
Adds logic to re-implement previously developed calf ration formulation and requirement calculations.
This will work for both the default user defined ration behavior, and automated "modes", but note that neither utilize the minimize method, like we do for all other animal classes. A) The user defined method gets the pen's average dry matter intake requirement and then applies the percentages in the feed input file. B) The automated version will use the ration as formulated by the equations now housed in calc_intake in CalfRationManager
Why
Calves were backburnered for a while, and had been restricted to using only precisely two inputs, and would crash if users tried selecting other feed IDs.
More context and associated problems
This will require thought around what to do with the "milk_type" input in the animal input JSON, which could be deprecated (see comments by Kristan and Joe)
Default scenario values give only a rough total of 1kg per animal in the calf pen, whereas the diet we hardcoded on main is 3kg. This needs evaluation as to whether A) I've made a mistake in this translation of the old methods to current inputs, or if we're B) intentionally 3X overfeeding by default, or C) the methods themselves need refinement.
Related: given that these are process based methods independent of NASEM/NRC, consideration should be given to how the user may want to handle calf ration formulation independent of the user-defined ration formulation for other animal types, e.g. give some pre-forumlated ration for calves, but use automated formulation methods for all other groups. This level of granularity may not be necessary, but should get input from other SMEs involved in calf nutrition.
How
Iterates over all calves in a calf pen, calculates their intake, then sums those and updates pen attribute for
ration_per_animalto reflect total divided by the number of animals in the pen.Test plan
Currently lacks unit tests for new methods.
Needs more testing with multiple, more complex calf rations.
See "More context and associated problems" and section, as this needs evaluation to see if we're underfeeding with these new methods, and how temperature will/can affect the equations used here.
You can see the basic output using the following graph filter: