torressa/cspy

Return None if no feasible path is found

Kuifje02 opened this issue · 2 comments

Hi David,

I have noticed that if no feasible path is found, the following exception is raised:

Exception: Please call the .run() method first

This can happen in at least two situations:

  • if min_res (or max_res) is too restrictive
  • when the algorithm did not have enough time to find a path (with time_limit)

I think it would be nice to return None (in bidirec.path/bidirec.total_cost, etc), instead of raising the Exception. This way the user would know that there is nothing wrong with his data, its just that there is no feasible path. Also the current exception may be misleading as the .run() method was called, but it was just not able to find a path successfully.

Thanks @Kuifje02!
It is pretty annoying, I'll get rid of it in the next version (working on it...)

Just committed some WIP 3048e8a for the new release.. Coming soon!