Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve flags (& --help) of qfit programs #122

Merged
merged 9 commits into from
Nov 8, 2020

Conversation

blake-riley
Copy link
Contributor

@blake-riley blake-riley commented Oct 12, 2020

Pull Request Checklist

  • Will your PR merge into the dev branch?
    Exceptions will be made for urgent bugfixes.
  • Have you forked from dev?
    If not, please rebase your PR onto the most recent dev tip.
  • Does your PR title succinctly describe the changes?
    Explain to a new user by completing the sentence: 'This PR will: ...'
  • Fill out the template below.

Description of the Change

Fixes #69 .

Release Notes

  • Make default values for all command-line options appear in --help
  • Improve clarity by making all flags positively worded, removing some short flags
  • Change options to use internal hyphenation (no internal underscores) for consistency
  • Unified some options across programs

Command line changes

Flags that changed (maintained short form):

  • --build-stepsize--dofs-per-iteration (-b)
  • --stepsize--dihedral-stepsize (-s)
  • --no-waters--no-waters-clash

Removed short flags (now-required long form):

  • -ns (--no-scale)
  • -nosub (--no-subtract)
  • -nw (--no-waters-clash)
  • -nb (--no-build)
  • -nl (--no-local)
  • -bb (--no-backbone)
  • -sa (--no-sample-angle)
  • -T (--no-threshold-selection)
  • -Ts (--no-segment-threshold-selection)

Now-hyphenated flags:

  • --resolution_min--resolution-min
  • --clash_scaling_factor--clash-scaling-factor
  • --external_clash--external-clash
  • --bulk_solvent_level--bulk-solvent-level
  • --rmsd_cutoff--rmsd-cutoff
  • --write_intermediate_conformers--write-intermediate-conformers

This is the crux of this PR: there's too many negatives floating around here.

We fold the 'store_false' action and --no- flags together: they cancel each other out.
We get a positively worded flag, and make sure to set the default to True.
Finally, we assign the ToggleActionFlag type so that both options appear together in the help.

Note, we lose some short flags as a result (I don't think this is a loss for clarity).

What was
  -bb, --no-backbone        Do not sample backbone using inverse kinematics. (default: True)
is now:
  --[no-]backbone      Sample backbone using inverse kinematics. (default: True)

This applies to:
* -ns, --no-scale → --[no-]scale
* -nosub, --no-subtract → --[no-]subtract
* -bb, --no-backbone → --[no-]backbone
* -sa, --no-sample-angle → --[no-]sample-angle
* -T, --no-threshold-selection → --[no-]threshold-selection
* -Ts, --no-segment-threshold-selection → --[no-]segment-threshold-selection
… Consistency!

--write_intermediate_conformers → --write-intermediate-conformers
--resolution_min → --resolution-min
--clash_scaling_factor → --clash-scaling-factor
--external_clash → --external-clash
--bulk_solvent_level → --bulk-solvent-level
--rmsd_cutoff → --rmsd-cutoff

Dest variables will still maintain underscores.
The logic has to change here, since the variable was a negative.
Flags that changed:
* --no-waters → --no-waters-clash

Loss of short flags (now-required long form):
* -ns (--no-scale)
* -nosub (--no-subtract)
* -nw (--no-waters-clash)
* -bb (--no-backbone)
* -sa (--no-sample-angle)
* -T (--no-threshold-selection)

Now-hyphenated flags:
* --resolution_min → --resolution-min
* --clash_scaling_factor → --clash-scaling-factor
* --external_clash → --external-clash
* --bulk_solvent_level → --bulk-solvent-level
* --rmsd_cutoff → --rmsd-cutoff

New flags:
* --write-intermediate-conformers

Also:
* Remove unused import 'from os import path'
Flags that changed (maintained short form):
* --build-stepsize → --dofs-per-iteration (-b)
* --stepsize → --dihedral-stepsize (-s)
* --no-waters → --no-waters-clash

Loss of short flags (now-required long form):
* -ns (--no-scale)
* -nosub (--no-subtract)
* -nw (--no-waters-clash)
* -nb (--no-build)
* -nl (--no-local)
* -T (--no-threshold-selection)

Now-hyphenated flags:
* --resolution_min → --resolution-min
* --clash_scaling_factor → --clash-scaling-factor
* --external_clash → --external-clash
* --bulk_solvent_level → --bulk-solvent-level
* --write_intermediate_conformers → --write-intermediate-conformers
@blake-riley
Copy link
Contributor Author

OK, I'm pretty happy with this.
There's some breaking changes to command line options, so when this goes into mainline, it's version 3.3.

@blake-riley blake-riley merged commit c7e0fe7 into dev Nov 8, 2020
@blake-riley blake-riley deleted the hotfix/69-double-negatives-in-options branch November 8, 2020 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default values for boolean flags in --help is confusing (please remove double negatives)
1 participant