From f1f46d0e7f261ee14540983e0b5f27613b2b465d Mon Sep 17 00:00:00 2001
From: PascalIversen
Date: Wed, 15 Jan 2025 13:59:06 +0100
Subject: [PATCH] asserting in input, causes silent bugs otherwise
---
drevalpy/models/drp_model.py | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drevalpy/models/drp_model.py b/drevalpy/models/drp_model.py
index fb6b34f..26a6d37 100644
--- a/drevalpy/models/drp_model.py
+++ b/drevalpy/models/drp_model.py
@@ -213,6 +213,15 @@ def get_concatenated_features(
cell_line_input=cell_line_input,
drug_input=drug_input,
)
+ if drug_view is not None:
+ if drug_view not in inputs:
+ raise ValueError(f"Expected drug_view '{drug_view}' to be in inputs, but it was not. Inputs: {inputs}")
+ if cell_line_view is not None:
+ if cell_line_view not in inputs:
+ raise ValueError(
+ f"Expected cell_line_view '{cell_line_view}' to be in inputs, but it was not. Inputs: {inputs}"
+ )
+
cell_line_features = None if cell_line_view is None else inputs.get(cell_line_view)
drug_features = None if drug_view is None else inputs.get(drug_view)