Skip to content

Commit

Permalink
Forgot to remove test code before comitting
Browse files Browse the repository at this point in the history
Deleting method I added to interpolation.py during debugging.
  • Loading branch information
mnwhite committed Sep 3, 2024
1 parent 732373e commit 61883b7
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions HARK/interpolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2718,37 +2718,6 @@ def _evaluate(self, x, y):
) + alpha * self.xInterpolators[i](x[c])
return f

def _secret(self, x, y):
"""
IT'S A SECRET TO EVERYBODY
"""
if _isscalar(x):
y_pos = max(min(np.searchsorted(self.y_list, y), self.y_n - 1), 1)
alpha = (y - self.y_list[y_pos - 1]) / (
self.y_list[y_pos] - self.y_list[y_pos - 1]
)
f = (1 - alpha) * self.xInterpolators[y_pos - 1](
x
) + alpha * self.xInterpolators[y_pos](x)
else:
m = len(x)
y_pos = np.searchsorted(self.y_list, y)
y_pos[y_pos > self.y_n - 1] = self.y_n - 1
y_pos[y_pos < 1] = 1
f = np.zeros(m) + np.nan
if y.size > 0:
for i in range(1, self.y_n):
c = y_pos == i
if np.any(c):
alpha = (y[c] - self.y_list[i - 1]) / (
self.y_list[i] - self.y_list[i - 1]
)
# f[c] = i
f[c] = self.xInterpolators[i](x[c])
# f[c] = self.xInterpolators[i - 1](x[c])
# f[c] = self.xInterpolators[i](x[c]) - self.xInterpolators[i - 1](x[c])
return f

def _derX(self, x, y):
"""
Returns the derivative with respect to x of the interpolated function
Expand Down

0 comments on commit 61883b7

Please sign in to comment.