diff --git a/wafo/covariance/estimation.py b/wafo/covariance/estimation.py index 1a2a195..c058ad2 100644 --- a/wafo/covariance/estimation.py +++ b/wafo/covariance/estimation.py @@ -123,10 +123,10 @@ class CovarianceEstimator(object): except Exception: x = timeseries[:, 1:].flatten('F') dt = sampling_period(timeseries[:, 0]) - if not (self.dt is None): + if self.dt is not None: dt = self.dt - if not (self.tr is None): + if self.tr is not None: x = self.tr.dat2gauss(x) n = len(x) diff --git a/wafo/stats/tests/test_distributions.py b/wafo/stats/tests/test_distributions.py index 9025317..b436f1a 100644 --- a/wafo/stats/tests/test_distributions.py +++ b/wafo/stats/tests/test_distributions.py @@ -1732,7 +1732,7 @@ class TestNct(TestCase): [0.00153078, 0.00291093, 0.00525206, 0.00900815]]) assert_allclose(res, expected, rtol=1e-5) - def text_variance_gh_issue_2401(self): + def test_variance_gh_issue_2401(self): # Computation of the variance of a non-central t-distribution resulted # in a TypeError: ufunc 'isinf' not supported for the input types, # and the inputs could not be safely coerced to any supported types diff --git a/wafo/transform/models.py b/wafo/transform/models.py index 3efe47c..831ad0c 100644 --- a/wafo/transform/models.py +++ b/wafo/transform/models.py @@ -219,7 +219,7 @@ class TrHermite(TrCommon2): return def check_forward(self, x): - if not (self._x_limit is None): + if self._x_limit is not None: x00 = self._x_limit txt2 = 'for the given interval x = [%g, %g]' % (x[0], x[-1]) @@ -306,7 +306,7 @@ class TrHermite(TrCommon2): # Km1 = np.sqrt(1.+2.*c3**2+6*c4**2) # q0 = x0**3-1.5*b1*(x0+xn*Km1) # q0 = x0**3-1.5*b1*(x0+xn) - if not (self._x_limit is None): # % Three real roots + if self._x_limit is not None: # % Three real roots d = sqrt(-p1) theta1 = arccos(-q0 / d ** 3) / 3 th2 = np.r_[0, -2 * pi / 3, 2 * pi / 3]