Skip to content

Commit

Permalink
skip subset train on nojit
Browse files Browse the repository at this point in the history
  • Loading branch information
mdekstrand committed Dec 26, 2024
1 parent a526419 commit 9e79952
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lenskit/lenskit/testing/_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,14 @@ class TrainingTests:
needs_jit: ClassVar[bool] = True
component: type[Component]

@fixture(scope="function" if retrain else "class")
def trained_model(self, ml_ds: Dataset):
def maybe_skip_nojit(self):
if self.needs_jit and not jit_enabled:
skip("JIT is disabled")

@fixture(scope="function" if retrain else "class")
def trained_model(self, ml_ds: Dataset):
self.maybe_skip_nojit()

model = self.component()
if isinstance(model, Trainable):
model.train(ml_ds)
Expand Down Expand Up @@ -218,6 +221,7 @@ def test_score_empty_items(

def test_train_score_items_missing_data(self, rng: np.random.Generator, ml_ds: Dataset):
"train and score when some entities are missing data"
self.maybe_skip_nojit()
drop_i = rng.choice(ml_ds.items.ids(), 20)
drop_u = rng.choice(ml_ds.users.ids(), 5)

Expand Down

0 comments on commit 9e79952

Please sign in to comment.