From aefab3a07d6d2bfbab7737f7ac657b0b6da00550 Mon Sep 17 00:00:00 2001 From: Krzysztof Maziarz Date: Mon, 9 Sep 2024 10:50:42 +0100 Subject: [PATCH] Expose `stop_on_first_solution` as a CLI flag (#100) In #13, a `stop_on_first_solution` flag was added to the base search algorithm class, but so far it was not available when using the search CLI. As this option can be quite useful (for e.g. running a quick check to assess the difficulty of a given set of targets), this PR adds it as a CLI option as well. --- CHANGELOG.md | 1 + syntheseus/cli/search.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91559c4..8214fb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and the project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0. ### Added - Reuse search results when given a partially filled directory ([#98](https://github.com/microsoft/syntheseus/pull/98)) ([@kmaziarz]) +- Expose `stop_on_first_solution` as a CLI flag ([#100](https://github.com/microsoft/syntheseus/pull/100)) ([@kmaziarz]) ### Fixed diff --git a/syntheseus/cli/search.py b/syntheseus/cli/search.py index 11bdfdc..3304439 100644 --- a/syntheseus/cli/search.py +++ b/syntheseus/cli/search.py @@ -123,6 +123,7 @@ class BaseSearchConfig: limit_iterations: int = 1_000_000 limit_graph_nodes: int = INT_INF prevent_repeat_mol_in_trees: bool = True + stop_on_first_solution: bool = False use_gpu: bool = True # Whether to use a GPU canonicalize_inventory: bool = False # Whether to canonicalize the inventory SMILES @@ -209,6 +210,7 @@ def run_from_config(config: SearchConfig) -> Path: "limit_iterations", "limit_graph_nodes", "prevent_repeat_mol_in_trees", + "stop_on_first_solution", ] } )