Skip to content

Commit 7a57dbf

Browse files
committed
update test
1 parent 6a8e34a commit 7a57dbf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fink_science/ztf/anomaly_detection/processor.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ def anomaly_score(lc_features, model=None):
129129
--------
130130
>>> from fink_utils.spark.utils import concat_col
131131
>>> from pyspark.sql import functions as F
132+
>>> from pyspark.sql.functions import isnan, col
132133
>>> from fink_science.ztf.ad_features.processor import extract_features_ad
133134
134135
>>> df = spark.read.load(ztf_alert_sample)
@@ -148,9 +149,9 @@ def anomaly_score(lc_features, model=None):
148149
... df = df.withColumn(f'anomaly_score{model}', anomaly_score("lc_features", F.lit(model)))
149150
150151
>>> df.filter(df["anomaly_score"] < -0.013).count()
151-
282
152+
320
152153
153-
>>> df.filter(df["anomaly_score"] == 0).count() < 200
154+
>>> df.filter(isnan(col("anomaly_score"))).count() < 200
154155
True
155156
156157
# Check the robustness of the code when i-band is present

0 commit comments

Comments
 (0)