Skip to content

Commit bbed456

Browse files
tepickeringclaude
andcommitted
Silence spurious RuntimeWarning from Angle.to_string() in Schedule.to_table
Some CPython builds (e.g. uv's python-build-standalone on x86_64 Linux) make np.vectorize report a stale floating-point invalid flag; see astropy/astropy#18989. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent b741c35 commit bbed456

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎astroplan/scheduling.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,11 @@ def to_table(self, show_transitions=True, show_unused=False):
270270
def _format_target_info(target):
271271
if hasattr(target, "coord"):
272272
try:
273-
return target.coord.icrs.to_string("hmsdms")
273+
# np.errstate silences a spurious RuntimeWarning from
274+
# Angle.to_string() with some CPython builds
275+
# (astropy/astropy#18989).
276+
with np.errstate(invalid="ignore"):
277+
return target.coord.icrs.to_string("hmsdms")
274278
except ConvertError:
275279
return repr(target.coord)
276280
if hasattr(target, "alt") and hasattr(target, "az"):

0 commit comments

Comments
 (0)