From fa1446185238256984f96bb24abab22367f32c11 Mon Sep 17 00:00:00 2001 From: Nicolas Kruse Date: Mon, 2 Jun 2025 16:37:08 +0200 Subject: [PATCH] Modified compile_to_bin.py to create the data directory if missing --- thermo_data/compile_to_bin.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/thermo_data/compile_to_bin.py b/thermo_data/compile_to_bin.py index a50ff62..99fe6bc 100644 --- a/thermo_data/compile_to_bin.py +++ b/thermo_data/compile_to_bin.py @@ -1,6 +1,7 @@ import yaml import struct import sys +import os def main(): @@ -53,6 +54,9 @@ def main(): offset += len(body) added_list.add(dat['name']) + # Ensure the output directory exists + os.makedirs(os.path.dirname(output_file), exist_ok=True) + with open(output_file, 'wb') as f: f.write(b'gapy') f.write(struct.pack('