Skip to content

Commit

Permalink
🐛 warning message fix
Browse files Browse the repository at this point in the history
  • Loading branch information
GiulioRossetti committed May 30, 2019
1 parent afa1767 commit ec67855
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ndlib/models/DiffusionModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@ def set_initial_status(self, configuration):
if 'fraction_infected' in self.params['model']:
number_of_initial_infected = len(self.graph.nodes()) * float(self.params['model']['fraction_infected'])
if number_of_initial_infected < 1:
warnings.warn('Graph with less than 100 nodes: a single node will be set as infected')
warnings.warn(
"The fraction_infected value is too low given the number of nodes of the selected graph: a "
"single node will be set as infected")
number_of_initial_infected = 1

available_nodes = [n for n in self.status if self.status[n] == 0]
Expand Down

1 comment on commit ec67855

@ggrrll
Copy link
Contributor

@ggrrll ggrrll commented on ec67855 May 31, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!
(from #102 )

Please sign in to comment.