Skip to content

Commit 59c5345

Browse files
committed
Typo
1 parent b0be0c8 commit 59c5345

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

pabutools/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def gini_coefficient(values: Iterable[Numeric]) -> Numeric:
8989
for v in values:
9090
if v < 0:
9191
raise ValueError(
92-
"Negative values not supported by gini coefficient implementation."
92+
"Negative values not supported by Gini coefficient implementation."
9393
)
9494
if all_nul and v > 0:
9595
all_nul = False

tests/test_analysis.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@
2929

3030

3131
class TestAnalysis(TestCase):
32+
33+
def test_gini(self):
34+
self.assertEqual(gini_coefficient([100 for _ in range(100)]), 0)
35+
self.assertEqual(gini_coefficient([0, 0, 0, 0, 0, 0, 0, 0, 0, 1]), 1)
36+
3237
def test_satisfaction_properties(self):
3338
projects = [Project(str(i), 10 + i) for i in range(10)]
3439
instance = Instance(projects, budget_limit=90)

0 commit comments

Comments
 (0)