Skip to content
Draft
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![Flake8](https://img.shields.io/badge/Flake8-passed-brightgreen)](https://github.com/RuminantFarmSystems/MASM/actions/workflows/combined_format_lint_test_mypy.yml)
[![Pytest](https://img.shields.io/badge/Pytest-passed-brightgreen)](https://github.com/RuminantFarmSystems/MASM/actions/workflows/combined_format_lint_test_mypy.yml)
[![Coverage](https://img.shields.io/badge/Coverage-99%25-brightgreen)](https://github.com/RuminantFarmSystems/MASM/actions/workflows/combined_format_lint_test_mypy.yml)
[![Flake8](https://img.shields.io/badge/Flake8-failed-red)](https://github.com/RuminantFarmSystems/MASM/actions/workflows/combined_format_lint_test_mypy.yml)
[![Pytest](https://img.shields.io/badge/Pytest-failed-red)](https://github.com/RuminantFarmSystems/MASM/actions/workflows/combined_format_lint_test_mypy.yml)
[![Coverage](https://img.shields.io/badge/Coverage-%25-red)](https://github.com/RuminantFarmSystems/MASM/actions/workflows/combined_format_lint_test_mypy.yml)
[![Mypy](https://img.shields.io/badge/Mypy-1191%20errors-red)](https://github.com/RuminantFarmSystems/MASM/actions/workflows/combined_format_lint_test_mypy.yml)


Expand Down
1 change: 1 addition & 0 deletions RUFAS/EEE/EEE_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ def estimate_all() -> None:
om.add_log("Energy Processing", "Starting processing of energy.", info_map)
EnergyEstimator.estimate_all()
om.add_log("Energy Processing", "Completed processing of energy.", info_map)
print("EEE ran successfully.")
2 changes: 1 addition & 1 deletion RUFAS/simulation_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def simulate(self) -> None:
self.herd_manager.heiferII_events_by_id,
self.herd_manager.cow_events_by_id,
)
EEEManager.estimate_all()
# EEEManager.estimate_all()
t_end_sim = timer.time()

self.om.add_log("Simulation complete", "Simulation Completed.", info_map)
Expand Down
13 changes: 6 additions & 7 deletions RUFAS/task_manager.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from importlib import import_module
from importlib.metadata import PackageNotFoundError, version as get_installed_version
import multiprocessing
import random
Expand Down Expand Up @@ -222,6 +223,7 @@ def start(
"suppress_log_files": suppress_log_files,
"input_data_csv_export_path": Path(input_data_csv_export_path),
"input_data_csv_import_path": Path(input_data_csv_import_path),
"run_eee": False,
},
input_manager=self.input_manager,
output_manager=self.output_manager,
Expand Down Expand Up @@ -868,13 +870,6 @@ def handle_post_processing(
}
output_manager.add_log("Validation counts", f"{str(input_manager.elements_counter)}", info_map)

if args.get("run_eee", False):
pass
# TODO update path to `RUFAS.EEE.EEE_manager` when EEE is finalized and moved in either PR #2524 or #1299
# TODO update to be able to run EEE once farmgrown feed emissions are finalized #2580
# eee_manager_module = import_module("RUFAS.routines.EEE.EEE_manager")
# eee_manager_module.EEEManager.estimate_all()

if export_input_data_to_csv:
output_manager.create_directory(args["input_data_csv_export_path"])
Utility.combine_saved_input_csv(
Expand All @@ -900,6 +895,10 @@ def handle_post_processing(
output_manager.load_variables_pool_from_file(args["output_pool_path"])
output_manager.set_metadata_prefix("reload")

if args.get("run_eee", False):
eee_manager_module = import_module("RUFAS.EEE.EEE_manager")
eee_manager_module.EEEManager.estimate_all()

output_manager.print_errors_warnings_logs_counts(task_id)
if should_flush_im_pool:
input_manager.flush_pool()
Expand Down
2 changes: 2 additions & 0 deletions input/data/tasks/example_freestall_task.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
"log_verbosity": "errors",
"random_seed": 42,
"exclude_info_maps": false,
"chunkification": true,
"save_chunk_threshold_call_count": 100000000000,
"cross_validation_file_paths": [
"input/metadata/cross_validation/example_cross_validation.json"
]
Expand Down
25 changes: 25 additions & 0 deletions input/data/tasks/example_post_processing_task.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"parallel_workers": 4,
"tasks": [
{
"task_type": "POST_PROCESSING",
"metadata_file_path": "input/metadata/example_freestall_dairy_metadata.json",
"output_prefix": "example_post_processing",
"log_verbosity": "logs",
"random_seed": 42,
"exclude_info_maps": false,
"run_eee": true,
"load_saved_output_pools": true,
"output_pool_path": "saved_pool/freestall_07-Apr-2026_Tue_10-22-37.412509/freestall_saved_pool_0_07-Apr-2026_Tue_10-23-10.json",
"saved_output_pools": [
{
"name": "freestall_saved_pool_0",
"path": "saved_pool/freestall_07-Apr-2026_Tue_10-22-37.412509/freestall_saved_pool_0_07-Apr-2026_Tue_10-23-10.json"
}
],
"cross_validation_file_paths": [
"input/metadata/cross_validation/example_cross_validation.json"
]
}
]
}
2 changes: 1 addition & 1 deletion input/metadata/properties/tasks_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
"run_eee": {
"type": "bool",
"description": "Run the emissions, energy, and economics estimators prior to post-processing.",
"default": false
"default": true
},
"load_saved_output_pools": {
"type": "bool",
Expand Down
2 changes: 1 addition & 1 deletion input/task_manager_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"tasks": {
"title": "Task manager data",
"description": "Configuration file for general simulation parameters.",
"path": "input/data/tasks/example_freestall_task.json",
"path": "input/data/tasks/example_post_processing_task.json",
"type": "json",
"properties": "tasks_properties"
}
Expand Down