wtclean 0.2.8__tar.gz → 0.2.26__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {wtclean-0.2.8/wtclean.egg-info → wtclean-0.2.26}/PKG-INFO +1 -1
- {wtclean-0.2.8 → wtclean-0.2.26}/setup.py +1 -1
- {wtclean-0.2.8 → wtclean-0.2.26}/test/test_daily_anomaly_detection.py +1 -21
- {wtclean-0.2.8 → wtclean-0.2.26}/wtclean/__init__.py +1 -1
- {wtclean-0.2.8 → wtclean-0.2.26}/wtclean/modules/daily_anomaly_detection.py +3 -8
- {wtclean-0.2.8 → wtclean-0.2.26/wtclean.egg-info}/PKG-INFO +1 -1
- {wtclean-0.2.8 → wtclean-0.2.26}/LICENSE +0 -0
- {wtclean-0.2.8 → wtclean-0.2.26}/MANIFEST.in +0 -0
- {wtclean-0.2.8 → wtclean-0.2.26}/README.md +0 -0
- {wtclean-0.2.8 → wtclean-0.2.26}/requirements.txt +0 -0
- {wtclean-0.2.8 → wtclean-0.2.26}/setup.cfg +0 -0
- {wtclean-0.2.8 → wtclean-0.2.26}/test/test_filters.py +0 -0
- {wtclean-0.2.8 → wtclean-0.2.26}/test/test_power_curve.py +0 -0
- {wtclean-0.2.8 → wtclean-0.2.26}/test/test_power_curve_filtering.py +0 -0
- {wtclean-0.2.8 → wtclean-0.2.26}/wtclean/modules/__init__.py +0 -0
- {wtclean-0.2.8 → wtclean-0.2.26}/wtclean/modules/power_curve_filtering.py +0 -0
- {wtclean-0.2.8 → wtclean-0.2.26}/wtclean/power_curve/__init__.py +0 -0
- {wtclean-0.2.8 → wtclean-0.2.26}/wtclean/power_curve/functions.py +0 -0
- {wtclean-0.2.8 → wtclean-0.2.26}/wtclean/power_curve/parametric_forms.py +0 -0
- {wtclean-0.2.8 → wtclean-0.2.26}/wtclean/power_curve/parametric_optimize.py +0 -0
- {wtclean-0.2.8 → wtclean-0.2.26}/wtclean/utils/__init__.py +0 -0
- {wtclean-0.2.8 → wtclean-0.2.26}/wtclean/utils/binning_function.py +0 -0
- {wtclean-0.2.8 → wtclean-0.2.26}/wtclean/utils/filters.py +0 -0
- {wtclean-0.2.8 → wtclean-0.2.26}/wtclean/utils/machine_parameter_estimation.py +0 -0
- {wtclean-0.2.8 → wtclean-0.2.26}/wtclean.egg-info/SOURCES.txt +0 -0
- {wtclean-0.2.8 → wtclean-0.2.26}/wtclean.egg-info/dependency_links.txt +0 -0
- {wtclean-0.2.8 → wtclean-0.2.26}/wtclean.egg-info/requires.txt +0 -0
- {wtclean-0.2.8 → wtclean-0.2.26}/wtclean.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: wtclean
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.26
|
|
4
4
|
Summary: Wind turbine SCADA power-curve data cleaning via iterative bin + MAD filtering
|
|
5
5
|
License: BSD-3-Clause
|
|
6
6
|
Keywords: wind-energy,wind-turbine,scada,power-curve,outlier-detection,data-cleaning
|
|
@@ -9,7 +9,7 @@ with open(os.path.join(HERE, "README.md"), "r", encoding="utf-8") as fh:
|
|
|
9
9
|
|
|
10
10
|
setuptools.setup(
|
|
11
11
|
name="wtclean",
|
|
12
|
-
version="0.2.
|
|
12
|
+
version="0.2.26",
|
|
13
13
|
description="Wind turbine SCADA power-curve data cleaning via iterative bin + MAD filtering",
|
|
14
14
|
long_description=long_description,
|
|
15
15
|
long_description_content_type="text/markdown",
|
|
@@ -84,27 +84,7 @@ class TestDailyAnomalyDetector(unittest.TestCase):
|
|
|
84
84
|
with self.assertRaises(ValueError):
|
|
85
85
|
_det(df, low_power_ratio=1.5)
|
|
86
86
|
with self.assertRaises(ValueError):
|
|
87
|
-
|
|
88
|
-
"ws", "pw", "ts", df,
|
|
89
|
-
cut_in_speed=0.0, rated_wind_speed=RATED_WS, rated_power=RATED_PWR
|
|
90
|
-
)
|
|
91
|
-
|
|
92
|
-
def test_output_columns(self):
|
|
93
|
-
df, _ = _synth()
|
|
94
|
-
normal, abnormal = _det(df).detect()
|
|
95
|
-
self.assertEqual(list(normal.columns), list(df.columns))
|
|
96
|
-
self.assertEqual(list(abnormal.columns), list(df.columns))
|
|
97
|
-
for frame in (normal, abnormal):
|
|
98
|
-
for col in ("_row_id", "_date", "_resid"):
|
|
99
|
-
self.assertNotIn(col, frame.columns)
|
|
100
|
-
|
|
101
|
-
def test_single_day_not_all_abnormal(self):
|
|
102
|
-
df, _ = _synth(days=1)
|
|
103
|
-
det = _det(df)
|
|
104
|
-
normal, abnormal = det.detect()
|
|
105
|
-
self.assertGreater(len(normal), 0)
|
|
106
|
-
self.assertEqual(len(normal) + len(abnormal), len(df))
|
|
107
|
-
self.assertEqual(det.abnormal_days_, set())
|
|
87
|
+
_det(df, bin_width=0)
|
|
108
88
|
|
|
109
89
|
def test_auto_estimate_params(self):
|
|
110
90
|
df, _ = _synth()
|
|
@@ -106,7 +106,7 @@ class DailyAnomalyDetector:
|
|
|
106
106
|
|
|
107
107
|
Returns:
|
|
108
108
|
按行划分原始 ``df`` 的正常 / 异常两个子集;被判异常的天可通过
|
|
109
|
-
|
|
109
|
+
|
|
110
110
|
"""
|
|
111
111
|
work = self.df.copy()
|
|
112
112
|
work["_row_id"] = np.arange(len(work))
|
|
@@ -151,8 +151,6 @@ class DailyAnomalyDetector:
|
|
|
151
151
|
analysis_mask &= ws <= cut_out_eff
|
|
152
152
|
|
|
153
153
|
if not analysis_mask.any():
|
|
154
|
-
self.normal_days_ = set()
|
|
155
|
-
self.abnormal_days_ = set(work["_date"].dropna())
|
|
156
154
|
return self.df.iloc[0:0].copy(), self.df.copy()
|
|
157
155
|
|
|
158
156
|
# ---- 整机基准曲线 ----
|
|
@@ -182,8 +180,6 @@ class DailyAnomalyDetector:
|
|
|
182
180
|
day_stats = raw_day_stats.loc[count_mask]
|
|
183
181
|
|
|
184
182
|
if day_stats.empty:
|
|
185
|
-
self.normal_days_ = set()
|
|
186
|
-
self.abnormal_days_ = set(work["_date"].dropna())
|
|
187
183
|
return self.df.iloc[0:0].copy(), self.df.copy()
|
|
188
184
|
|
|
189
185
|
median_resid = day_stats["median"].median()
|
|
@@ -192,9 +188,7 @@ class DailyAnomalyDetector:
|
|
|
192
188
|
median_resid - k * mad_resid, median_resid + k * mad_resid
|
|
193
189
|
)
|
|
194
190
|
normal_dates = set(day_stats.index[normal_mask])
|
|
195
|
-
|
|
196
|
-
self.abnormal_days_ = set(work["_date"].dropna()) - normal_dates
|
|
197
|
-
|
|
191
|
+
|
|
198
192
|
normal_row_ids = clean_df.loc[
|
|
199
193
|
clean_df["_date"].isin(normal_dates), "_row_id"
|
|
200
194
|
]
|
|
@@ -202,3 +196,4 @@ class DailyAnomalyDetector:
|
|
|
202
196
|
normal_df = work.loc[is_normal, self.df.columns].copy()
|
|
203
197
|
abnormal_df = work.loc[~is_normal, self.df.columns].copy()
|
|
204
198
|
return normal_df, abnormal_df
|
|
199
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: wtclean
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.26
|
|
4
4
|
Summary: Wind turbine SCADA power-curve data cleaning via iterative bin + MAD filtering
|
|
5
5
|
License: BSD-3-Clause
|
|
6
6
|
Keywords: wind-energy,wind-turbine,scada,power-curve,outlier-detection,data-cleaning
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|