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

Commit de8959c

Browse files
committed
fixed error when only 1 incl/excl pair specified.
Numpy reads file as a vector in that case and it needed to be reshaped. Had missed it out while reading incl/excl pairs. Seems to be fine at other places.
1 parent b8c5d5a commit de8959c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGES.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
v4.0.1, 28 Mar 2013 -- Stable version with bug fixes and user interface tweaks.
1+
v4.0.3, 06 Apr 2014 -- Fixed batch mode for GUI
2+
v4.0.1, 28 Mar 2014 -- Stable version with bug fixes and user interface tweaks.
23
v4.0.0-beta, 25 Nov 2013 -- Beta release

circuitscape/io.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,10 @@ def read_included_pairs(filename):
457457
mode = string.split(f.readline())[1]
458458
pair_list = np.loadtxt(filename, skiprows=1, dtype='int32')
459459
point_ids = np.unique(pair_list)
460+
if len(pair_list.shape) == 1:
461+
pl = np.zeros((1,2))
462+
pl[0,:] = pair_list
463+
pair_list = pl
460464

461465
I = pair_list[:,0]
462466
J = pair_list[:,1]

0 commit comments

Comments
 (0)