Skip to content

Commit fddebc3

Browse files
Log error (#585)
1 parent 207e040 commit fddebc3

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

fink_science/ztf/superluminous/processor.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
import os
2727
import requests
2828
import io
29+
import logging
30+
31+
_LOG = logging.getLogger(__name__)
2932

3033

3134
@pandas_udf(DoubleType())
@@ -165,9 +168,16 @@ def superluminous_score(
165168

166169
# Add it to the history alerts
167170
for field in ["cjd", "cmagpsf", "csigmapsf", "cfid"]:
168-
lcs[field] = np.array(
169-
lcs[field].apply(list) + current_night[field].apply(list)
170-
)
171+
combined_values = lcs[field].apply(list) + current_night[field].apply(list)
172+
if len(combined_values) != len(lcs):
173+
_LOG.warning(
174+
f"Length mismatch: combined length {len(combined_values)}, lcs length {len(lcs)}"
175+
)
176+
_LOG.warning("{}".format(lcs["objectId"].to_numpy()))
177+
# exit
178+
return pd.Series([-1.0] * len(objectId))
179+
else:
180+
lcs[field] = np.array(combined_values)
171181

172182
# FIXME: why lcs would be None here?
173183
if lcs is not None:

0 commit comments

Comments
 (0)