for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
import numpy as np
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
class SomeClass: def some_method(self): """Do x and return foo."""
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.
from numpy import log10
from math import log10 as mlog10
import scipy.interpolate
class LogLogInterpolator(object): # pragma: no cover
def __init__(self, x, y, k=2):
y = y.astype(np.float64)
y = np.clip(y, 2 * np.finfo(np.float64).tiny, None)
finfo
tiny
This check looks for calls to members that are non-existent. These calls will fail.
The member could have been renamed or removed.
logx = log10(x)
logy = log10(y)
self._interp = scipy.interpolate.InterpolatedUnivariateSpline(logx, logy, k=k)
def __call__(self, x):
This check looks for invalid names for a range of different identifiers.
You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.
If your project includes a Pylint configuration file, the settings contained in that file take precedence.
To find out more about Pylint, please refer to their site.
return 10**self._interp(log10(x))
def integral(self, a, b, n_points=100, k=1):
# Make a second interpolator
xx = np.logspace(mlog10(a), mlog10(b), n_points)
yy = self.__call__(xx)
int_interp = scipy.interpolate.InterpolatedUnivariateSpline(xx, yy, k=k)
return int_interp.integral(a, b)
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.