Skip to content

Commit

Permalink
compress tracker_bounds
Browse files Browse the repository at this point in the history
(cherry picked from commit 3ffc16e)
  • Loading branch information
J-morag committed May 23, 2024
1 parent 028eec6 commit 1445d50
Show file tree
Hide file tree
Showing 35 changed files with 30 additions and 1,233,732 deletions.
32 changes: 30 additions & 2 deletions Analysis/plot_pcmapf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
import math
import matplotlib.pyplot as plt
import shutil
import zipfile
import io


PIC_BESTBOUND_DIR = 'plots/pic-bestbound'
CSV_BESTBOUND_DIR = 'plots/csv-bestbound'
Expand All @@ -22,6 +25,30 @@
'''


def read_tracker_bounds(zip_file_path):
# Read the zip file in binary mode
with open(zip_file_path, 'rb') as f:
zip_data = f.read()

# Use BytesIO to load the zip file into memory
with zipfile.ZipFile(io.BytesIO(zip_data)) as z:
# List the contents of the zip file
file_names = z.namelist()

# Create a dictionary to hold the contents of the files
tracker_bounds = {}

# Read each file in the zip file
for file_name in file_names:
with z.open(file_name) as file:
# Assuming the files are text files, read the contents as a string
file_content = file.read().decode('utf-8')
tracker_bounds[file_name] = file_content

print(tracker_bounds.keys())
return tracker_bounds


def classify_files(map_files):
files = os.listdir('results/')
for name in map_files:
Expand Down Expand Up @@ -203,10 +230,11 @@ def plot_bestbound(map_file):
xpcs_plus = []

files = os.listdir('results/' + map_file)
zip_file_path = 'tracker_bounds.zip'
tracker_bounds = read_tracker_bounds(zip_file_path)

for filename in files:
# read tracker file
tracker_df = pd.DataFrame(pd.read_csv('tracker_bounds/' + map_file + '.csv'))
tracker_df = pd.DataFrame(pd.read_csv(io.StringIO(tracker_bounds[map_file + '.csv'])))
print(filename)
csv_file = 'results/' + map_file + '/' + filename
csv_data = pd.read_csv(csv_file)
Expand Down
Binary file added Analysis/tracker_bounds.zip
Binary file not shown.
49,151 changes: 0 additions & 49,151 deletions Analysis/tracker_bounds/Berlin_1_256.csv

This file was deleted.

48,721 changes: 0 additions & 48,721 deletions Analysis/tracker_bounds/Boston_0_256.csv

This file was deleted.

51,386 changes: 0 additions & 51,386 deletions Analysis/tracker_bounds/Paris_1_256.csv

This file was deleted.

77,687 changes: 0 additions & 77,687 deletions Analysis/tracker_bounds/brc202d.csv

This file was deleted.

25,361 changes: 0 additions & 25,361 deletions Analysis/tracker_bounds/den312d.csv

This file was deleted.

46,641 changes: 0 additions & 46,641 deletions Analysis/tracker_bounds/den520d.csv

This file was deleted.

6,401 changes: 0 additions & 6,401 deletions Analysis/tracker_bounds/empty-16-16.csv

This file was deleted.

25,601 changes: 0 additions & 25,601 deletions Analysis/tracker_bounds/empty-32-32.csv

This file was deleted.

53,801 changes: 0 additions & 53,801 deletions Analysis/tracker_bounds/empty-48-48.csv

This file was deleted.

1,601 changes: 0 additions & 1,601 deletions Analysis/tracker_bounds/empty-8-8.csv

This file was deleted.

36,521 changes: 0 additions & 36,521 deletions Analysis/tracker_bounds/ht_chantry.csv

This file was deleted.

38,960 changes: 0 additions & 38,960 deletions Analysis/tracker_bounds/ht_mansion_n.csv

This file was deleted.

47,392 changes: 0 additions & 47,392 deletions Analysis/tracker_bounds/lak303d.csv

This file was deleted.

38,981 changes: 0 additions & 38,981 deletions Analysis/tracker_bounds/lt_gallowstemplar_n.csv

This file was deleted.

7,538 changes: 0 additions & 7,538 deletions Analysis/tracker_bounds/maze-128-128-1.csv

This file was deleted.

52,051 changes: 0 additions & 52,051 deletions Analysis/tracker_bounds/maze-128-128-10.csv

This file was deleted.

22,878 changes: 0 additions & 22,878 deletions Analysis/tracker_bounds/maze-128-128-2.csv

This file was deleted.

9,882 changes: 0 additions & 9,882 deletions Analysis/tracker_bounds/maze-32-32-2.csv

This file was deleted.

10,997 changes: 0 additions & 10,997 deletions Analysis/tracker_bounds/maze-32-32-4.csv

This file was deleted.

125,103 changes: 0 additions & 125,103 deletions Analysis/tracker_bounds/orz900d.csv

This file was deleted.

45,376 changes: 0 additions & 45,376 deletions Analysis/tracker_bounds/ost003d.csv

This file was deleted.

14,086 changes: 0 additions & 14,086 deletions Analysis/tracker_bounds/random-32-32-10.csv

This file was deleted.

12,876 changes: 0 additions & 12,876 deletions Analysis/tracker_bounds/random-32-32-20.csv

This file was deleted.

30,161 changes: 0 additions & 30,161 deletions Analysis/tracker_bounds/random-64-64-10.csv

This file was deleted.

30,521 changes: 0 additions & 30,521 deletions Analysis/tracker_bounds/random-64-64-20.csv

This file was deleted.

11,526 changes: 0 additions & 11,526 deletions Analysis/tracker_bounds/room-32-32-4.csv

This file was deleted.

34,951 changes: 0 additions & 34,951 deletions Analysis/tracker_bounds/room-64-64-16.csv

This file was deleted.

32,611 changes: 0 additions & 32,611 deletions Analysis/tracker_bounds/room-64-64-8.csv

This file was deleted.

77,521 changes: 0 additions & 77,521 deletions Analysis/tracker_bounds/w_woundedcoast.csv

This file was deleted.

32,494 changes: 0 additions & 32,494 deletions Analysis/tracker_bounds/warehouse-10-20-10-2-1.csv

This file was deleted.

37,231 changes: 0 additions & 37,231 deletions Analysis/tracker_bounds/warehouse-10-20-10-2-2.csv

This file was deleted.

47,731 changes: 0 additions & 47,731 deletions Analysis/tracker_bounds/warehouse-20-40-10-2-1.csv

This file was deleted.

49,991 changes: 0 additions & 49,991 deletions Analysis/tracker_bounds/warehouse-20-40-10-2-2.csv

This file was deleted.

0 comments on commit 1445d50

Please sign in to comment.