Skip to content

Commit

Permalink
Move module code into separate files (#70)
Browse files Browse the repository at this point in the history
- Move module code out of package init files. This is helpful for auto generated API docs (in addition to being cleaner).
- Add several tests to ensure all modules can be created (e.g., see task/tests/test_task.py)
- Update documentation to use NFCorpus examples
- Fix duplication of NFCorpus documents
  • Loading branch information
andrewyates authored Jun 24, 2020
1 parent a9272d2 commit 37e7192
Show file tree
Hide file tree
Showing 69 changed files with 3,675 additions and 2,928 deletions.
26 changes: 14 additions & 12 deletions capreolus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import os
from pathlib import Path

from profane import ConfigOption, Dependency, constants, config_list_to_dict
from profane import ConfigOption, Dependency, ModuleBase, constants, config_list_to_dict, module_registry

__version__ = "0.2.1"
__version__ = "0.2.2"

# specify a base package that we should look for modules under (e.g., <BASE>.task)
# constants must be specified before importing Task (or any other modules!)
Expand All @@ -21,16 +21,18 @@
jnius_config.set_classpath(Anserini.get_fat_jar())


# import capreolus.evaluator as evaluator
# from capreolus.benchmark import Benchmark
# from capreolus.collection import Collection
# from capreolus.extractor import Extractor
# from capreolus.index import Index
# from capreolus.reranker.base import Reranker
# from capreolus.searcher import Searcher
# from capreolus.task.base import Task
# from capreolus.tokenizer import Tokenizer
# from capreolus.trainer import Trainer
# note: order is important to avoid circular imports
from capreolus.utils.loginit import get_logger
import capreolus.evaluator as evaluator
from capreolus.benchmark import Benchmark
from capreolus.collection import Collection
from capreolus.index import Index
from capreolus.searcher import Searcher
from capreolus.extractor import Extractor
from capreolus.reranker import Reranker
from capreolus.tokenizer import Tokenizer
from capreolus.trainer import Trainer
from capreolus.task import Task


def parse_config_string(s):
Expand Down
Loading

0 comments on commit 37e7192

Please sign in to comment.