-
Notifications
You must be signed in to change notification settings - Fork 32
Comstock to Thermal Loads #555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| # Create NAREA column from calc.weighted.sqft..ft2 | ||
| weight_column = df["calc.weighted.sqft..ft2"] | ||
| df["AREA"] = weight_column | ||
| print("Number of None in BLDG:", df["AREA"].isna().sum()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! 🙂👍🏾
jmythms
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to recreate the mseg_res_com_cz, mseg_res_com_emm, and mseg_res_com_state files. Only this will let Scout pick up our updates and trigger changes in the results.
How to do this:
-
python scout/com_mseg.py
This should output mseg_res_com_cdiv.json -
Generating the final aggregated files:
python scout/final_mseg_converter.pySelect options 1,1 when prompted. This should output mseg_res_com_cz.json. Also run with options 1,2 and 1,3. This will generate mseg_res_com_emm, and mseg_res_com_state and we need to update these on the repo.
Otherwise, the changes look very nice, and great job generating the component loads file. Looking forward to seeing the results of the QA work.
| def add_missing_building_type(df): | ||
| avg_cols = list(set(COMSTOCK_SEGMENT_TO_CATEGORY.values())) | ||
| result_list = [] | ||
|
|
||
| # Iterate over CDIV × ENDUSE combinations | ||
| for cdiv in df['CDIV'].unique(): | ||
| for enduse in df['ENDUSE'].unique(): | ||
| subset = df[(df['CDIV'] == cdiv) & (df['ENDUSE'] == enduse)] | ||
|
|
||
| # Establish rows for "Assembly" building type as an average of the rows | ||
| # for "Education", "Sm. Office", and "Merch./Service" | ||
| assembly_avg = subset[subset['BLDG'].isin([2, 8, 9])][avg_cols].mean().round(4) | ||
| # Establish rows for "Other" building type as an average of the rows | ||
| # for "Lodging", "Lg. Office", and "Warehouse" | ||
| other_avg = subset[subset['BLDG'].isin([6, 7, 10])][avg_cols].mean().round(4) | ||
| # Establish rows for "food sales" building type as an average of the rows | ||
| # for "food service" and "mercantile/service" | ||
| food_sales_avg = subset[subset['BLDG'].isin([4, 9])][avg_cols].mean().round(4) | ||
|
|
||
|
|
||
| for bldg in subset['BLDG'].unique(): | ||
| block = subset[subset['BLDG'] == bldg].copy() | ||
|
|
||
| if bldg == 1: | ||
| for col in avg_cols: | ||
| block[col] = assembly_avg[col] | ||
| elif bldg == 11: | ||
| for col in avg_cols: | ||
| block[col] = other_avg[col] | ||
| elif bldg == 3: | ||
| for col in avg_cols: | ||
| block[col] = food_sales_avg[col] | ||
|
|
||
| result_list.append(block) | ||
|
|
||
| final_df = pd.concat(result_list, ignore_index=True) | ||
|
|
||
| return final_df |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest adding a docstring to clarify the rationale for this function, so it’s easier to understand when we revisit this PR.
| # Create weight column | ||
| weight_column = df["weight"] | ||
| df["weight"] = weight_column |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you encounter any rows in this column with no values like NAs, blank rows, etc?
related issue: #535
This PR will update the current thermal load components data to the latest ComStock data.
COMSTOCK vs Current Scout Data comparison:
Key notes:
How to interpret these plots:
More stats:
HEATING
COOLING
Calculation methods:
Mean diff = (ComStock-ScoutCurrentData).mean()
MAE = (|ComStock-ScoutCurrentData|).mean()
Sign Agree = (if sign_ComStock == sign_ScoutCurrentData).mean() to percentage
Correlation = ComStock.corr(ScoutCurrentData)