From b731d4fca6bb55262ece4f9269bb82347dbeea28 Mon Sep 17 00:00:00 2001 From: "Pohlmann, Roxana" Date: Fri, 4 Aug 2023 18:16:04 +0200 Subject: [PATCH] Add creation of direcotry, if it doesnt exist --- examples/export_npz.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/export_npz.py b/examples/export_npz.py index 40edb611f..a3a2cdecf 100644 --- a/examples/export_npz.py +++ b/examples/export_npz.py @@ -1,3 +1,5 @@ +from pathlib import Path + import numpy as np import gustaf @@ -54,6 +56,7 @@ hexa.show_options["data_name"] = "arange" # Export hexa, edges and vertices + Path("export").mkdir(exist_ok=True) gustaf.io.npz.export(hexa, "export/hexa.npz") gustaf.io.npz.export(hexa.to_edges(), "export/hexa_edges.npz") gustaf.io.npz.export(hexa.to_vertices(), "export/hexa_vertices.npz")