53 lines
1.7 KiB
Python
53 lines
1.7 KiB
Python
from dotenv import load_dotenv
|
|
from .fetchers import fetch_oesm_data, fetch_epoch_remote_data, fetch_onet_database
|
|
from .enrichments import enrich_with_task_estimateability, enrich_with_task_estimates
|
|
from .postprocessors import check_for_insanity, create_df_tasks
|
|
from .generators import GENERATORS
|
|
from .run import Run
|
|
from .constants import GRAY
|
|
import seaborn as sns
|
|
import matplotlib as mpl
|
|
from pathlib import Path
|
|
from typings import Optional
|
|
|
|
def run(output_dir: Optional[str] = None):
|
|
if output_dir is None:
|
|
output_dir = Path(".")
|
|
|
|
load_dotenv()
|
|
_setup_graph_rendering()
|
|
|
|
current_run = Run()
|
|
|
|
# Fetchers (fetchers.py)
|
|
current_run.onet_conn, current_run.onet_version = fetch_onet_database(current_run.meta)
|
|
current_run.oesm_df, current_run.oesm_version = fetch_oesm_data(current_run.meta)
|
|
current_run.epoch_df, current_run.epoch_version = fetch_epoch_remote_data(current_run.meta)
|
|
|
|
# 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/)
|
|
for gen in GENERATORS:
|
|
gen(current_run, output_dir)
|
|
|
|
|
|
def _setup_graph_rendering():
|
|
mpl.rcParams.update({
|
|
'figure.facecolor' : GRAY['50'],
|
|
'axes.facecolor' : GRAY['50'],
|
|
'axes.edgecolor' : GRAY['100'],
|
|
'axes.labelcolor' : GRAY['700'],
|
|
'xtick.color' : GRAY['700'],
|
|
'ytick.color' : GRAY['700'],
|
|
'font.family' : 'Inter',
|
|
'font.size' : 11,
|
|
})
|
|
|
|
|
|
sns.set_style("white")
|