Skip to content

Commit

Permalink
Merge pull request #73 from aertslab/bugfix_test_return
Browse files Browse the repository at this point in the history
fix incorrect return None in Crested.test(...)
  • Loading branch information
LukasMahieu authored Nov 27, 2024
2 parents c908c86 + a63a1d9 commit af998dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/crested/tl/_crested.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,9 +578,9 @@ def test(self, return_metrics: bool = False) -> dict | None:
# Log the evaluation results
for metric_name, metric_value in evaluation_metrics.items():
logger.info(f"Test {metric_name}: {metric_value:.4f}")
return None
if return_metrics:
return evaluation_metrics
return None

def get_embeddings(
self,
Expand Down
4 changes: 3 additions & 1 deletion tests/test_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ def test_peak_regression():
"tests/data/test_pipeline/test_peak_regression/checkpoints/01.keras",
compile=True,
)
trainer.test()

test_metrics = trainer.test(return_metrics=True)
assert isinstance(test_metrics, dict)
trainer.predict(adata, model_name="01")

trainer.predict_regions(region_idx=["chr1:1000-1600", "chr2:2000-2600"])
Expand Down

0 comments on commit af998dc

Please sign in to comment.