mirror of
https://github.com/DOI-DO/j40-cejst-2.git
synced 2025-08-10 05:44:19 -07:00
Issue 105: Configure and run black
and other pre-commit hooks (clean branch) (#1962)
* Configure and run `black` and other pre-commit hooks Co-authored-by: matt bowen <matthew.r.bowen@omb.eop.gov>
This commit is contained in:
parent
baa34ec038
commit
6e6223cd5e
162 changed files with 716 additions and 602 deletions
|
@ -460,7 +460,9 @@
|
|||
"outputs": [],
|
||||
"source": [
|
||||
"object_ids_to_keep = set(\n",
|
||||
" merged_exaple_data[merged_exaple_data[\"_merge\"] == \"both\"].OBJECTID.astype(\"int\")\n",
|
||||
" merged_exaple_data[merged_exaple_data[\"_merge\"] == \"both\"].OBJECTID.astype(\n",
|
||||
" \"int\"\n",
|
||||
" )\n",
|
||||
")\n",
|
||||
"features = []\n",
|
||||
"for feature in raw_fuds_geojson[\"features\"]:\n",
|
||||
|
@ -476,7 +478,11 @@
|
|||
"outputs": [],
|
||||
"source": [
|
||||
"def make_fake_feature(\n",
|
||||
" state: str, has_projects: bool, is_eligible: bool, latitude: float, longitude: float\n",
|
||||
" state: str,\n",
|
||||
" has_projects: bool,\n",
|
||||
" is_eligible: bool,\n",
|
||||
" latitude: float,\n",
|
||||
" longitude: float,\n",
|
||||
"):\n",
|
||||
" \"\"\"For tracts where we don't have a FUDS, fake one.\"\"\"\n",
|
||||
" make_fake_feature._object_id += 1\n",
|
||||
|
@ -537,7 +543,9 @@
|
|||
"# Create FUDS in CA for each tract that doesn't have a FUDS\n",
|
||||
"for tract_id, point in points.items():\n",
|
||||
" for bools in [(True, True), (True, False), (False, False)]:\n",
|
||||
" features.append(make_fake_feature(\"CA\", bools[0], bools[1], point.y, point.x))"
|
||||
" features.append(\n",
|
||||
" make_fake_feature(\"CA\", bools[0], bools[1], point.y, point.x)\n",
|
||||
" )"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -596,9 +604,9 @@
|
|||
}
|
||||
],
|
||||
"source": [
|
||||
"test_frame_with_tracts_full = test_frame_with_tracts = add_tracts_for_geometries(\n",
|
||||
" test_frame\n",
|
||||
")"
|
||||
"test_frame_with_tracts_full = (\n",
|
||||
" test_frame_with_tracts\n",
|
||||
") = add_tracts_for_geometries(test_frame)"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -680,7 +688,9 @@
|
|||
}
|
||||
],
|
||||
"source": [
|
||||
"tracts = test_frame_with_tracts_full[[\"GEOID10_TRACT\", \"geometry\"]].drop_duplicates()\n",
|
||||
"tracts = test_frame_with_tracts_full[\n",
|
||||
" [\"GEOID10_TRACT\", \"geometry\"]\n",
|
||||
"].drop_duplicates()\n",
|
||||
"tracts[\"lat_long\"] = test_frame_with_tracts_full.geometry.apply(\n",
|
||||
" lambda point: (point.x, point.y)\n",
|
||||
")\n",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue