-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplain_python_example.py
More file actions
48 lines (41 loc) · 1.44 KB
/
Copy pathplain_python_example.py
File metadata and controls
48 lines (41 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
"""Python equivalent of ScriptRCalculoContribuicao/SCRIPTS/AA01-INICIO_DESCRITIVO_INDICADORES.R.
Runs the full pipeline (treatment -> PPTX report -> correlation/VIF/Cronbach diagnostics
and figures) against DATASET/Base_inicial_SA_Acesso.xlsx, mirroring the parameters the
R script passed to Tratamento(...) and slides_resultT(...).
"""
from __future__ import annotations
from pathlib import Path
from generate_contribution.config import ReportConfig, TratamentoConfig
from generate_contribution.pipeline import run_pipeline
BASE_DIR = Path(__file__).resolve().parent
tratamento_config = TratamentoConfig(
input=BASE_DIR / "DATASET" / "Base_inicial_SA_Acesso.xlsx",
imeta_sheet="Metadados",
idata_sheet="Dados_RA_Acesso",
method_boxcox="forecast",
sigla="SA",
subsetor="ACESSO",
output_dir=BASE_DIR / "OUTPUT",
)
report_config = ReportConfig(
template=BASE_DIR / "TEMPLATE" / "ADAPTA_RESUMO.pptx",
setor_estrategico="Segurança Alimentar",
sigla="SA",
subsetor="ACESSO",
caminho_shp_mun=BASE_DIR / "DATASET" / "SHP" / "BR_Municipios_2022_gr.shp",
caminho_shp_uf=BASE_DIR / "DATASET" / "SHP" / "BR_UF_2022_gr.shp",
ind=None,
resu=True,
winz=True,
bxcx=True,
norm=True,
output_dir=BASE_DIR / "OUTPUT",
)
if __name__ == "__main__":
run_pipeline(
tratamento_config,
report_config,
figs_dir=BASE_DIR / "FIGs",
run_report=True,
run_diagnostics=True,
)