adjusted bb4g for dev

This commit is contained in:
Tim Lorsbach
2026-10-21 10:21:58 +02:00
parent 86c9ac887e
commit 4c961b0821
+17 -1
View File
@@ -29,6 +29,8 @@ class SamplingAlgorithm(enum.Enum):
class BB4GConfig(EnviPyModel): class BB4GConfig(EnviPyModel):
sampling_algorithm: SamplingAlgorithm = SamplingAlgorithm.EXACT sampling_algorithm: SamplingAlgorithm = SamplingAlgorithm.EXACT
cutoff: int = -5 cutoff: int = -5
model: str = "rat"
mode: str | None = None
class UI: class UI:
title = "BB4G Configuration" title = "BB4G Configuration"
@@ -44,6 +46,18 @@ class BB4GConfig(EnviPyModel):
order=2, order=2,
placeholder="If unset defaults to -5" placeholder="If unset defaults to -5"
) )
model = UIConfig(
widget=WidgetType.TEXT,
label="BB4G Model",
order=3,
placeholder="If unset defaults to rat"
)
mode = UIConfig(
widget=WidgetType.TEXT,
label="BB4G Mode",
order=4,
placeholder="If unset defaults to None"
)
# Once stable these will be exposed by enviPy-plugins lib # Once stable these will be exposed by enviPy-plugins lib
@@ -127,7 +141,7 @@ class BB4G(Classifier):
def run(self, eP: EnviPyDTO, *args, **kwargs) -> RunResult: def run(self, eP: EnviPyDTO, *args, **kwargs) -> RunResult:
# Ensure Service is running # Ensure Service is running
self.start() # self.start()
smiles = [c.smiles for c in eP.get_compounds()] smiles = [c.smiles for c in eP.get_compounds()]
preds = self._post(smiles) preds = self._post(smiles)
@@ -167,6 +181,8 @@ class BB4G(Classifier):
"smiles": smi, "smiles": smi,
"sampling_alg": self.config.sampling_algorithm.value, "sampling_alg": self.config.sampling_algorithm.value,
"cutoff": self.config.cutoff, "cutoff": self.config.cutoff,
"model": self.config.model,
"mode": self.config.mode,
} }
retries = 0 retries = 0