Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Features/status2023 skip downloads if existing #201

Draft
wants to merge 2 commits into
base: features/status2023
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/egon/data/datasets/data_bundle/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""The central module containing all code dealing with small scale inpu-data
"""The central module containing all code dealing with small scale input-data
"""


Expand All @@ -13,7 +13,7 @@

def download():
"""
Download small scale imput data from Zenodo
Download small scale input data from Zenodo
Parameters
----------

Expand All @@ -27,8 +27,10 @@ def download():
url = f"""https://zenodo.org/record/{sources['deposit_id']}/files/data_bundle_egon_data.zip"""
target_file = egon.data.config.datasets()["data-bundle"]["targets"]["file"]

# Retrieve files
urlretrieve(url, target_file)
# check if file exists
if not Path(target_file).exists():
# Retrieve files
urlretrieve(url, target_file)

with zipfile.ZipFile(target_file, "r") as zip_ref:
zip_ref.extractall(".")
Expand All @@ -41,7 +43,7 @@ def __init__(self, dependencies):
]["deposit_id"]
super().__init__(
name="DataBundle",
version=str(deposit_id) + "-0.0.2",
version=str(deposit_id) + "-0.0.3",
dependencies=dependencies,
tasks=(download),
)
Loading