Compress the precomputed edit_distance arrays

This commit is contained in:
kris 2019-06-14 22:08:34 +01:00
parent f07cabafb7
commit 696eb61bf4
4 changed files with 6 additions and 2 deletions

Binary file not shown.

Binary file not shown.

View File

@ -1,3 +1,4 @@
import bz2
import functools
import pickle
from typing import Iterable
@ -239,7 +240,9 @@ def main():
# TODO: error distance matrices
with open("transcoder/edit_distance.pickle", "wb") as out:
with bz2.open(
"transcoder/edit_distance.pickle.bz2", "wb",
compresslevel=9) as out:
pickle.dump(
edit, out, protocol=pickle.HIGHEST_PROTOCOL)

View File

@ -1,5 +1,6 @@
"""Various representations of Apple II video display."""
import bz2
import functools
import pickle
from typing import Union
@ -141,7 +142,7 @@ class DHGRBitmap:
# Load edit distance matrices for masked, shifted byte 0..3 values
# TODO: should go somewhere else since we don't use it here at all
with open("transcoder/edit_distance.pickle", "rb") as ed:
with bz2.open("transcoder/edit_distance.pickle.bz2", "rb") as ed:
edit_distances = pickle.load(ed)
def __init__(self, main_memory: MemoryMap, aux_memory: MemoryMap):