Skip to content

Commit

Permalink
Prevent numpy types in ephemeris response
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Oct 26, 2024
1 parent 74c0efe commit 34b3e49
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/lvmapi/tools/schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,17 +170,17 @@ def get_ephemeris_summary(sjd: int | None = None) -> dict:
)

return {
"SJD": sjd,
"request_jd": Time.now().jd,
"SJD": int(sjd),
"request_jd": float(Time.now().jd),
"date": data["date"][0],
"sunset": sunset.jd,
"twilight_end": twilight_end.jd,
"twilight_start": twilight_start.jd,
"sunrise": sunrise.jd,
"is_night": is_night,
"is_twilight": is_twilight_evening or is_twilight_morning,
"time_to_sunset": round(time_to_sunset, 3),
"time_to_sunrise": round(time_to_sunrise, 3),
"moon_illumination": round(data["moon_illumination"][0], 3),
"sunset": float(sunset.jd),
"twilight_end": float(twilight_end.jd),
"twilight_start": float(twilight_start.jd),
"sunrise": float(sunrise.jd),
"is_night": bool(is_night),
"is_twilight": bool(is_twilight_evening or is_twilight_morning),
"time_to_sunset": round(float(time_to_sunset), 3),
"time_to_sunrise": round(float(time_to_sunrise), 3),
"moon_illumination": round(float(data["moon_illumination"][0]), 3),
"from_file": from_file,
}

0 comments on commit 34b3e49

Please sign in to comment.