Skip to content

Commit ab6c74f

Browse files
committed
Replace CubicSpline by make_interp_spline k=3
1 parent 8773810 commit ab6c74f

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

pvlib/iam.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ def interp(aoi, theta_ref, iam_ref, method='linear', normalize=True):
470470
'''
471471
# Contributed by Anton Driesse (@adriesse), PV Performance Labs. July, 2019
472472

473-
from scipy.interpolate import CubicSpline, make_interp_spline
473+
from scipy.interpolate import make_interp_spline
474474

475475
# Scipy doesn't give the clearest feedback, so check number of points here.
476476
MIN_REF_VALS = {'linear': 2, 'quadratic': 3, 'cubic': 4, 1: 2, 2: 3, 3: 4}
@@ -499,7 +499,7 @@ def interpolator(x):
499499
return spline(x)
500500

501501
elif method == "cubic":
502-
spline = CubicSpline(theta_ref, iam_ref, extrapolate=True)
502+
spline = make_interp_spline(theta_ref, iam_ref, k=3)
503503

504504
def interpolator(x):
505505
return spline(x)

pvlib/spectrum/response.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import numpy as np
77
import pandas as pd
88
import scipy.constants
9-
from scipy.interpolate import CubicSpline
9+
from scipy.interpolate import make_interp_spline
1010

1111

1212
_PLANCK_BY_LIGHT_SPEED_OVER_ELEMENTAL_CHARGE_BY_BILLION = (
@@ -68,10 +68,9 @@ def get_example_spectral_response(wavelength=None):
6868
wavelength = np.arange(280, 1200 + resolution, resolution)
6969
x = SR_DATA[0]
7070
y = SR_DATA[1]
71-
spline = CubicSpline(
72-
x, y,
73-
extrapolate=False
74-
)
71+
spline = make_interp_spline(
72+
x, y, k=3)
73+
7574
values = spline(wavelength)
7675
values[(wavelength < x[0]) | (wavelength > x[-1])] = 0.0
7776

0 commit comments

Comments
 (0)