Debugging Validation and testing

This commit is contained in:
Si11ium
2020-03-09 19:18:22 +01:00
parent 4ae333fe5d
commit 6b9696c98e
14 changed files with 28 additions and 116 deletions

View File

@ -167,6 +167,10 @@ class Map(object):
class MapStorage(object):
@property
def keys(self):
return list(self.data.keys())
def __init__(self, map_root, load_all=False):
self.data = dict()
self.map_root = Path(map_root)
@ -175,11 +179,11 @@ class MapStorage(object):
_ = self[map_file.name]
def __getitem__(self, item):
if item in hasattr(self, item):
return self.__getattribute__(item)
if item in self.data.keys():
return self.data.get(item)
else:
with shelve.open(self.map_root / f'{item}.pik', flag='r') as d:
self.__setattr__(item, d['map']['map'])
current_map = Map().from_image(self.map_root / item)
self.data.__setitem__(item, np.asarray(current_map))
return self[item]