Skip to content

Commit

Permalink
Update pycbc/types/optparse.py
Browse files Browse the repository at this point in the history
Co-authored-by: Tito Dal Canton <[email protected]>
  • Loading branch information
pannarale and titodalcanton authored Jan 22, 2025
1 parent ebe123e commit dfe5a99
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions pycbc/types/optparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,11 +545,14 @@ def angle_as_radians(s):
(e.g. 12deg, 1rad), "<value> <unit>" (e.g. 12 deg, 1 rad) or just
"<value>", in which case the unit will be assumed to be radians.
When writing angles in configuration files as options to be passed to
executables that rely on this function and require angles in their command
line, the format "<value> <unit>", with the quotation marks included,
prevents errors with negative values due to how Pegasus renders options in
.sh files.
Note that the format "<value><unit>", with a negative value and no space,
is not parsed correctly by argparse; for more information, see
https://stackoverflow.com/questions/16174992/cant-get-argparse-to-read-quoted-string-with-dashes-in-it
Note: when writing angles in workflow configuration files as options to be
passed to executables that rely on this function and require angles in their
command line, the format "<value> <unit>", with the quotation marks
included, is required due to how Pegasus renders options in .sh files.
To be used as type in argparse arguments.
"""
Expand Down

0 comments on commit dfe5a99

Please sign in to comment.