From e4a919d02299f0ae2db1fb273ea35906182aa8bf Mon Sep 17 00:00:00 2001 From: HappyZ Date: Mon, 10 Jun 2019 12:59:54 -0500 Subject: [PATCH] Update 003b.extract_only_enough_data_with_groundtruth.py --- .../003b.extract_only_enough_data_with_groundtruth.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opencellid_parsing/003b.extract_only_enough_data_with_groundtruth.py b/opencellid_parsing/003b.extract_only_enough_data_with_groundtruth.py index 2352bb9..5046360 100644 --- a/opencellid_parsing/003b.extract_only_enough_data_with_groundtruth.py +++ b/opencellid_parsing/003b.extract_only_enough_data_with_groundtruth.py @@ -19,8 +19,6 @@ data = pickle.load(open(pickle_fp_with_gt, 'rb')) threshold = int(input("please enter minimal number of measurements:")) outputfolder = '{}_extracted_thresh_{}'.format(folderpath.rstrip('/'), threshold) -if not os.path.isdir(outputfolder): - os.makedirs(outputfolder) headline = '#lon,lat,sig,measure_at,upload_at,rating,speed,direction' headlines = { @@ -55,3 +53,5 @@ for filepath in data: for dataline in data[filepath][1]: of.write(dataline + "\n") print("done: {} out of {} files extracted ({:.2f}%)".format(counter_valid, len(data), 100.0 * counter_valid / len(data))) + +os.rename('{}_extracted'.format(folderpath.rstrip('/')), outputfolder)