Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions RUFAS/EEE/economics/mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,36 @@
"Bedding requirements": {
"biophysical_simulation": ["AnimalModuleReporter.report_daily_pen_total.number_of_animals_in_pen_.*"],
"input_manager": ["animal.pen_information.*.manure_streams.0.bedding_name"],
"match_source": "input_manager",
"wildcard_value_map": {"0_CALF": "0", "1_GROWING": "1", "2_CLOSE_UP": "2", "3_LAC_COW": "3"},
# Handled by special_cases.bedding_requirements.BeddingRequirementsHandler
# (issue #3088): each pen's bedding price is paired with that pen's
# animal count and converted from the annual dollar-per-head price.
"bedding_configs_path": "animal.bedding_configs",
# SME-confirmed: the dollar-per-head bedding prices are per LACTATING
# cow, so only lactating-cow pens are billed. Other pens still get
# physical bedding in the biophysical simulation; they are just not
# part of this economic line item.
"billable_pen_combinations": ["LAC_COW"],
# A pen's manure_stream bedding_name is a user config name; resolve
# it to the config's canonical bedding_type, then to an economics
# file key. This table is the COMPLETE registry of billable bedding
# types: identity entries (e.g. "sand" -> "sand") are deliberate so
# the supported set is explicit in one place. A type absent here
# (e.g. "none") incurs no cost.
"bedding_type_to_file_key": {
"sand": "sand",
"sawdust": "sawdust",
"straw": "straw",
"CBPB sawdust": "CBPB",
"manure solids": "manure_solids",
},
"economics_files": {
"CBPB": "commodity_prices_bedding_compost_bedded_pack_dollar_per_head",
"manure_solids": "commodity_prices_bedding_manure_solids_dollar_per_head",
"sand": "commodity_prices_bedding_sand_dollar_per_head",
"sawdust": "commodity_prices_bedding_sawdust_dollar_per_head",
"straw": "commodity_prices_bedding_straw_dollar_per_head",
},
"preprocessing": "average number of animals in each pen",
"preprocessing": "per-pen annual bedding cost: average head per year x dollar-per-head-per-year",
},
"Purchased heifers": {
"biophysical_simulation": ["AnimalModuleReporter.report_life_cycle_manager_data.bought_heifer_num"],
Expand Down
4 changes: 2 additions & 2 deletions RUFAS/EEE/economics/preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from RUFAS.util import Aggregator
from RUFAS.EEE.economics.mapping import ECONOMIC_MAP
from RUFAS.EEE.economics.preprocessing_context import PreprocessingContext
from RUFAS.EEE.economics.special_cases import SpecialCaseHandler, SeedCostHandler
from RUFAS.EEE.economics.special_cases import SpecialCaseHandler, BeddingRequirementsHandler
from RUFAS.EEE.economics.fallback_values import (
BIOPHYSICAL_FALLBACKS,
ECONOMIC_PRICE_FALLBACK,
Expand All @@ -44,7 +44,7 @@
COMPUTED_PREPROCESSING_INPUT_PATH = Path("<computed: EconomicPreprocessor.preprocess>")

SPECIAL_CASE_HANDLERS: list[type[SpecialCaseHandler]] = [
SeedCostHandler,
BeddingRequirementsHandler,
]


Expand Down
4 changes: 2 additions & 2 deletions RUFAS/EEE/economics/special_cases/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"""

from RUFAS.EEE.economics.special_cases.base import SpecialCaseHandler
from RUFAS.EEE.economics.special_cases.seed_costs import SeedCostHandler
from RUFAS.EEE.economics.special_cases.bedding_requirements import BeddingRequirementsHandler


__all__ = ["SpecialCaseHandler", "SeedCostHandler",]
__all__ = ["SpecialCaseHandler", "BeddingRequirementsHandler"]
Loading