focusconsulting / housing-insights

Bringing open data to affordable housing decision makers in Washington DC. A D3/Javascript based website to visualize data related to affordable housing in Washington DC. Data processing with Python.
http://housinginsights.org
MIT License
58 stars 110 forks source link

Create ZoneFacts table and endpoints #388

Open NealHumphrey opened 7 years ago

NealHumphrey commented 7 years ago

Instead of using our API endpoints to recalculate derivative fields adhoc, and instead of performing client-side reconfiguration of data into display fields, we want a master table to do these calculations every time new data is loaded and make it easier to join all these fields to the project table. We've previously referred to this as the 'NeighborhoodFacts' table.

This ticket should a) create the table and b) make the data in the table part of the filter_data endpoint (which has a record for each project/subsidy combo). This will make all of this data available to the combined filter/layer view that is being used in V2.

NealHumphrey commented 7 years ago

Merging initial portions of this into dev per PR #416

Still to do:

NealHumphrey commented 7 years ago

Merged in some more changes in #436 . Changes requested from that code version:

PR changes requested by @nealhumphrey

And @jkwening 's list in the PR:

jkwening commented 7 years ago

@NealHumphrey I crossed the to do bullet that you asked clarification about; it seems I misunderstood the following action item:

zone_type and zone_specific (i.e. "ward" and "Ward 1" or "neighborhood_cluster" and "Cluster 32"). zone_type should match the relevant standard column name and zone_specific should match the value for that column that is used in other tables

I think we discussed this a couple weeks ago. I thought this implied that in addition to each unique zone_specific value for a zone_type populated in the zone column of zone_facts table you wanted the zone_type included and aggregate values populate. That is, zone column should include "ward", "census_tract", and "neighborhood_cluster" values in addition to their unique zone_specific values.

NealHumphrey commented 7 years ago

Ah, ok - yep, all I meant was that we do it as you've already done, with one column that designates whether it's Ward or Cluster or Tract etc.

NealHumphrey commented 7 years ago

@jkwening just a quick note - I crossed off the building permits bullet point b/c I made a separate issue for that one. I think the only things left on this for now are the unit tests bullet points