Skip to content

Commit

Permalink
Add path to params.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
dfsnow committed Oct 25, 2024
1 parent 0661459 commit b0ff325
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions data/src/split_origin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
import yaml
from utils.utils import split_file_to_str

DOCKER_PATH = Path("/data")
params = yaml.safe_load(open(DOCKER_PATH / "params.yaml"))


def split_origin(
year: str,
Expand All @@ -30,8 +33,6 @@ def split_origin(


if __name__ == "__main__":
params = yaml.safe_load(open("params.yaml"))["actions"]

parser = argparse.ArgumentParser()
parser.add_argument("--year", required=True, type=str)
parser.add_argument("--geography", required=True, type=str)
Expand All @@ -40,13 +41,13 @@ def split_origin(
"--n_chunks",
required=False,
type=str,
default=params["n_chunks"],
default=params["actions"]["n_chunks"],
)
parser.add_argument(
"--min_chunk_size",
required=False,
type=str,
default=params["min_chunk_size"],
default=params["actions"]["min_chunk_size"],
)
args = parser.parse_args()

Expand Down

0 comments on commit b0ff325

Please sign in to comment.