From 9ed26d61e22bf82d67273351057580048cfc8461 Mon Sep 17 00:00:00 2001 From: Anne Haley Date: Tue, 27 Aug 2024 13:49:39 +0000 Subject: [PATCH 1/2] data: refer to new networks zip on DKC --- sample_data/use_cases/new_york_energy/datasets.json | 2 +- sample_data/use_cases/new_york_energy/import_networks.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sample_data/use_cases/new_york_energy/datasets.json b/sample_data/use_cases/new_york_energy/datasets.json index 12061158..193774c4 100644 --- a/sample_data/use_cases/new_york_energy/datasets.json +++ b/sample_data/use_cases/new_york_energy/datasets.json @@ -36,7 +36,7 @@ "category": "energy", "files": [ { - "url": "https://data.kitware.com/api/v1/item/66a7bdab0ea2cce8e698b958/download", + "url": "https://data.kitware.com/api/v1/item/66cdd8a6886c56bdc7e282a4/download", "path": "nyc/networks.zip" } ] diff --git a/sample_data/use_cases/new_york_energy/import_networks.py b/sample_data/use_cases/new_york_energy/import_networks.py index 2743dcf2..ab643f95 100644 --- a/sample_data/use_cases/new_york_energy/import_networks.py +++ b/sample_data/use_cases/new_york_energy/import_networks.py @@ -92,7 +92,7 @@ def perform_import(dataset, **kwargs): filenames = zip_archive.namelist() for filename in filenames: if filename.endswith('.json'): - network_name = filename.split('/')[-1].replace('.json', '') + network_name = filename.split('/')[-1].replace('.json', '').title() content = zip_archive.open(filename).read() geodata = json.loads(content) create_network(dataset, network_name, geodata) From 74db6e831d96f5d96a06f0a05983063e7b68e137 Mon Sep 17 00:00:00 2001 From: Anne Haley Date: Tue, 27 Aug 2024 14:38:07 +0000 Subject: [PATCH 2/2] update wait time estimate in import script --- sample_data/use_cases/new_york_energy/import_networks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample_data/use_cases/new_york_energy/import_networks.py b/sample_data/use_cases/new_york_energy/import_networks.py index ab643f95..1da40b58 100644 --- a/sample_data/use_cases/new_york_energy/import_networks.py +++ b/sample_data/use_cases/new_york_energy/import_networks.py @@ -79,7 +79,7 @@ def create_network(dataset, network_name, geodata): def perform_import(dataset, **kwargs): - print('\tEstimated time: 90 minutes.') + print('\tEstimated time: 45 minutes.') start = datetime.now() Network.objects.filter(dataset=dataset).delete() VectorMapLayer.objects.filter(dataset=dataset).delete()