Skip to content

Commit

Permalink
tidied up linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Witt-D committed Jul 24, 2023
1 parent eb21002 commit bbe94ce
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions gusto/numerical_integrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
class NumericalIntegral(object):
"""
A class for numerically evaluating and tabulating some 1D integral.
:arg lower_bound: lower bound of integral
:arg upper_bound: upper_bound of integral
:arg num_points: number of points to tabulate integral at
Args:
lower_bound(float): lower bound of integral
upper_bound(float): upper bound of integral
num_points(float): number of points to tabulate integral at
"""
def __init__(self, lower_bound, upper_bound, num_points=500):

Expand All @@ -22,8 +24,9 @@ def __init__(self, lower_bound, upper_bound, num_points=500):
def tabulate(self, expression):
"""
Tabulate some integral expression using Simpson's rule.
:arg expression: a function representing the integrand to be evaluated.
Should take a numpy array as an argument.
Args:
expression (func): a function representing the integrand to be
evaluated. should take a numpy array as an argument.
"""

self.cumulative = np.zeros_like(self.x)
Expand All @@ -45,8 +48,9 @@ def tabulate(self, expression):
def evaluate_at(self, points):
"""
Evaluates the integral at some point using linear interpolation.
:arg points: the point value, or array of point values to evaluate
the integral at.
Args:
points (float or iter) the point value, or array of point values to
evaluate the integral at.
"""
# Do linear interpolation from tabulated values
if not self.tabulated:
Expand Down

0 comments on commit bbe94ce

Please sign in to comment.