Skip to content

Commit 1f625c3

Browse files
authored
refactor: use session class in worldpop (#117)
* refactor: use session class in worldpop.py file * remove hardcoded container name to use one in config * refactor: use context manager to access blob_service_client * cleanup .env.example and remove azure module
1 parent 8981913 commit 1f625c3

File tree

7 files changed

+140
-436
lines changed

7 files changed

+140
-436
lines changed

.env.example

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
AZURE_STORAGE_CONNECTION_STRING=
2-
AZURE_STORAGE_CONTAINER=
3-
AZ_ROOT_FILE_PATH=
4-
LOCAL_DOWNLOAD_PATH=
51
JUPYTER_USERS=

cbsurge/azure/__init__.py

Whitespace-only changes.

cbsurge/azure/blob_storage.py

Lines changed: 0 additions & 190 deletions
This file was deleted.

cbsurge/azure/fileshare.py

Lines changed: 0 additions & 156 deletions
This file was deleted.

cbsurge/azure/tests/test_azure.py

Lines changed: 0 additions & 10 deletions
This file was deleted.

cbsurge/exposure/population/__init__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import click
44

5-
from cbsurge.exposure.population.worldpop import population_sync, process_aggregates, download
5+
from cbsurge.exposure.population.worldpop import population_sync, process_aggregates, run_download
66

77

88
@click.group()
@@ -21,12 +21,11 @@ def sync(force_reprocessing, country, download_path):
2121

2222
@population.command()
2323
@click.option('--country', help='The ISO3 code of the country to process the data for')
24-
@click.option('--force-reprocessing', help='Force reprocessing of data', is_flag=True)
2524
@click.option('--download-path', help='Download data locally', required=False)
2625
@click.option('--age-group', help='The age group to process the data for', type=click.Choice(['child', 'active', 'elderly']))
2726
@click.option('--sex', help='Path to the downloaded data', type=click.Choice(['male', 'female']))
28-
def download(country, force_reprocessing, download_path, age_group, sex):
29-
asyncio.run(download(force_reprocessing=force_reprocessing, country_code=country, download_path=download_path, age_group=age_group, sex=sex))
27+
def download(country, download_path, age_group, sex):
28+
asyncio.run(run_download(country_code=country, download_path=download_path, age_group=age_group, sex=sex))
3029

3130
@population.command()
3231
@click.option('--country', help='The ISO3 code of the country to process the data for')

0 commit comments

Comments
 (0)