Skip to content
Snippets Groups Projects
Commit 55c8a420 authored by Tim O'Donnell's avatar Tim O'Donnell
Browse files

fixes

parent 5d0bf7d5
No related branches found
No related tags found
No related merge requests found
from .class1_ensemble_multi_allele_predictor import (
Class1EnsembleMultiAllelePredictor,
get_downloaded_predictor,
supported_alleles,
HYPERPARAMETER_DEFAULTS)
__all__ = [
"Class1EnsembleMultiAllelePredictor",
"get_downloaded_predictor",
"supported_alleles",
"HYPERPARAMETER_DEFAULTS",
]
......@@ -58,6 +58,7 @@ HYPERPARAMETER_DEFAULTS = (
CACHED_PREDICTOR = None
CACHED_PREDICTOR_PATH = None
def supported_alleles():
......@@ -72,14 +73,15 @@ def get_downloaded_predictor():
"""
Return a Class1AlleleSpecificPredictorLoader that uses downloaded models.
"""
global CACHED_PREDICTOR
global CACHED_PREDICTOR, CACHED_PREDICTOR_PATH
# Some of the unit tests manipulate the downloads directory configuration
# so get_path here may return different results in the same Python process.
# For this reason we check the path and invalidate the loader if it's
# different.
path = get_path("models_class1_allele_specific_ensemble")
if CACHED_PREDICTOR is None or path != CACHED_PREDICTOR.path:
if CACHED_PREDICTOR_PATH != path:
CACHED_PREDICTOR_PATH = path
CACHED_PREDICTOR = (
Class1EnsembleMultiAllelePredictor
.load_from_download_directory(path))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment