Debugging Validation and testing
This commit is contained in:
@ -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]
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user