Skip to content

Commit

Permalink
fix(graphics): create directory for output file if not exists
Browse files Browse the repository at this point in the history
  • Loading branch information
entelecheia committed Aug 12, 2023
1 parent 46847f5 commit 451d838
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hyfi/graphics/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,6 @@ def save_adjusted_subplots(
verbose: Verbose mode
"""

if verbose:
logger.info("Save subplots to %s", output_file)
# make the figure look better
fig.subplots_adjust(
left=left,
Expand All @@ -396,6 +394,8 @@ def save_adjusted_subplots(
)
if tight_layout:
fig.tight_layout()

Path(output_file).parent.mkdir(parents=True, exist_ok=True)
fig.savefig(
output_file,
dpi=dpi,
Expand Down

0 comments on commit 451d838

Please sign in to comment.