Skip to content

Commit 731e71e

Browse files
Clearer progress output in main script
1 parent 7a51221 commit 731e71e

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

generate-geo-data.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
load_settings,
1717
setup_source,
1818
upload_tiles,
19+
print_script_progress,
1920
)
2021

2122

@@ -30,6 +31,7 @@ def _django_cmds() -> None:
3031
call_command("clean_divisions")
3132

3233

34+
3335
def generate_geo_data(
3436
SETTINGS,
3537
jurisdictions,
@@ -44,6 +46,7 @@ def generate_geo_data(
4446
"""
4547
Download shp files from TIGER
4648
"""
49+
print_script_progress("Download shp files from TIGER")
4750
for jur in jurisdictions:
4851
if jur not in JURISDICTION_NAMES:
4952
print(f"Invalid jurisdiction {jur}. Skipping.")
@@ -55,20 +58,25 @@ def generate_geo_data(
5558

5659
jurisdiction = find_jurisdiction(jur)
5760
download_from_tiger(jurisdiction, "RD18", SETTINGS)
61+
print_script_progress("Download boundary file")
5862
download_boundary_file(SETTINGS["BOUNDARY_YEAR"])
5963

6064
"""
6165
Convert downloaded shp files to geojson
6266
"""
67+
print_script_progress("Convert downloaded shp files to geojson")
6368
convert_to_geojson(SETTINGS)
6469

6570
if SETTINGS["create_tiles"]:
71+
print_script_progress("Create tiles")
6672
create_tiles(SETTINGS)
6773

6874
if SETTINGS["run_migrations"]:
75+
print_script_progress("Run migrations")
6976
_django_cmds()
7077

7178
if SETTINGS["upload_data"]:
79+
print_script_progress("Upload data")
7280
bulk_upload(SETTINGS)
7381
upload_tiles()
7482

0 commit comments

Comments
 (0)