Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
fixes #338 by raising an error
Browse files Browse the repository at this point in the history
  • Loading branch information
chadi committed Aug 3, 2020
1 parent a280271 commit e942276
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions SEIR/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ def __init__(self, *, setup_name, geodata_file, mobility_file, popnodes_key, nod
if popnodes_key not in self.data:
raise ValueError(f"popnodes_key: {popnodes_key} does not correspond to a column in geodata.");
self.popnodes = self.data[popnodes_key].to_numpy() # population
if len(np.argwhere(self.popnodes == 0)):
raise ValueError(f"There are {len(np.argwhere(self.popnodes == 0))} nodes with population zero, this is not supported.")

print(self.popnodes)

# nodenames_key is the name of the column in geodata_file with geoids
if nodenames_key not in self.data:
Expand Down

0 comments on commit e942276

Please sign in to comment.