Skip to content

Commit

Permalink
Merge pull request #49 from vkoves/issue-43-prop-types
Browse files Browse the repository at this point in the history
Make Property Types JSON Auto Generated & Update With New 2021 Types
  • Loading branch information
vkoves authored Sep 15, 2023
2 parents ea42a37 + bb3499c commit 19a0e7f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 46 deletions.
46 changes: 1 addition & 45 deletions src/data/dist/property-types.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
{"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"]}
8 changes: 7 additions & 1 deletion src/data/scripts/add-context-by-property-type.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -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 = {}
Expand Down Expand Up @@ -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()

0 comments on commit 19a0e7f

Please sign in to comment.