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

3 docstrings related to pycbc.types.angle_as_radians #5017

Merged
merged 3 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions bin/pycbc_make_sky_grid
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ statistics.

The grid is constructed following the method described in Section V of
https://arxiv.org/abs/1410.6042.

Please refer to help(pycbc.types.angle_as_radians) for the recommended
configuration file syntax for angle arguments.
"""

import numpy as np
Expand Down
6 changes: 5 additions & 1 deletion bin/pygrb/pycbc_pygrb_grb_info_table
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

"""Create GRB info table."""
"""Create GRB info table.

Please refer to help(pycbc.types.angle_as_radians) for the recommended
configuration file syntax for angle arguments.
"""

# =============================================================================
# Preamble
Expand Down
9 changes: 9 additions & 0 deletions pycbc/types/optparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,15 @@ 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.

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.
"""
# if `s` converts to a float then there is no unit, so assume radians
Expand Down
Loading