From 5405e1494dc6b4bffcea38a53568d348e44600f0 Mon Sep 17 00:00:00 2001 From: Shubham Pawar Date: Mon, 24 Mar 2025 14:11:53 +0530 Subject: [PATCH] Fix flake8-linter issues in PR #2401: resolve W293, E501, and E303 errors --- .../shading/plot_partial_module_shading_simple.py | 11 +++++++---- pvlib/iam.py | 4 +++- pvlib/spectrum/response.py | 1 - 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/examples/shading/plot_partial_module_shading_simple.py b/docs/examples/shading/plot_partial_module_shading_simple.py index 4d04926e8d..ffbc50b15b 100644 --- a/docs/examples/shading/plot_partial_module_shading_simple.py +++ b/docs/examples/shading/plot_partial_module_shading_simple.py @@ -180,10 +180,13 @@ def plot_curves(dfs, labels, title): def interpolate(df, i): x = np.flipud(df['i']) y = np.flipud(df['v']) - - # Create a spline interpolation with linear (k=1) and extrapolation (default behavior) - spline = make_interp_spline(x, y, k=1, bc_type='clamped') # Extrapolation is handled by default - + + # Create a spline interpolation with + # linear (k=1) and extrapolation (default behavior) + spline = make_interp_spline( + x, y, k=1, bc_type='clamped' + ) # Extrapolation is handled by default + return spline(i) diff --git a/pvlib/iam.py b/pvlib/iam.py index ba03dd60b7..8364d0e67e 100644 --- a/pvlib/iam.py +++ b/pvlib/iam.py @@ -487,7 +487,9 @@ def interp(aoi, theta_ref, iam_ref, method='linear', normalize=True): theta_ref = np.asarray(theta_ref) iam_ref = np.asarray(iam_ref) - interpolator = make_interp_spline(theta_ref, iam_ref, k=method, bc_type='clamped') + interpolator = make_interp_spline( + theta_ref, iam_ref, k=method, bc_type='clamped' + ) aoi_input = aoi aoi = np.asanyarray(aoi) diff --git a/pvlib/spectrum/response.py b/pvlib/spectrum/response.py index 2e374c1882..15119f2288 100644 --- a/pvlib/spectrum/response.py +++ b/pvlib/spectrum/response.py @@ -72,7 +72,6 @@ def get_example_spectral_response(wavelength=None): interpolator = make_interp_spline(x_data, y_data, k=3, bc_type='clamped') - sr = pd.Series(data=interpolator(wavelength), index=wavelength) sr.index.name = 'wavelength'