diff options
Diffstat (limited to 'misc.py')
-rw-r--r-- | misc.py | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -1,3 +1,4 @@ +import os import numpy as np import datetime @@ -7,3 +8,10 @@ def np_time_convert(dt64): seconds_since_epoch = (dt64 - unix_epoch) / one_second return datetime.datetime.utcfromtimestamp(seconds_since_epoch) + +def create_output_dir(path, clear=False): + if not os.path.exists(path): + os.makedirs(path) + elif clear: + raise Exception('clear not implemented') + |