Skip to content

Commit

Permalink
nn_ensemble is now a core backend, remove conditional imports
Browse files Browse the repository at this point in the history
  • Loading branch information
osma committed Sep 30, 2019
1 parent 1b94abe commit a789f46
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
9 changes: 2 additions & 7 deletions annif/backend/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from . import http
from . import tfidf
from . import pav
from . import nn_ensemble
import annif


Expand All @@ -27,6 +28,7 @@ def get_backend(backend_id):
register_backend(http.HTTPBackend)
register_backend(tfidf.TFIDFBackend)
register_backend(pav.PAVBackend)
register_backend(nn_ensemble.NNEnsembleBackend)

# Optional backends
try:
Expand All @@ -43,10 +45,3 @@ def get_backend(backend_id):
except ImportError:
annif.logger.debug("vowpalwabbit not available, not enabling " +
"vw_multi & vw_ensemble backends")

try:
from . import nn_ensemble
register_backend(nn_ensemble.NNEnsembleBackend)
except ImportError:
annif.logger.debug("Keras and TensorFlow not available, not enabling " +
"nn_ensemble backend")
2 changes: 0 additions & 2 deletions tests/test_backend_nn_ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
import annif.project
from annif.exception import NotInitializedException

pytest.importorskip("annif.backend.nn_ensemble")


def test_nn_ensemble_suggest_no_model(datadir, project):
nn_ensemble_type = annif.backend.get_backend('nn_ensemble')
Expand Down

0 comments on commit a789f46

Please sign in to comment.