""" st.markdown(hide_menu_style, unsafe_allow_html=True) api_backend = api_endpoint_ip + options_file.api_backend_loc url_hyperlink = ''' <a href= "{}" > <p style="text-align:right"> Documentação </p></a> '''.format(options_file.documentation_url_solver_apv) st.markdown(url_hyperlink, unsafe_allow_html=True) session_state = SessionState.get(run_id=0, overwrite_button_pressed=0, save_button_pressed_flag=0, part_ref_group='', total_value_optimized=0, df_solution=pd.DataFrame(), dtss_goal=0, max_part_number=9999, minimum_cost_or_pvp=0, sel_group='', sel_local='') sel_parameters = [ session_state.sel_local, session_state.sel_group, session_state.dtss_goal, session_state.max_part_number, session_state.minimum_cost_or_pvp ] sel_parameters_desc = [ 'sel_local', 'sel_group', 'dtss_goal', 'max_part_number', 'minimum_cost_or_pvp' ]
'Model_Code': 'Modelo', 'Colour_Ext': 'Cor Exterior', 'Colour_Int': 'Cor Interior', 'Motor_Desc': 'Motorização', 'Quantity': 'Quantidade', } hide_menu_style = """ <style> #MainMenu {visibility: hidden;} </style> """ st.markdown(hide_menu_style, unsafe_allow_html=True) session_state = sessionstate.get(overwrite_button_pressed=0, save_button_pressed_flag=0, locals='-', model='') def main(): current_date, _ = level_1_e_deployment.time_tags(format_date='%Y%m%d') data = get_data(options_file) # saved_suggestions_dict, saved_suggestions_df = get_suggestions_dict(options_file) parameters_values, parameter_restriction_vectors = [], [] max_number_of_cars_sold = max( data[column_translate['Number_Cars_Sold_Local_Fase2_Level_1']]) sel_locals = st.sidebar.multiselect( 'Concessões:',
import modules.level_1_a_data_acquisition as level_1_a_data_acquisition import modules.SessionState as SessionState import modules.level_1_e_deployment as level_1_e_deployment from modules.level_0_performance_report import log_record, error_upload from plotly import graph_objs as go st.set_page_config(page_title='Correspondência de Gamas - Importador') hide_menu_style = """ <style> #MainMenu {visibility: hidden;} </style> """ st.markdown(hide_menu_style, unsafe_allow_html=True) session_state = SessionState.get(run_id=0, sel_brand='-', sel_model='-', draws_gama_morta=pd.DataFrame(), high_confidence_matches=pd.DataFrame(), not_high_confidence_matches=pd.DataFrame(), sel_df='-', df_sim=pd.DataFrame(), sel_table='-', validate_button_pressed=0, unmatched_data_filtered=pd.DataFrame()) """ # Correspondência Gamas - Importador Correspondência entre Gamas Mortas e Vivas """ url_hyperlink = ''' <a href= "{}" > <p style="text-align:right"> Manual de Utilizador </p></a> '''.format(options_file.documentation_url_gamas_match_app) st.markdown(url_hyperlink, unsafe_allow_html=True) def main(): data = get_data(options_file) unmatched_data = get_data_non_cached(options_file, 0)
import streamlit as st import pandas as pd import re from datetime import datetime from modules import SessionState from modules.decorate import (html_decorate_text, tags_underlining, bolded_tagged_sentenced, html_decorate_tag_list) from modules.levenstein_search import levenshtein_extraction from modules.mutimodule_functions import create_highlighted_markdown_text from modules.in_out import (load_language, load_parameters, load_report_and_classification) from modules.transformations import (update_classified_dataset, extract_info, crisis_type_correspondance, defaut_value_listing) state = SessionState.get(key=0) # FUNCTION DEFINITIONS def extract_defaut_values(selected_patient, classified_dataset): # Extract previously input fields defaut_values_df = classified_dataset[classified_dataset["Patient_name"] == selected_patient] default_epilepsy_type, default_tags, default_laterality, default_thesaurus, default_free_notes = defaut_value_listing( defaut_values_df) return default_epilepsy_type, default_tags, default_laterality, default_thesaurus, default_free_notes def update_last_patient_classified(last_patient_classified_df, selected_patient):
from traceback import format_exc base_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '')) sys.path.insert(1, base_path) import level_2_pa_servicedesk_2244_options as options_file import modules.level_1_a_data_acquisition as level_1_a_data_acquisition import modules.level_1_e_deployment as level_1_e_deployment from modules.level_0_performance_report import log_record, error_upload import modules.SessionState as SessionState from plotly import graph_objs as go st.set_page_config(page_title='Classificação de Pedidos - Service Desk Rigor', layout="wide") st.markdown("<h1 style='text-align: center;'>Classificação Pedidos Service Desk</h1>", unsafe_allow_html=True) st.markdown("<h3 style='text-align: center;'>Classificação Manual de Pedidos do Service Desk</h3>", unsafe_allow_html=True) session_state = SessionState.get(run_id=0, save_button_pressed_flag=0, overwrite_button_pressed_flag=0, update_final_table_button_pressed_flag=0, first_run=1) truncate_query = ''' DELETE FROM [BI_RCG].[dbo].[{}] WHERE Request_Num = '{}' ''' # Updates BI_SDK_Fact_Requests_Month_Detail with the new labels from BI_SDK_Fact_DW_Requests_Manual_Classification update_query = ''' UPDATE dbo.{} SET Label = Class.Label FROM dbo.{} AS Fact INNER JOIN {} AS Class ON Class.Request_Num = Fact.Request_Num '''
st.markdown(url_hyperlink, unsafe_allow_html=True) placeholder_dw_date = st.empty() placeholder_sales_plan_date = st.empty() placeholder_proposal_date = st.empty() placeholder_margins_date = st.empty() session_state = SessionState.get( first_run_flag=0, run_id=0, run_id_scores=0, save_button_pressed_flag=0, model='', brand='', daysinstock_score_weight=score_weights[ 'Avg_DaysInStock_Global_normalized'], sel_margin_score_weight=score_weights['TotalGrossMarginPerc_normalized'], sel_margin_ratio_score_weight=score_weights['MarginRatio_normalized'], sel_qty_sold_score_weight=score_weights['Sum_Qty_CHS_normalized'], sel_proposals_score_weight=score_weights['Proposals_VDC_normalized'], sel_oc_stock_diff_score_weight=score_weights['Stock_OC_Diff_normalized'], sel_co2_nedc_score_weight=score_weights['NEDC_normalized'], sel_configurator_count_score_weight=score_weights[ 'Configurator_Count_normalized']) temp_cols = [ 'Avg_DaysInStock_Global', 'Avg_DaysInStock_Global_normalized', '#Veículos Vendidos', 'Sum_Qty_CHS_normalized', 'Proposals_VDC', 'Proposals_VDC_normalized', 'Margin_HP', 'TotalGrossMarginPerc', 'TotalGrossMarginPerc_normalized', 'MarginRatio', 'MarginRatio_normalized', 'OC', 'Stock_VDC', 'Stock_OC_Diff', 'Stock_OC_Diff_normalized', 'NEDC',
st.markdown("<h1 style='text-align: center;'>Aplicação de Apoio à Classificação de Famílias de Peças - DGO</h1>", unsafe_allow_html=True) url_hyperlink = ''' <a href= "{}" > <p style="text-align:right"> Manual de Utilizador </p></a> '''.format(options_file.documentation_url_app) st.markdown(url_hyperlink, unsafe_allow_html=True) hide_menu_style = """ <style> #MainMenu {visibility: hidden;} </style> """ st.markdown(hide_menu_style, unsafe_allow_html=True) session_state = SessionState.get(sel_all_refs_flag=True, sel_family_desc='-', run_id=0, sel_model_class='-', data_filtered_sel=pd.DataFrame(), data_filtered_sim=pd.DataFrame(), sel_text='', sel_text_option='', data_text_filtered_sel=pd.DataFrame(), data_text_filtered_sim=pd.DataFrame(), data=pd.DataFrame(columns=['Part_Ref', 'Part_Description', 'Part_Cost', 'Part_PVP', 'Product_Group_DW_desc', 'Classification_desc', 'Classification_Prob'])) def main(): df_product_group = get_data_product_group_sql(options_file.others_families_dict, options_file) cm_family_lvl_1 = get_data_sql(options_file, options_file.sql_info['database_final'], options_file.sql_info['matrix_lvl_1']) cm_family_lvl_2 = get_data_sql(options_file, options_file.sql_info['database_final'], options_file.sql_info['matrix_lvl_2']) cm_family_dict_lvl_1 = cm_replacements(cm_family_lvl_1) cm_family_dict_lvl_2 = cm_replacements(cm_family_lvl_2) family_dict_sorted = family_dict_sorting(cm_family_dict_lvl_1, cm_family_dict_lvl_2) st.sidebar.title('Objetivo:') sel_page = st.sidebar.radio('', ['Análise de Classificações', 'Correções às Famílias Atuais', 'Exportação de Classificações'], index=0) if sel_page == 'Correções às Famílias Atuais': data_original = get_dataset_sql(options_file.others_families_dict, options_file, options_file.classified_app_query)