From 79bb08410e3503b39f2964ac43da352ef1a14a86 Mon Sep 17 00:00:00 2001 From: Eachan Johnson Date: Sat, 5 Oct 2024 15:02:43 +0100 Subject: [PATCH] Fix typos, create output_dir if it doesn't exit --- carabiner/mpl/utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/carabiner/mpl/utils.py b/carabiner/mpl/utils.py index 013e1d2..569923a 100644 --- a/carabiner/mpl/utils.py +++ b/carabiner/mpl/utils.py @@ -213,7 +213,7 @@ def scattergrid( return fig, axes def figsaver( - dir: str = ".", + output_dir: str = ".", prefix: Optional[str] = None, dpi: int = 300, format: str = 'png', @@ -223,7 +223,7 @@ def figsaver( Parameters ---------- - dir : str, optional + output_dir : str, optional Directory to save figures. Default: ".". prefix : str, optional Prefix for filenames. Default: no prefix. @@ -241,6 +241,9 @@ def figsaver( """ + if not os.path.exists(output_dir): + os.mkdir(output_dir) + def _figsave( fig: figure.Figure, name: str,