Skip to content

Commit

Permalink
change locations of the unsd data
Browse files Browse the repository at this point in the history
  • Loading branch information
hazemakhalek committed Aug 17, 2023
1 parent cba9e75 commit 95b288e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/build_base_energy_totals.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def calc_sector(sector):
if snakemake.config["demand_data"]["update_data"]:
# Delete and existing files to avoid duplication and double counting

files = glob.glob("data/demand/unsd/*.txt")
files = glob.glob("data/demand/unsd/data/*.txt")
for f in files:
os.remove(f)

Expand All @@ -258,12 +258,12 @@ def calc_sector(sector):

with urlopen(zipurl) as zipresp:
with ZipFile(BytesIO(zipresp.read())) as zfile:
zfile.extractall("data/demand/unsd")
zfile.extractall("data/demand/unsd/data")

path = "data/demand/unsd"
path = "data/demand/unsd/data"

# Get the files from the path provided in the OP
all_files = Path("data/demand/unsd").glob("*.txt")
all_files = Path("data/demand/unsd/data").glob("*.txt")

# Create a dataframe from all downloaded files
df = pd.concat(
Expand Down

0 comments on commit 95b288e

Please sign in to comment.