Skip to content

Commit

Permalink
Cast astropy time MJD to float from np.float64
Browse files Browse the repository at this point in the history
In numpy 2 sqlalchemy refuses to handle np.float64 and so the times
must be converted to Python float.
  • Loading branch information
timj committed Jan 16, 2025
1 parent 3320301 commit ac1af00
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/lsst/daf/butler/registry/obscore/_records.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,10 @@ def __call__(self, ref: DatasetRef) -> Record | None:
if timespan is not None:
if timespan.begin is not None:
t_min = cast(astropy.time.Time, timespan.begin)
record["t_min"] = t_min.mjd
record["t_min"] = float(t_min.mjd)
if timespan.end is not None:
t_max = cast(astropy.time.Time, timespan.end)
record["t_max"] = t_max.mjd
record["t_max"] = float(t_max.mjd)

region = dataId.region
if self.exposure.name in dataId:
Expand Down

0 comments on commit ac1af00

Please sign in to comment.