-
Notifications
You must be signed in to change notification settings - Fork 26
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
Maz scale microdata devprojects #95
Maz scale microdata devprojects #95
Conversation
baus/models.py
Outdated
@@ -345,7 +345,7 @@ def scheduled_development_events(buildings, development_projects, | |||
new_buildings.building_type.fillna("OF").map(building_sqft_per_job) | |||
new_buildings["job_spaces"] = new_buildings.job_spaces.\ | |||
fillna(0).astype('int') | |||
new_buildings["geom_id"] = parcel_id_to_geom_id(new_buildings.parcel_id) | |||
#new_buildings["geom_id"] = parcel_id_to_geom_id(new_buildings.parcel_id) |
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.
can remove this line now?
baus/datasources.py
Outdated
df = pd.read_csv(os.path.join(misc.data_dir(), "development_projects.csv")) | ||
# find nearest parcel centroid to dev project x, y and assign parcel_id | ||
df = df[(df.x.notnull()) & (df.y.notnull())] | ||
df['parcel_id'] = nearest_neighbor(parcels.to_frame(['x','y']), |
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.
can you pep8 this (I mean all of it for good measure)?
baus/datasources.py
Outdated
|
||
cnts = df.geom_id.isin(parcels.geom_id).value_counts() | ||
cnts = df.parcel_id.isin(parcels.index).value_counts() | ||
if False in cnts.index: | ||
print "%d MISSING GEOMIDS!" % cnts.loc[False] |
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.
probably need to change this comment to take out GEOMIDS. Does is print anything? Do all the projects get mapped to reasonable parcel ids? I mean, have you checked to see if it works?
Hmm, I think we should just have development_projects.csv and not development_projects_w_apn.csv in github. Will keep us from file proliferation. Just copy it over once you've got it... |
baus/datasources.py
Outdated
"development_projects_w_apn.csv")) | ||
# find nearest parcel centroid to dev project x, y and assign parcel_id | ||
df = pd.merge(df, parcels.apn.reset_index(), how='left', left_on='apn', | ||
right_on='apn') |
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 like this merge. Clever way to merge to a series - I hadn't seen that before.
Strategies (futures round 2) prep work
Update datasources to handle updated develpment projects data format by pulling parcel_id from x, y rather than geom_id.