roni commited on
Commit
9ec67f0
·
1 Parent(s): cfe9ac6

skipping invalid indexes

Browse files
Files changed (1) hide show
  1. get_index.py +8 -4
get_index.py CHANGED
@@ -18,14 +18,18 @@ def get_engines(index_repo: str, model_repo: str):
18
  )
19
  sys.path.append(str(local_arch_path))
20
  from protein_index import ( # pylint: disable=import-error,import-outside-toplevel
21
- ProteinSearchEngine,
22
  )
23
 
24
  subindex_paths = glob(str(index_path / "*/"))
25
  engines = {}
26
  for subindex_path in subindex_paths:
27
  subindex_name = os.path.basename(subindex_path)
28
- engine = ProteinSearchEngine(data_path=Path(subindex_path))
29
- if len(engine) > 10000:
30
- engines[subindex_name] = engine
 
 
 
 
31
  return engines
 
18
  )
19
  sys.path.append(str(local_arch_path))
20
  from protein_index import ( # pylint: disable=import-error,import-outside-toplevel
21
+ ProteinSearchEngine, ProteinIndexError
22
  )
23
 
24
  subindex_paths = glob(str(index_path / "*/"))
25
  engines = {}
26
  for subindex_path in subindex_paths:
27
  subindex_name = os.path.basename(subindex_path)
28
+ try:
29
+ engine = ProteinSearchEngine(data_path=Path(subindex_path))
30
+ if len(engine) > 1000:
31
+ engines[subindex_name] = engine
32
+ except ProteinIndexError:
33
+ ...
34
+
35
  return engines