From 29177de1f5bee3d8294dba684cbe79bb6d95bb0d Mon Sep 17 00:00:00 2001 From: Matt Fisher Date: Wed, 6 Mar 2024 15:12:00 -0700 Subject: [PATCH] Fix bug with generating SWE legends Since changing the path for legends to be deeper, we need to update mkdir calls to create parents if needed. --- snow_today_webapp_ingest/ingest/legends.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snow_today_webapp_ingest/ingest/legends.py b/snow_today_webapp_ingest/ingest/legends.py index 723b2567..a36eb93b 100644 --- a/snow_today_webapp_ingest/ingest/legends.py +++ b/snow_today_webapp_ingest/ingest/legends.py @@ -27,7 +27,7 @@ def generate_swe_legends( colormap_id = variable_params["colormapId"] colormap = colormaps_json[str(colormap_id)]["colors"] - to_path.mkdir(exist_ok=True) + to_path.mkdir(exist_ok=True, parents=True) make_legend( colormap=colormap, # This value range could be static every day, or it could change @@ -81,7 +81,7 @@ def generate_ssp_legends( output_fn = f"{region_id}_{variable_id}.svg" output_fp = to_path / output_fn - to_path.mkdir(exist_ok=True) + to_path.mkdir(exist_ok=True, parents=True) make_legend( colormap=colormap, # This value range could be static every day, or it could change