Handle boolean flag parameters correctly in CommandExecutor.run_topp()#350
Open
t0mdavid-m wants to merge 1 commit intomainfrom
Open
Handle boolean flag parameters correctly in CommandExecutor.run_topp()#350t0mdavid-m wants to merge 1 commit intomainfrom
t0mdavid-m wants to merge 1 commit intomainfrom
Conversation
TOPP tools have two boolean parameter styles: flag-style (registerFlag_) where presence means enabled, and string-style (registerStringOption_ with valid_strings=["true","false"]) where explicit values are required. Add isinstance(v, bool) check in the params[tool] loop so that: - Python bool True emits only the flag (e.g., -flag) - Python bool False omits the flag entirely - String "true"/"false" continues to emit -param true / -param false This fixes tools like FLASHDeconv and FLASHTnT that expect POSIX-style boolean flags. https://claude.ai/code/session_016pdqzsAKEB6UDBcGM82T6F
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds proper handling for boolean flag parameters in the
CommandExecutor.run_topp()method. Boolean parameters are now correctly converted to TOPP command-line flags:Truevalues emit only the flag (no value), whileFalsevalues omit the flag entirely. This distinguishes them from string-based boolean parameters ("true"/"false") which continue to emit explicit values.Changes
CommandExecutor.py: Added boolean parameter detection and handling logic
Trueboolean values now emit only the flag name (e.g.,-enable_feature)Falseboolean values are skipped entirely (flag not emitted)test_boolean_flag_params.py: Added comprehensive test suite
bool Truebool FalseImplementation Details
The implementation uses a simple
isinstance(v, bool)check before the existing parameter processing logic. When a boolean is detected:True: append the flag andcontinueto skip the normal value-appending logicFalse:continueto skip the flag entirelyThis approach maintains backward compatibility while adding proper support for registerFlag_ style parameters in TOPP tools.
https://claude.ai/code/session_016pdqzsAKEB6UDBcGM82T6F