File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
fink_science/ztf/superluminous Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change 2626import os
2727import requests
2828import 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 :
You can’t perform that action at this time.
0 commit comments