Skip to content

Commit

Permalink
include base directory incase of running outside of root directory
Browse files Browse the repository at this point in the history
  • Loading branch information
GbotemiB committed Dec 17, 2024
1 parent d3e00d5 commit a75ef4c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion scripts/prepare_airports.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import numpy as np
import pandas as pd
from _helpers import BASE_DIR

# from _helpers import configure_logging

Expand Down Expand Up @@ -94,7 +95,7 @@ def preprocess_airports(df):
# country_list = country_list_to_geofk(snakemake.config["countries"])'

if snakemake.params.airport_custom_data:
custom_airports = Path("data", "custom", "airports.csv")
custom_airports = Path(BASE_DIR).joinpath("data", "custom", "airports.csv")
shutil.copy(custom_airports, snakemake.output[0])
else:
# Prepare downloaded data
Expand Down
5 changes: 4 additions & 1 deletion scripts/prepare_ports.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import country_converter as coco
import numpy as np
import pandas as pd
from _helpers import BASE_DIR

# from _helpers import configure_logging

Expand Down Expand Up @@ -77,7 +78,9 @@ def filter_ports(dataframe):
# country_list = country_list_to_geofk(snakemake.config["countries"])'

if snakemake.params.custom_export:
custom_export_path = Path("data", "custom", "export_ports.csv")
custom_export_path = Path(BASE_DIR).joinpath(
"data", "custom", "export_ports.csv"
)
shutil.copy(custom_export_path, snakemake.output[1])
else:

Expand Down

0 comments on commit a75ef4c

Please sign in to comment.