Skip to content

Commit e5e8ad6

Browse files
committed
more vera matching, skip enrichment when it's only vera
Signed-off-by: John Seekins <john@robot-house.us>
1 parent 3f995ef commit e5e8ad6

4 files changed

Lines changed: 12 additions & 1 deletion

File tree

enrichers/general.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ def _enrich_facility(facility_data: tuple) -> tuple:
3636
"""enrich a single facility"""
3737
facility_id, facility = facility_data
3838
facility_name = facility["name"]
39+
if len(facility["source_urls"]) == 1 and "vera-institute/ice-detention-trends" in facility["source_urls"][0]:
40+
logger.debug(" Skipping enrichment of facility with only vera.org data: %s", facility["name"])
41+
return facility_id, facility
3942
logger.info("Enriching facility %s...", facility_name)
4043
enriched_facility = copy.deepcopy(facility)
4144

ice_scrapers/general.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ def facilities_scrape_wrapper(keep_sheet: bool = True, force_download: bool = Tr
1414
facilities_data = copy.deepcopy(facilities_schema)
1515
facilities = load_sheet(keep_sheet, force_download)
1616
facilities_data["facilities"] = copy.deepcopy(facilities)
17-
facilities_data = collect_vera_facility_data(facilities_data, keep_sheet, force_download)
1817
facilities_data = scrape_facilities(facilities_data)
18+
facilities_data = collect_vera_facility_data(facilities_data, keep_sheet, force_download)
1919
field_offices = scrape_field_offices()
2020
facilities_data = merge_field_offices(facilities_data, field_offices)
2121
facilities_data = insert_additional_facilities(facilities_data)

ice_scrapers/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ def repair_name(name: str, locality: str) -> Tuple[str, bool]:
195195
"locality": "HURRICANE",
196196
},
197197
{"match": "ETOWAH COUNTY JAIL (ALABAMA)", "replace": "ETOWAH COUNTY JAIL", "locality": "GADSDEN"},
198+
{"match": "BURLEIGH COUNTY", "replace": "BURLEIGH COUNTY JAIL", "locality": "BISMARCK"},
199+
{"match": "NELSON COLEMAN CORRECTION", "replace": "NELSON COLEMAN CORRECTIONS CENTER", "locality": "KILLONA"},
198200
]
199201
cleaned = False
200202
for m in matches:

ice_scrapers/vera_data.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,12 @@ def _vera_name_fixes(name: str, city: str) -> Tuple[str, bool]:
178178
"city": "Bay St. Louis",
179179
},
180180
{"match": "Brooks County Jail (Contract)", "replace": "Brooks County Jail", "city": "Falfurrias"},
181+
{"match": "Burleigh Co. Jail, ND", "replace": "Burleigh County Jail", "city": "Bismarck"},
182+
{"match": "Lubbock County Jail", "replace": "Lubbock County Detention Center", "city": "Lubbock"},
183+
{"match": "Montgomery County Jail", "replace": "Montgomery Ice Processing Center", "city": "Conroe"},
184+
{"match": "Sebastian County Det Cnt", "replace": "Sebastian County Detention Center", "city": "Smith"},
185+
{"match": "Atlanta U.S. Pen.", "replace": "FCI Atlanta", "city": "Atlanta"},
186+
{"match": "Clinton County Corr. Fac.", "replace": "Clinton County Correctional Facility", "city": "McElhattan"},
181187
]
182188
fixed = False
183189
for m in matches:

0 commit comments

Comments
 (0)