Skip to content

Commit

Permalink
🐛 [alan-turing-institute#622]: Convert jaxlib ArrayImpl into float fo…
Browse files Browse the repository at this point in the history
…r postgresql
  • Loading branch information
Tdarnell committed Aug 14, 2023
1 parent c9b2cdc commit de76b99
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions airsenal/scripts/fill_predictedscore_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@ def calc_all_predicted_points(
dbsession=dbsession,
)
for p in predictions:
# check if db uri contains postgresql
if "postgresql" in dbsession.bind.url.drivername:
# check if the predicted_points is a float or jaxlib ArrayImpl
if hasattr(p.predicted_points, "shape"):
p.predicted_points = p.predicted_points.tolist()
dbsession.add(p)
dbsession.commit()
print("Finished adding predictions to db")
Expand Down

0 comments on commit de76b99

Please sign in to comment.