Skip to content

[Manure][BeddedPack] Fix mcf transcription error - #3285

Open
ew3361zh wants to merge 10 commits into
devfrom
fix-mcf-transcription-error
Open

ew3361zh wants to merge 10 commits into
devfrom
fix-mcf-transcription-error

Conversation

@ew3361zh

Copy link
Copy Markdown
Collaborator

Adds option for BeddedPack MCF lookup table to account for shorter-term storage duration.

Context

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

What

Expands lookup table for BeddedPack MCF to 3 options:

  1. BEDDED_PACK_MCF_MIXED
  2. BEDDED_PACK_MCF_UNMIXED_SHORT
  3. BEDDED_PACK_MCF_UNMIXED_LONG

If the BeddedPack.storage_time_period is > 30 days or None, it is considered LONG and if it's < 30 days it is considered SHORT.

Why

Fixes a possible transcription error for BeddedPack MCF temperature bins as described in the issue.

How

Changed the lookup table format to better account for multiple UNMIXED options based on storage_time_period.
Adjusted the function that determines the factor to take into account storage_time_period and passes that attribute value around to allow for its use in the table lookup.

Test plan

I ran the available_simulation_tasks task to ensure all current example simulations are running as expected. I think some SME testing will be helpful to determine the scientific correctness of the fix.

Input Changes

Output Changes

  • N/A

Filter

@github-actions

Copy link
Copy Markdown
Contributor

Current Coverage: %

Mypy errors on fix-mcf-transcription-error branch: 1164
Mypy errors on dev branch: 1164
No difference in error counts

@github-actions

Copy link
Copy Markdown
Contributor

🚨 Some tests have failed.

@tomhuhh tomhuhh left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making this update. I had two clarification points that may need SME (@elle-andreen, @KFosterReed) input:

  1. For unmixed bedded pack, how should we handle exactly storage_time_period == 30 days / 1 month? My reading is that both IPCC 2019 and the 2024 USDA Bluebook specify factors for < 1 month and > 1 month, but do not explicitly define the exactly-1-month case. The current implementation treats 30 days as the long-duration case; I think we should agree on/document that choice.

  2. Which temperature should be passed into the MCF lookup: indoor barn-adjusted temperature or ambient annual temperature? Since bedded pack is an indoor housing system, using _determine_barn_temperature(...) may be consistent with other RuFaS housing systems. But IPCC climate-zone classification appears to be based on ambient climate variables, so I think this needs SME confirmation for traceability.

Image

(18, math.inf): 1.5,
}

BEDDED_PACK_MCF_UNMIXED_SHORT: dict[tuple[float, float], float] = {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be explicit about the variable name - BEDDED_PACK_MCF_UNMIXED_LESS_THAN_A_MONTH.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since a month is not a concrete number of days, would you be okay with BEDDED_PACK_MCF_UNMIXED_UNDER_30_DAYS?

(18, math.inf): 18.0,
}

BEDDED_PACK_MCF_UNMIXED_LONG: dict[tuple[float, float], float] = {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar here - BEDDED_PACK_MCF_UNMIXED_MORE_THAN_A_MONTH

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here it would be something like BEDDED_PACK_MCF_UNMIXED_30_DAYS_OR_MORE (or worded however we decide the exact breakdown for where 30 days storage time falls)?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me. Thanks Niko!

@github-actions

Copy link
Copy Markdown
Contributor

Current Coverage: 99%

Mypy errors on fix-mcf-transcription-error branch: 1164
Mypy errors on dev branch: 1164
No difference in error counts

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] Possible transcription error in bedded pack MCF temperature bins

2 participants