From ee550201c20bd724d02a7d736a8807d88afb001b Mon Sep 17 00:00:00 2001 From: Anne Haley Date: Mon, 5 Aug 2024 12:54:01 +0000 Subject: [PATCH] fix: remove other usages of module reference for nysdp datasets --- .../use_cases/new_york_energy/datasets.json | 14 ++------------ sample_data/use_cases/new_york_energy/ingest.py | 10 +++++++--- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/sample_data/use_cases/new_york_energy/datasets.json b/sample_data/use_cases/new_york_energy/datasets.json index 86fabfe2..12061158 100644 --- a/sample_data/use_cases/new_york_energy/datasets.json +++ b/sample_data/use_cases/new_york_energy/datasets.json @@ -2,12 +2,7 @@ { "name": "National Grid CompanyBoundary", "description": "CompanyBoundary vector data", - "category": "region", - "module": "nysdp", - "function": "create_vector_features", - "kwargs": { - "service_name": "CompanyBoundary" - } + "category": "region" }, { "name": "County Boundaries", @@ -33,12 +28,7 @@ { "name": "National Grid Substations", "description": "Substations vector data", - "category": "energy", - "module": "nysdp", - "function": "create_vector_features", - "kwargs": { - "service_name": "Substations" - } + "category": "energy" }, { "name": "National Grid County Networks", diff --git a/sample_data/use_cases/new_york_energy/ingest.py b/sample_data/use_cases/new_york_energy/ingest.py index 9543bd99..eb959f7c 100644 --- a/sample_data/use_cases/new_york_energy/ingest.py +++ b/sample_data/use_cases/new_york_energy/ingest.py @@ -1,23 +1,27 @@ from pathlib import Path from .import_networks import perform_import from .export_networks import perform_export -from .nysdp import create_consolidated_network +from .nysdp import create_consolidated_network, create_vector_features DOWNLOADS_FOLDER = DOWNLOADS_FOLDER = Path('../../sample_data/downloads') PULL_LATEST = False -def convert_dataset(dataset, options, ): +def convert_dataset(dataset, options): print('\t', f'Converting data for {dataset.name}...') if dataset.name == 'National Grid County Networks': if PULL_LATEST: # pull latest data from NYSDP and run network interpretation algorithm - dataset.source_files.delete() + dataset.source_files.all().delete() create_consolidated_network(dataset, downloads_folder=DOWNLOADS_FOLDER) perform_export() else: perform_import(dataset, downloads_folder=DOWNLOADS_FOLDER) + elif dataset.name == 'National Grid CompanyBoundary': + create_vector_features(dataset, 'CompanyBoundary') + elif dataset.name == 'National Grid Substations': + create_vector_features(dataset, 'Substations') else: dataset.spawn_conversion_task( style_options=options.get('style_options'),