Skip to content

Commit

Permalink
small bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Jun 14, 2024
1 parent f1b13ab commit 3751f43
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion data/src/classes/featurelayer.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import os
import subprocess
import traceback
import sqlalchemy as sa

import geopandas as gpd
import pandas as pd
import requests
from config.psql import conn
from config.psql import conn, local_engine
from esridump.dumper import EsriDumper
from google.cloud import storage
from google.cloud.storage.bucket import Bucket
Expand Down Expand Up @@ -88,6 +89,9 @@ def __init__(

def check_psql(self):
try:
if not sa.inspect(local_engine).has_table(self.psql_table):
print(f"Table {self.psql_table} does not exist")
return False
psql_table = gpd.read_postgis(
f"SELECT * FROM {self.psql_table}", conn, geom_col="geometry"
)
Expand Down
2 changes: 1 addition & 1 deletion data/src/data_utils/dev_probability.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def dev_probability(primary_featurelayer):

# Classify development probability using Jenks natural breaks
breaks = jenkspy.jenks_breaks(census_bgs_gdf['permit_count'], n_classes=3)
census_bgs_gdf['dev_rank'] = pd.cut(census_bgs_gdf['permit_count'], bins=breaks, labels=['Low', 'Medium', 'High'])
census_bgs_gdf['dev_rank'] = pd.cut(census_bgs_gdf['permit_count'], bins=breaks, labels=['Low', 'Medium', 'High']).astype(str)

updated_census_bgs = FeatureLayer(
name="Updated Census Block Groups",
Expand Down

0 comments on commit 3751f43

Please sign in to comment.