From bb800d9cf78a4d222fb941cb4fda99e635b53114 Mon Sep 17 00:00:00 2001 From: "Perry, Kirsten" Date: Thu, 8 Feb 2024 11:03:58 -0700 Subject: [PATCH] fixed pep8 issues --- .../pvfleets-irradiance-qa.py | 7 ++++--- .../pvfleets-qa-pipeline/pvfleets-power-qa.py | 17 +++++++++-------- .../pvfleets-temperature-qa.py | 7 ++++--- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/docs/examples/pvfleets-qa-pipeline/pvfleets-irradiance-qa.py b/docs/examples/pvfleets-qa-pipeline/pvfleets-irradiance-qa.py index 381a2e27..fdc01984 100644 --- a/docs/examples/pvfleets-qa-pipeline/pvfleets-irradiance-qa.py +++ b/docs/examples/pvfleets-qa-pipeline/pvfleets-irradiance-qa.py @@ -34,7 +34,7 @@ pvanalytics_dir = pathlib.Path(pvanalytics.__file__).parent file = pvanalytics_dir / 'data' / 'system_15_poa_irradiance.parquet' time_series = pd.read_parquet(file) -time_series.set_index('measured_on', inplace = True) +time_series.set_index('measured_on', inplace=True) time_series.index = pd.to_datetime(time_series.index) time_series = time_series['poa_irradiance__484'] latitude = 39.7406 @@ -55,7 +55,8 @@ # Now, let's run basic data checks to identify stale and abnormal/outlier # data in the time series. Basic data checks include the following steps: # -# 1) Flatlined/stale data periods (:py:func:`pvanalytics.quality.gaps.stale_values_round`) +# 1) Flatlined/stale data periods +# (:py:func:`pvanalytics.quality.gaps.stale_values_round`) # 2) Negative irradiance data # 3) "Abnormal" data periods, which are defined as less than 10% of the # daily time series mean OR greater than 1300 @@ -134,7 +135,7 @@ # Filter the time series, taking out all of the issues issue_mask = ((~stale_data_mask) & (~negative_mask) & (~erroneous_mask) & (~out_of_bounds_mask) & (~zscore_outlier_mask)) -time_series =time_series[issue_mask] +time_series = time_series[issue_mask] time_series = time_series.asfreq(data_freq) # Visualize the time series post-filtering diff --git a/docs/examples/pvfleets-qa-pipeline/pvfleets-power-qa.py b/docs/examples/pvfleets-qa-pipeline/pvfleets-power-qa.py index 14f99c7c..8790a4de 100644 --- a/docs/examples/pvfleets-qa-pipeline/pvfleets-power-qa.py +++ b/docs/examples/pvfleets-qa-pipeline/pvfleets-power-qa.py @@ -37,7 +37,7 @@ pvanalytics_dir = pathlib.Path(pvanalytics.__file__).parent file = pvanalytics_dir / 'data' / 'system_50_ac_power_2_full_DST.parquet' time_series = pd.read_parquet(file) -time_series.set_index('measured_on', inplace = True) +time_series.set_index('measured_on', inplace=True) time_series.index = pd.to_datetime(time_series.index) time_series = time_series['ac_power_2'] latitude = 39.7406 @@ -58,7 +58,8 @@ # Now, let's run basic data checks to identify stale and abnormal/outlier # data in the time series. Basic data checks include the following steps: # -# 1) Flatlined/stale data periods (:py:func:`pvanalytics.quality.gaps.stale_values_round`) +# 1) Flatlined/stale data periods +# (:py:func:`pvanalytics.quality.gaps.stale_values_round`) # 2) Negative data # 3) "Abnormal" data periods, which are defined as less than 10% of the # daily time series mean @@ -130,7 +131,7 @@ # Filter the time series, taking out all of the issues issue_mask = ((~stale_data_mask) & (~negative_mask) & - (~erroneous_mask) & (~zscore_outlier_mask)) + (~erroneous_mask) & (~zscore_outlier_mask)) time_series = time_series[issue_mask] time_series = time_series.asfreq(data_freq) @@ -243,10 +244,10 @@ # Estimate the time shifts by comparing the modelled midday point to the # measured midday point. is_shifted, time_shift_series = shifts_ruptures(modeled_midday_series_daily, - midday_series_daily, - period_min=15, - shift_min=15, - zscore_cutoff=1.5) + midday_series_daily, + period_min=15, + shift_min=15, + zscore_cutoff=1.5) # Create a midday difference series between modeled and measured midday, to # visualize time shifts. First, resample each time series to daily frequency, @@ -432,7 +433,7 @@ # PVLib: :py:func:`pvlib.iotools.get_psm3` file = pvanalytics_dir / 'data' / 'system_50_ac_power_2_full_DST_psm3.parquet' psm3 = pd.read_parquet(file) -psm3.set_index('index', inplace = True) +psm3.set_index('index', inplace=True) psm3.index = pd.to_datetime(psm3.index) psm3 = psm3.reindex(pd.date_range(psm3.index[0], diff --git a/docs/examples/pvfleets-qa-pipeline/pvfleets-temperature-qa.py b/docs/examples/pvfleets-qa-pipeline/pvfleets-temperature-qa.py index 2b43bc63..c45aa6a2 100644 --- a/docs/examples/pvfleets-qa-pipeline/pvfleets-temperature-qa.py +++ b/docs/examples/pvfleets-qa-pipeline/pvfleets-temperature-qa.py @@ -28,9 +28,9 @@ # This data is timezone-localized. pvanalytics_dir = pathlib.Path(pvanalytics.__file__).parent -file = "C:/Users/kperry/Documents/source/repos/pvanalytics/pvanalytics/data/system_4_module_temperature.parquet"#pvanalytics_dir / 'data' / 'system_4_module_temperature.parquet' +file = pvanalytics_dir / 'data' / 'system_4_module_temperature.parquet' time_series = pd.read_parquet(file) -time_series.set_index('index', inplace = True) +time_series.set_index('index', inplace=True) time_series.index = pd.to_datetime(time_series.index) time_series = time_series['module_temp_1'] latitude = 39.7406 @@ -54,7 +54,8 @@ # Now, let's run basic data checks to identify stale and abnormal/outlier # data in the time series. Basic data checks include the following steps: # -# 1) Flatlined/stale data periods (:py:func:`pvanalytics.quality.gaps.stale_values_round`) +# 1) Flatlined/stale data periods +# (:py:func:`pvanalytics.quality.gaps.stale_values_round`) # 2) "Abnormal" data periods, which are out of the temperature limits of # -40 to 185 deg C. Additional checks based on thresholds are applied # depending on the type of temperature sensor (ambient or module)