Skip to content

Commit 28d5799

Browse files
committed
DataFiles bug fixes
1 parent 47da450 commit 28d5799

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

demosys/resources/data.py

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,8 @@ def load(self, path: str, cls=Data, mode='binary', **kwargs) -> Data:
8080
if data_file:
8181
return data_file
8282

83-
if not data_file:
84-
meta = self.load_deferred(path, cls=cls, mode=mode, **kwargs)
85-
data_file = self._load(meta)
86-
self.file_map[meta.path] = data_file
83+
meta = self.load_deferred(path, cls=cls, mode=mode, **kwargs)
84+
data_file = self._load(meta)
8785

8886
return data_file
8987

@@ -110,24 +108,15 @@ def _load(self, meta) -> Data:
110108
if not found_path:
111109
raise ImproperlyConfigured("Cannot find data file {}".format(meta.path))
112110

113-
print(" - {}".format(meta.path))
111+
print("Loading: {}".format(meta.path))
114112
data_file = meta.cls(meta.path, mode=meta.mode, **meta.kwargs)
115113
data_file.load(found_path)
114+
self.file_map[meta.path] = data_file
116115

117116
return data_file
118117

119118
def _destroy(self, obj):
120119
obj.destroy()
121120

122-
def load_pool(self):
123-
"""
124-
Loads all the data files using the configured finders.
125-
"""
126-
print("Loading data files:")
127-
for path, data_file in self.file_map.items():
128-
self._load(self.file_meta[path])
129-
130-
self._on_loaded()
131-
132121

133122
data = DataFiles()

0 commit comments

Comments
 (0)