Skip to content

Commit

Permalink
Update error docs
Browse files Browse the repository at this point in the history
  • Loading branch information
fntneves committed Mar 25, 2017
1 parent 8353296 commit 5778005
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def run(self):

setup(
name="vania",
version="0.1.0",
version="0.1.1",
description="A module to fairly distribute objects among targets considering weights.",
license="MIT",
author="Hackathonners",
Expand Down
6 changes: 3 additions & 3 deletions vania/fair_distributor.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@ def validate(self):
def _validate(self):
if len(self._weights) != len(self._targets):
raise ValueError(
"The number of lines on the weights should match the targets' length")
"The amount of weight lines should match the amount of targets")

# All values should be positive
s = list(
dropwhile(lambda x: len(x) == len(self._objects), self._weights))
if len(s) != 0:
raise ValueError(
"The number of columns on the weights should match the objects' length")
"The amount of weight columns should match the amount of objects")
for lines in self._weights:
for i in lines:
if i < 0:
raise ValueError(
"All values on the weights should be positive")
"All weights must be positive")

def distribute(self, fairness=True, output=None):
"""
Expand Down

0 comments on commit 5778005

Please sign in to comment.