Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -92,7 +92,7 @@ def criar_grafico_dispersao(df, x_column, y_column, hover_name, trendline_color)
|
|
92 |
#--------------------------------------------FUNÇÃO PRINCIPAL DE GERAÇÃO DE MODELOS--------------------------------------------#
|
93 |
|
94 |
# função para a regressão linear
|
95 |
-
def gera_model(planilha, v_d, scv_d,
|
96 |
v_1, scv_1, v_2, scv_2,
|
97 |
v_3, scv_3, v_4, scv_4,
|
98 |
v_5, scv_5, v_6, scv_6,
|
@@ -551,6 +551,7 @@ def gera_model(planilha, v_d, scv_d,
|
|
551 |
#-------------------------------Modelo para EXCEL---------------------------#
|
552 |
|
553 |
output_file = 'modelo.xlsx'
|
|
|
554 |
with pd.ExcelWriter(output_file, engine='xlsxwriter') as writer:
|
555 |
# Salve o DataFrame 'DADOS INICIAIS' na planilha 'relatório'
|
556 |
df_original.to_excel(writer, sheet_name='Dados Originais', index=False)
|
@@ -813,7 +814,7 @@ def gera_model(planilha, v_d, scv_d,
|
|
813 |
plt,
|
814 |
df_aval_original,
|
815 |
'planilha_aval.xlsx',
|
816 |
-
|
817 |
|
818 |
#X_aval,
|
819 |
#X,
|
@@ -1020,6 +1021,7 @@ with gr.Blocks(theme=gr.themes.Monochrome(primary_hue="yellow", secondary_hue="y
|
|
1020 |
#inp_1 = gr.File(label="Upload planilha", type="file", scale=2, height=100)
|
1021 |
inp_1 = gr.File(label="Upload planilha", type="filepath", scale=2, height=100)
|
1022 |
with gr.Row():
|
|
|
1023 |
inp_2 = gr.Dropdown(['Valor total', 'Valor unitário',], label="VARIÁVEL DEPENDENTE", value='Valor unitário')
|
1024 |
inp_3 = gr.Dropdown(['y', 'lny', '1/y', 'y²'], label="Escala VARIÁVEL DEPENDENTE", value='y')
|
1025 |
button_1 = gr.Button("Calcular")
|
@@ -1111,7 +1113,7 @@ with gr.Blocks(theme=gr.themes.Monochrome(primary_hue="yellow", secondary_hue="y
|
|
1111 |
|
1112 |
|
1113 |
inputs = [
|
1114 |
-
inp_1, inp_2, inp_3, inp_4, inp_5, inp_6, inp_7, inp_8, inp_9, inp_10,
|
1115 |
inp_11, inp_12, inp_13, inp_14, inp_15, inp_16, inp_17, inp_18, inp_19, inp_20,
|
1116 |
inp_21, inp_22, inp_23, inp_24, inp_25, inp_26, inp_27, inp_28, inp_29, inp_30,
|
1117 |
inp_31, inp_32, inp_33, inp_34, inp_35, inp_36
|
|
|
92 |
#--------------------------------------------FUNÇÃO PRINCIPAL DE GERAÇÃO DE MODELOS--------------------------------------------#
|
93 |
|
94 |
# função para a regressão linear
|
95 |
+
def gera_model(planilha, name_model, v_d, scv_d,
|
96 |
v_1, scv_1, v_2, scv_2,
|
97 |
v_3, scv_3, v_4, scv_4,
|
98 |
v_5, scv_5, v_6, scv_6,
|
|
|
551 |
#-------------------------------Modelo para EXCEL---------------------------#
|
552 |
|
553 |
output_file = 'modelo.xlsx'
|
554 |
+
output_file = output_file.replace('modelo', name_model)
|
555 |
with pd.ExcelWriter(output_file, engine='xlsxwriter') as writer:
|
556 |
# Salve o DataFrame 'DADOS INICIAIS' na planilha 'relatório'
|
557 |
df_original.to_excel(writer, sheet_name='Dados Originais', index=False)
|
|
|
814 |
plt,
|
815 |
df_aval_original,
|
816 |
'planilha_aval.xlsx',
|
817 |
+
output_file
|
818 |
|
819 |
#X_aval,
|
820 |
#X,
|
|
|
1021 |
#inp_1 = gr.File(label="Upload planilha", type="file", scale=2, height=100)
|
1022 |
inp_1 = gr.File(label="Upload planilha", type="filepath", scale=2, height=100)
|
1023 |
with gr.Row():
|
1024 |
+
inp_37 = gr.Textbox(label="Nome do modelo", scale=1)
|
1025 |
inp_2 = gr.Dropdown(['Valor total', 'Valor unitário',], label="VARIÁVEL DEPENDENTE", value='Valor unitário')
|
1026 |
inp_3 = gr.Dropdown(['y', 'lny', '1/y', 'y²'], label="Escala VARIÁVEL DEPENDENTE", value='y')
|
1027 |
button_1 = gr.Button("Calcular")
|
|
|
1113 |
|
1114 |
|
1115 |
inputs = [
|
1116 |
+
inp_1, inp_37, inp_2, inp_3, inp_4, inp_5, inp_6, inp_7, inp_8, inp_9, inp_10,
|
1117 |
inp_11, inp_12, inp_13, inp_14, inp_15, inp_16, inp_17, inp_18, inp_19, inp_20,
|
1118 |
inp_21, inp_22, inp_23, inp_24, inp_25, inp_26, inp_27, inp_28, inp_29, inp_30,
|
1119 |
inp_31, inp_32, inp_33, inp_34, inp_35, inp_36
|