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.
Files changed (28) hide show
  1. {wtclean-0.2.8/wtclean.egg-info → wtclean-0.2.26}/PKG-INFO +1 -1
  2. {wtclean-0.2.8 → wtclean-0.2.26}/setup.py +1 -1
  3. {wtclean-0.2.8 → wtclean-0.2.26}/test/test_daily_anomaly_detection.py +1 -21
  4. {wtclean-0.2.8 → wtclean-0.2.26}/wtclean/__init__.py +1 -1
  5. {wtclean-0.2.8 → wtclean-0.2.26}/wtclean/modules/daily_anomaly_detection.py +3 -8
  6. {wtclean-0.2.8 → wtclean-0.2.26/wtclean.egg-info}/PKG-INFO +1 -1
  7. {wtclean-0.2.8 → wtclean-0.2.26}/LICENSE +0 -0
  8. {wtclean-0.2.8 → wtclean-0.2.26}/MANIFEST.in +0 -0
  9. {wtclean-0.2.8 → wtclean-0.2.26}/README.md +0 -0
  10. {wtclean-0.2.8 → wtclean-0.2.26}/requirements.txt +0 -0
  11. {wtclean-0.2.8 → wtclean-0.2.26}/setup.cfg +0 -0
  12. {wtclean-0.2.8 → wtclean-0.2.26}/test/test_filters.py +0 -0
  13. {wtclean-0.2.8 → wtclean-0.2.26}/test/test_power_curve.py +0 -0
  14. {wtclean-0.2.8 → wtclean-0.2.26}/test/test_power_curve_filtering.py +0 -0
  15. {wtclean-0.2.8 → wtclean-0.2.26}/wtclean/modules/__init__.py +0 -0
  16. {wtclean-0.2.8 → wtclean-0.2.26}/wtclean/modules/power_curve_filtering.py +0 -0
  17. {wtclean-0.2.8 → wtclean-0.2.26}/wtclean/power_curve/__init__.py +0 -0
  18. {wtclean-0.2.8 → wtclean-0.2.26}/wtclean/power_curve/functions.py +0 -0
  19. {wtclean-0.2.8 → wtclean-0.2.26}/wtclean/power_curve/parametric_forms.py +0 -0
  20. {wtclean-0.2.8 → wtclean-0.2.26}/wtclean/power_curve/parametric_optimize.py +0 -0
  21. {wtclean-0.2.8 → wtclean-0.2.26}/wtclean/utils/__init__.py +0 -0
  22. {wtclean-0.2.8 → wtclean-0.2.26}/wtclean/utils/binning_function.py +0 -0
  23. {wtclean-0.2.8 → wtclean-0.2.26}/wtclean/utils/filters.py +0 -0
  24. {wtclean-0.2.8 → wtclean-0.2.26}/wtclean/utils/machine_parameter_estimation.py +0 -0
  25. {wtclean-0.2.8 → wtclean-0.2.26}/wtclean.egg-info/SOURCES.txt +0 -0
  26. {wtclean-0.2.8 → wtclean-0.2.26}/wtclean.egg-info/dependency_links.txt +0 -0
  27. {wtclean-0.2.8 → wtclean-0.2.26}/wtclean.egg-info/requires.txt +0 -0
  28. {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.8
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.8",
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
- DailyAnomalyDetector(
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()
@@ -1,4 +1,4 @@
1
- __version__ = "0.1.0"
1
+ __version__ = "0.2.26"
2
2
 
3
3
  from wtclean.modules.power_curve_filtering import PowerCurveFiltering
4
4
  from wtclean.modules.daily_anomaly_detection import DailyAnomalyDetector
@@ -106,7 +106,7 @@ class DailyAnomalyDetector:
106
106
 
107
107
  Returns:
108
108
  按行划分原始 ``df`` 的正常 / 异常两个子集;被判异常的天可通过
109
- ``self.abnormal_days_`` 查看。
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
- self.normal_days_ = normal_dates
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.8
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