Feat: Implement task enrichment steps

Implement task estimateability and task estimate enrichment steps. Add a
`create_df_tasks` postprocessor.
This commit is contained in:
Félix Dorn 2025-07-08 15:27:04 +02:00
parent f9f9825abb
commit 62296e1b69
3 changed files with 221 additions and 22 deletions

View file

@ -14,19 +14,18 @@ from typing import Optional
CACHE_DIR = platformdirs.user_cache_dir("econtai")
def run(output_dir: Optional[str] = None):
def run(output_dir: Path | Optional[str] = None):
load_dotenv()
_setup_graph_rendering()
if output_dir is None:
output_dir = Path("dist/")
else:
elif isinstance(output_dir, str):
output_dir = Path(output_dir).resolve()
output_dir.mkdir(parents=True, exist_ok=True)
current_run = Run(output_dir=output_dir, cache_dir=CACHE_DIR)
current_run = Run(output_dir=output_dir, cache_dir=Path(CACHE_DIR).resolve())
current_run.cache_dir.mkdir(parents=True, exist_ok=True)
# Fetchers (fetchers.py)
@ -34,12 +33,13 @@ def run(output_dir: Optional[str] = None):
current_run.oesm_df, current_run.oesm_version = fetch_oesm_data(current_run)
current_run.epoch_df, current_run.epoch_version = fetch_epoch_remote_data(current_run)
current_run = create_df_tasks(current_run)
# Enrichments (enrichments.py)
current_run.task_estimateability_df = enrich_with_task_estimateability(current_run)
current_run.task_estimates_df = enrich_with_task_estimates(current_run)
# Postprocessors (postprocessors.py)
create_df_tasks(current_run)
check_for_insanity(current_run)
# Generators (generators/)