Skip to content

Commit

Permalink
fix: remove other usages of module reference for nysdp datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
annehaley committed Aug 5, 2024
1 parent 11c2c83 commit ee55020
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
14 changes: 2 additions & 12 deletions sample_data/use_cases/new_york_energy/datasets.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
10 changes: 7 additions & 3 deletions sample_data/use_cases/new_york_energy/ingest.py
Original file line number Diff line number Diff line change
@@ -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'),
Expand Down

0 comments on commit ee55020

Please sign in to comment.