Closed akey7 closed 4 years ago
This is the part of the code that ultimately needs to attach data frames into master input dictionaries.
erection_input_worksheets = [
'crane_specs',
'equip',
'crew',
'equip_price',
'crew_price',
'material_price',
'components'
]
erection_project_data_dict = dict()
for worksheet in erection_input_worksheets:
erection_project_data_dict[worksheet] = pd.read_excel(input_xlsx, worksheet)
# Add the erection project data to the incomplete_input_dict
incomplete_input_dict['project_data'] = erection_project_data_dict
# Get the first set of data
incomplete_input_dict['rsmeans'] = pd.read_excel(input_xlsx, 'rsmeans')
incomplete_input_dict['site_facility_building_area_df'] = pd.read_excel(input_xlsx,
'site_facility_building_area')
incomplete_input_dict['material_price'] = pd.read_excel(input_xlsx, 'material_price')
# The weather window is stored on a sheet of the project_data, but
# needs preprocessing after it is read. The preprocessing changes it
# from wind toolkit format to a dataframe.
weather_window_input_df = pd.read_excel(input_xlsx, 'weather_window')
incomplete_input_dict['weather_window'] = read_weather_window(weather_window_input_df)
# Read development tab:
incomplete_input_dict['development_df'] = pd.read_excel(input_xlsx, 'development')
# FoundationCost needs to have all the component data split into separate
# NumPy arrays.
incomplete_input_dict['component_data'] = erection_project_data_dict['components']
for component in incomplete_input_dict['component_data'].keys():
incomplete_input_dict[component] = np.array(incomplete_input_dict['component_data'][component])
project_id | sheet1_row1_col1 | sheet2_row2_col2 |
---|---|---|
project_1 | 2 | |
project_1 | 4 | |
project_2 | 6 | |
project_2 | 7 |
If there is a non NULL cell in the row, make a modification to the data frame for that row.
This can be joined with the project list, so that you get all the project parametrics alongside the project list. When the time comes to run the project
What needs to be changed is the way XlsxReader parses the columns.
There are a bunch of potentially interesting sensitivities that are in the sheets of the project data, and not in the project list. The project list is very easy to modify because all you need to do is create sequences of values in Excel. However, for the project_data, you currently need to create a separate project data file for each value you need to test.
This enhancement will allow parametric exploration of values in single cells in the project data/