From 429521f4d9be87f3d82db482f3f15af13dbbe7bf Mon Sep 17 00:00:00 2001 From: Jeffrey Finkelstein Date: Fri, 16 Feb 2024 22:34:12 -0500 Subject: [PATCH] Support more recent version of numpy --- goftests/__init__.py | 6 +++--- goftests/test.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/goftests/__init__.py b/goftests/__init__.py index 7ff9191..83a0568 100644 --- a/goftests/__init__.py +++ b/goftests/__init__.py @@ -114,7 +114,7 @@ def multinomial_goodness_of_fit( if p > 0: mean = total_count * p variance = total_count * p * (1 - p) - assert variance > 1,\ + assert variance > 1, \ 'WARNING goodness of fit is inaccurate; use more samples' chi_squared += (c - mean) ** 2 / variance dof += 1 @@ -139,8 +139,8 @@ def unif01_goodness_of_fit(samples, plot=False): assert samples.max() <= 1.0 bin_count = int(round(len(samples) ** 0.333)) assert bin_count >= 7, 'WARNING imprecise test, use more samples' - probs = numpy.ones(bin_count, dtype=numpy.float) / bin_count - counts = numpy.zeros(bin_count, dtype=numpy.int) + probs = numpy.ones(bin_count, dtype=float) / bin_count + counts = numpy.zeros(bin_count, dtype=int) for sample in samples: counts[min(bin_count - 1, int(bin_count * sample))] += 1 return multinomial_goodness_of_fit(probs, counts, len(samples), plot=plot) diff --git a/goftests/test.py b/goftests/test.py index c8f1f90..6d010a3 100644 --- a/goftests/test.py +++ b/goftests/test.py @@ -542,9 +542,9 @@ class TestGeneralizedHalfLogistic(ContinuousTestBase, TestCase): dist = scipy.stats.genhalflogistic -class TestGilbrat(ContinuousTestBase, TestCase): +class TestGibrat(ContinuousTestBase, TestCase): - dist = scipy.stats.gilbrat + dist = scipy.stats.gibrat class TestGompertz(ContinuousTestBase, TestCase):