<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Uncomment the code in the cell below to make the notebook cells wider than default...
Step1:  RESTART kernel prior to running after any changes to spreadsheet input files...
import pandas library, and the functions and list_builder modules
Step2:  build program files
dataframe pickle files
Step3:  generate skeleton
Step4:  calculate standalone dataset
standalone must be rerun after job level model change...
Step5:  calculate integrated dataset for each list order proposal
(including list conditions, job count changes, and possible furlough recall schedule)
The cells below run the compute_measures script with proposals p1, p2, and p3 (as named by the worksheet names within the proposals.xlsx input file).  Each scenario below includes a "prex" or pre-existing job assignment condition.  The first case includes a ratio condition and the second case includes a count-ratio condition.  Remove these condition arguments if your case study does not have special job assignment conditions or restrictions.
You will run compute_measures for each integrated list proposal.  In this sample case, there are 3 different list proposals to calculate.
Step6:  merge an ordered list with the master list
This rejoins "inactive" or "non-bidding" employees into an "active" or "bidding" employee list.
Step7:  cells below for demonstration only
build a 'hybrid' list example
Step8:  sample of files created
<ASSISTANT_TASK:>
Python Code:
#from IPython.core.display import display, HTML
#display(HTML("<style>.container { width:95% !important; }</style>"))
Explanation: Uncomment the code in the cell below to make the notebook cells wider than default...
End of explanation
%%time
import pandas as pd
import functions as f
import list_builder as lb
Explanation: RESTART kernel prior to running after any changes to spreadsheet input files...
import pandas library, and the functions and list_builder modules
End of explanation
%%time
%run build_program_files sample3
Explanation: build program files
dataframe pickle files: case_dill, proposal names, p_(proposal name) for each proposal, master, last_month
dictionary pickle files: dict_settings, dict_attr, dict_color, editor_dict, dict_job_tables
pay data pickle files: pay_table_basic, pay_table_enhanced, pay_table_data
pay data spreadsheet workbook: pay_table_data.xlsx (in reports folder)
note: add case study name after script name
End of explanation
%%time
%run make_skeleton
Explanation: generate skeleton
End of explanation
%%time
%run standalone prex
Explanation: calculate standalone dataset
standalone must be rerun after job level model change...
End of explanation
%%time
%run compute_measures p1 prex ratio
%%time
%run compute_measures p2 prex count
%%time
%run compute_measures p3 prex
Explanation: calculate integrated dataset for each list order proposal
(including list conditions, job count changes, and possible furlough recall schedule)
The cells below run the compute_measures script with proposals p1, p2, and p3 (as named by the worksheet names within the proposals.xlsx input file).  Each scenario below includes a "prex" or pre-existing job assignment condition.  The first case includes a ratio condition and the second case includes a count-ratio condition.  Remove these condition arguments if your case study does not have special job assignment conditions or restrictions.
You will run compute_measures for each integrated list proposal.  In this sample case, there are 3 different list proposals to calculate.
End of explanation
%%time
%run join_inactives p3 ffill
%%time
f.print_settings()
Explanation: merge an ordered list with the master list
This rejoins "inactive" or "non-bidding" employees into an "active" or "bidding" employee list.
End of explanation
%%time
# this will build a "hybrid" list with equal weighting given to longevity and standalone job position
master = lb.prepare_master_list()
lb.build_list(master, ['ldate', 'jobp'], [.5, .5])
%%time
# generate dataset for the hybrid list
%run compute_measures hybrid prex
Explanation: cells below for demonstration only
build a 'hybrid' list example:
(stored as 'dill/hybrid.pkl')
End of explanation
%%time
# print only the first 5 lines of each file
case_study = pd.read_pickle('dill/case_dill.pkl').case.value
file_names = ['master', 'skeleton', 'standalone', 'p_p1', 'pay_table_enhanced', 'pay_table_basic', 'ds_p1', 'p_hybrid', case_study + '_final']
for file in file_names:
    try:
        df = pd.read_pickle('dill/' + file + '.pkl')
        print('< ' + file.upper() + ' >', '\n', 'row count: ' + str(len(df)),
            '\n', 'column count: '+ str(len(df.columns)), '\n',
            df.columns, '\n',
            '\n', df.head().to_string(line_width=120), '\n\n', '-' * 80, '\n')
    except:
        pass
Explanation: sample of files created
End of explanation
<END_TASK>