diff --git a/src/data/dist/property-types.json b/src/data/dist/property-types.json index 8c9d78c2..f909e224 100644 --- a/src/data/dist/property-types.json +++ b/src/data/dist/property-types.json @@ -1,45 +1 @@ -{ - "propertyTypes": [ - "Adult Education", - "Automobile Dealership", - "College/University", - "Convention Center", - "Courthouse", - "Data Center", - "Enclosed Mall", - "Financial Office", - "Fitness Center/Health Club/Gym", - "Hospital (General Medical & Surgical)", - "Hotel", - "Ice/Curling Rink", - "K-12 School", - "Laboratory", - "Library", - "Medical Office", - "Mixed Use Property", - "Movie Theater", - "Multifamily Housing", - "Museum", - "Office", - "Other", - "Other - Education", - "Other - Entertainment/Public Assembly", - "Other - Mall", - "Other - Public Services", - "Other - Recreation", - "Other - Specialty Hospital", - "Outpatient Rehabilitation/Physical Therapy", - "Performing Arts", - "Pre-school/Daycare", - "Prison/Incarceration", - "Residence Hall/Dormitory", - "Residential Care Facility", - "Retail Store", - "Senior Care Community", - "Senior Living Community", - "Strip Mall", - "Supermarket/Grocery Store", - "Wholesale Club/Supercenter", - "Worship Facility" - ] -} \ No newline at end of file +{"propertyTypes": ["Adult Education", "Automobile Dealership", "College/University", "Commerce de d\u00e9tail", "Convention Center", "Courthouse", "Data Center", "Enclosed Mall", "Financial Office", "Fitness Center/Health Club/Gym", "Hospital (General Medical & Surgical)", "Hotel", "Ice/Curling Rink", "K-12 School", "Laboratory", "Library", "Lifestyle Center", "Medical Office", "Mixed Use Property", "Movie Theater", "Multifamily Housing", "Museum", "Office", "Other", "Other - Education", "Other - Entertainment/Public Assembly", "Other - Lodging/Residential", "Other - Mall", "Other - Public Services", "Other - Recreation", "Other - Services", "Other - Specialty Hospital", "Outpatient Rehabilitation/Physical Therapy", "Performing Arts", "Pre-school/Daycare", "Prison/Incarceration", "Residence Hall/Dormitory", "Residential Care Facility", "Retail Store", "Senior Living Community", "Social/Meeting Hall", "Strip Mall", "Supermarket/Grocery Store", "Urgent Care/Clinic/Other Outpatient", "Wholesale Club/Supercenter", "Worship Facility"]} \ No newline at end of file diff --git a/src/data/scripts/add-context-by-property-type.py b/src/data/scripts/add-context-by-property-type.py index a764db95..7f2cbd1e 100644 --- a/src/data/scripts/add-context-by-property-type.py +++ b/src/data/scripts/add-context-by-property-type.py @@ -2,6 +2,7 @@ import json path_to_buildings_csv = "./dist/building-benchmarks.csv" +property_types_file = "./dist/property-types.json" # Columns we want to rank for and append ranks to each building's data building_cols_to_rank = [ @@ -47,6 +48,11 @@ property_types = sorted_by_property_type.groups.keys() # TODO: output property_types to a json file for use in the frontend +def generate_property_types(): + # output property_types to a json file for use in the frontend + property_types_json = {"propertyTypes": list(property_types)} + with open(property_types_file, 'w', encoding='latin1') as json_file: + json.dump(property_types_json, json_file) def calculateBuildingStatistics(): stats_by_property_type = {} @@ -104,6 +110,6 @@ def rankBuildingsByPropertyType(): building_data.to_csv(path_to_buildings_csv, sep=',', encoding='utf-8', index=False) - if __name__ == "__main__": rankBuildingsByPropertyType() + generate_property_types()