Skip to content

Commit 66a3602

Browse files
committedFeb 14, 2025
get_obsdate(): raise error if rundate not well formatted
1 parent 85ddaf2 commit 66a3602

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎py/fiberassign/utils.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,10 @@ def get_obsdate(rundate=None):
156156
)
157157
)
158158
else:
159-
assert_isoformat_utc(rundate)
159+
if not assert_isoformat_utc(rundate):
160+
msg = "rundate={} is not yyyy-mm-ddThh:mm:ss+00:00".format(rundate)
161+
log.info(msg)
162+
raise ValueError(msg)
160163
rundate_mjd = Time(datetime.strptime(rundate, "%Y-%m-%dT%H:%M:%S%z")).mjd
161164
rundate_cutoff = get_date_cutoff("rundate", "obsdate")
162165
rundate_mjd_cutoff = Time(datetime.strptime(rundate_cutoff, "%Y-%m-%dT%H:%M:%S%z")).mjd

0 commit comments

Comments
 (0)
Failed to load comments.