Skip to content
This repository was archived by the owner on Sep 4, 2021. It is now read-only.

Commit 8887769

Browse files
committed
handle solver fails in one_to_all mode
1 parent d15d031 commit 8887769

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

circuitscape/compute.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,11 @@ def one_to_all_module(self, g_map, poly_map, points_rc):
290290
Compute.logger.warning('Solver failed for at least one focal node. Focal nodes with failed solves will be marked with value of -777 in output resistance list.')
291291

292292
resistance_vector[pt_idx,0] = src
293-
resistance_vector[pt_idx,1] = resistance
294-
295293
if solver_failed==True:
296294
solver_failed_somewhere = True
295+
resistance_vector[pt_idx,1] = -777
296+
else:
297+
resistance_vector[pt_idx,1] = resistance
297298

298299
(hours,mins,_secs) = ComputeBase.elapsed_time(last_write_time)
299300
if mins > 2 or hours > 0:

0 commit comments

Comments
 (0)