Commit 022ca9b4 authored by Grzegorz Kostkowski's avatar Grzegorz Kostkowski

Manual merge

parents 90c7eada 6f014a2c
......@@ -160,6 +160,10 @@ def load_file_lines(path_):
def load_file_pairs_dict(path, delimiter='\t'):
# fsm = FileSourceMapping(path, delimiter=delimiter, encoding=encoding,
# type_defs=(str, float))
# ind = IndexBuilder(fsm, value_type=float).build()
# return ind
with codecs.open(path, 'r', encoding='utf8') as ifile:
return {
k: v
......@@ -170,6 +174,9 @@ def load_file_pairs_dict(path, delimiter='\t'):
def load_categories_labels_dict(path, delimiter='\t'):
# fsm = FileSourceMapping(path, delimiter=delimiter, encoding=encoding)
# ind = IndexBuilder(fsm).build()
# return ind
with codecs.open(path, 'r', encoding='utf8') as ifile:
return {
k: v
......@@ -178,7 +185,7 @@ def load_categories_labels_dict(path, delimiter='\t'):
]]
}
# TODO remove
def load_all(graph_path, concepts_categories_path):
'''Loads required components which are time-consuming. Useful in
ipython session.
......
......@@ -25,6 +25,8 @@ class ResourcesManager(object):
self._res_type_dependencies_map = {}
self._res_type_2_res_map = {}
self._load()
self._load_all()
self._resources = {}
def register_resources(self):
......@@ -112,6 +114,9 @@ class ResourcesManager(object):
return deps_dict
def _load_all(self):
for res_cfg in self._cfg.resources_config:
name = res_cfg["name"] # todo make file default_handler.py where classes will be listed that can be skiped in config ini - and add some logic to config.py to handle it
res_loader = res_cfg["loader_class"]
res = locate(res_loader)(name, res_cfg)
self._resources.append(res)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment