From 8eceda2c97cc4034f1947f5b069b3594e3c696cb Mon Sep 17 00:00:00 2001 From: Serge Rey Date: Thu, 16 Jan 2025 13:19:14 -0800 Subject: [PATCH] Test zero within region inequality --- inequality/tests/test_theil.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/inequality/tests/test_theil.py b/inequality/tests/test_theil.py index 97c1b0d8..e491d14b 100644 --- a/inequality/tests/test_theil.py +++ b/inequality/tests/test_theil.py @@ -47,6 +47,12 @@ def test___init__(self): ] ), ) + y = numpy.array([0,0,0,10,10,10]) + regions = numpy.array([0,0,0,1,1,1]) + theil_d = TheilD(y, regions) + numpy.testing.assert_almost_equal(theil_d.T, 0.6931471805599453) + numpy.testing.assert_almost_equal(theil_d.bg, 0.6931471805599453) + numpy.testing.assert_almost_equal(theil_d.wg, 0) class TestTheilDSim: