Skip to content

Commit

Permalink
update ML20M tests for new ML
Browse files Browse the repository at this point in the history
  • Loading branch information
mdekstrand committed Jul 25, 2024
1 parent eb82482 commit 72f46d3
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions lenskit/tests/test_ml20m.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,17 @@
from lenskit.algorithms import Recommender
from lenskit.algorithms.basic import PopScore
from lenskit.data.dataset import Dataset, from_interactions_df
from lenskit.datasets import MovieLens
from lenskit.data.movielens import load_movielens

_log = logging.getLogger(__name__)

_ml_path = Path("data/ml-20m")
if _ml_path.exists():
_ml_20m = MovieLens(_ml_path)
else:
_ml_20m = None


@pytest.fixture
@pytest.fixture(scope="module")
def ml20m():
if _ml_20m:
return from_interactions_df(_ml_20m.ratings)
if _ml_path.exists():
return load_movielens(_ml_path)
else:
pytest.skip("ML-20M not available")

Expand Down

0 comments on commit 72f46d3

Please sign in to comment.