Skip to content

Commit

Permalink
Expose stop_on_first_solution as a CLI flag (#100)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kmaziarz authored Sep 9, 2024
1 parent ca8cbe3 commit aefab3a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions syntheseus/cli/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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",
]
}
)
Expand Down

0 comments on commit aefab3a

Please sign in to comment.