@@ -1611,6 +1611,8 @@ transform : None
16111611 }
16121612}
16131613
1614+ evaluator ! ( Chi2Pvar , lcf:: Chi2Pvar , StockTransformer :: Identity ) ;
1615+
16141616evaluator ! ( Cusum , lcf:: Cusum , StockTransformer :: Identity ) ;
16151617
16161618evaluator ! ( Eta , lcf:: Eta , StockTransformer :: Identity ) ;
@@ -1673,6 +1675,12 @@ quantile : positive float
16731675
16741676evaluator ! ( Kurtosis , lcf:: Kurtosis , StockTransformer :: Arcsinh ) ;
16751677
1678+ evaluator ! (
1679+ LaflerKinmanStringLength ,
1680+ lcf:: LaflerKinmanStringLength ,
1681+ StockTransformer :: Identity
1682+ ) ;
1683+
16761684evaluator ! ( LinearFit , lcf:: LinearFit , StockTransformer :: Identity ) ;
16771685
16781686evaluator ! ( LinearTrend , lcf:: LinearTrend , StockTransformer :: Identity ) ;
@@ -1932,6 +1940,7 @@ impl Periodogram {
19321940 freqs : Option < Bound < PyAny > > ,
19331941 fast : Option < bool > ,
19341942 features : Option < Bound < PyAny > > ,
1943+ phase_features : Option < Bound < PyAny > > ,
19351944 normalization : PeriodogramNormalization ,
19361945 ) -> PyResult < ( LcfPeriodogram < f32 > , LcfPeriodogram < f64 > ) > {
19371946 let mut eval_f32 = match peaks {
@@ -2065,8 +2074,16 @@ impl Periodogram {
20652074 if let Some ( features) = features {
20662075 for x in features. try_iter ( ) ? {
20672076 let py_feature = x?. cast :: < PyFeatureEvaluator > ( ) ?. borrow ( ) ;
2068- eval_f32. add_feature ( py_feature. feature_evaluator_f32 . clone ( ) ) ;
2069- eval_f64. add_feature ( py_feature. feature_evaluator_f64 . clone ( ) ) ;
2077+ eval_f32. add_spectrum_feature ( py_feature. feature_evaluator_f32 . clone ( ) ) ;
2078+ eval_f64. add_spectrum_feature ( py_feature. feature_evaluator_f64 . clone ( ) ) ;
2079+ }
2080+ }
2081+
2082+ if let Some ( phase_features) = phase_features {
2083+ for x in phase_features. try_iter ( ) ? {
2084+ let py_feature = x?. cast :: < PyFeatureEvaluator > ( ) ?. borrow ( ) ;
2085+ eval_f32. add_phase_feature ( py_feature. feature_evaluator_f32 . clone ( ) ) ;
2086+ eval_f64. add_phase_feature ( py_feature. feature_evaluator_f64 . clone ( ) ) ;
20702087 }
20712088 }
20722089
@@ -2127,6 +2144,7 @@ impl Periodogram {
21272144 freqs = None ,
21282145 fast = true ,
21292146 features = None ,
2147+ phase_features = None ,
21302148 normalization = "psd" ,
21312149 transform = None ,
21322150 ) ) ]
@@ -2138,6 +2156,7 @@ impl Periodogram {
21382156 freqs : Option < Bound < PyAny > > ,
21392157 fast : Option < bool > ,
21402158 features : Option < Bound < PyAny > > ,
2159+ phase_features : Option < Bound < PyAny > > ,
21412160 normalization : & str ,
21422161 transform : Option < Bound < PyAny > > ,
21432162 ) -> PyResult < ( Self , PyFeatureEvaluator ) > {
@@ -2155,6 +2174,7 @@ impl Periodogram {
21552174 freqs,
21562175 fast,
21572176 features,
2177+ phase_features,
21582178 normalization,
21592179 ) ?;
21602180 Ok ( (
@@ -2238,9 +2258,14 @@ fast : bool or None, optional
22382258 Use "Fast" (approximate and FFT-based) or direct periodogram algorithm,
22392259 default is {default_fast}
22402260features : iterable or None, optional
2241- Features to extract from periodogram considering it as a time-series,
2242- default is None which means no additional features
2243- Features to extract from periodogram considering it as a time-series
2261+ Features extracted from the periodogram power spectrum, treating it as a
2262+ time-series (frequency as time, power as magnitude).
2263+ Default is None which means no additional spectrum features.
2264+ phase_features : iterable or None, optional
2265+ Features to extract from the light curve phase-folded at the best period.
2266+ Phase runs from 0 to 1 with phase 0 at the magnitude minimum.
2267+ Feature names are prefixed with `period_folded_`.
2268+ Default is None which means no phase features.
22442269normalization : str, optional
22452270 Normalization of the periodogram power. Affects `power()`,
22462271 `freq_power()`, and feature extraction via `__call__()`.
0 commit comments