diff --git a/Snakefile b/Snakefile index a0e1a3a75..db9662cc1 100644 --- a/Snakefile +++ b/Snakefile @@ -1358,6 +1358,7 @@ rule build_base_energy_totals: unsd_paths="data/demand/unsd/paths/Energy_Statistics_Database.xlsx", output: energy_totals_base="resources/" + SECDIR + "energy_totals_base.csv", + UNexport=touch("data/demand/unsd/unsd_export.done"), script: "scripts/build_base_energy_totals.py" @@ -1877,7 +1878,7 @@ rule build_base_industry_totals: #default data input: #os.path.dirname(snakemake.input["transactions_path"]) + "/demand/unsd/data/" #industrial_production_per_country="data/industrial_production_per_country.csv", - unsd_path="data/demand/unsd/data/", + unsd_path="data/demand/unsd/unsd_export.done", energy_totals_base="resources/" + SECDIR + "energy_totals_base.csv", transactions_path="data/unsd_transactions.csv", output: diff --git a/scripts/build_base_industry_totals.py b/scripts/build_base_industry_totals.py index 1e5eda9a8..e9e03d07f 100644 --- a/scripts/build_base_industry_totals.py +++ b/scripts/build_base_industry_totals.py @@ -117,10 +117,10 @@ def create_industry_base_totals(df): renaming_dit = transaction.set_index("Transaction")["clean_name"].to_dict() clean_industry_list = list(transaction.clean_name.unique()) - unsd_path = snakemake.input.unsd_path + unsd_path = Path(snakemake.input.unsd_path).parent # Get the files from the path provided in the OP - all_files = list(Path(unsd_path).glob("*.txt")) + all_files = list(unsd_path.glob("*.txt")) # Create a dataframe from all downloaded files df = pd.concat(