Skip to content

Commit

Permalink
ran python 2to3 tool on Python test scripts, OK
Browse files Browse the repository at this point in the history
  • Loading branch information
stivalaa committed Dec 14, 2021
1 parent 1b16ad0 commit 185523a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 0 additions & 2 deletions TestChangeStatsDirected/README
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ polblogs_test_results_baseline.txt is the output from
PNet code to compare output with as a regression test,
which is what run_test_polblogs.sh does.

Note python scripts all require Python 2 (and NOT Python 3,
which is not backward compatibile with Python 2).

ADS
Mon, Apr 30, 2018 1:03:02 PM
Expand Down
4 changes: 2 additions & 2 deletions TestChangeStatsDirected/checkSetFunctions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python3
##############################################################################
#
# checkSetFunctions.py - verify set similarity (Jaccard) results
Expand Down Expand Up @@ -88,7 +88,7 @@ def main():
sim = float(sim)
vsim = jaccard_index(setlist[i], setlist[j])
if (abs(sim - vsim) > 1e-05):
print 'FAIL',i,j,sim,vsim
print('FAIL',i,j,sim,vsim)
exitcode = -1

sys.exit(exitcode)
Expand Down
6 changes: 3 additions & 3 deletions TestChangeStatsDirected/genRandomNodeNums.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python3
##############################################################################
#
# genRandomNodeNums.py - generate random continuous attributes
Expand Down Expand Up @@ -67,8 +67,8 @@ def main():
num_pairs = int(args[0])
N = int(args[1])

for i in xrange(num_pairs):
nodepair = random.sample(xrange(N), 2)
for i in range(num_pairs):
nodepair = random.sample(range(N), 2)
sys.stdout.write("%d %d\n" % (nodepair[0], nodepair[1]))


Expand Down
2 changes: 1 addition & 1 deletion TestChangeStatsDirected/run_test_sets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ cat ${INPUT} | cut -d' ' -f1 > ${TMP_INPUT}
echo "Running tests on set parsing and set similarity functions..."

time ./testSetFunctions ${TMP_INPUT} > ${OUTPUT}
python2 ./checkSetFunctions.py ${TMP_INPUT} ${OUTPUT} > ${CHECK_OUTPUT}
python3 ./checkSetFunctions.py ${TMP_INPUT} ${OUTPUT} > ${CHECK_OUTPUT}

if [ $? -eq 0 ]; then
echo
Expand Down

0 comments on commit 185523a

Please sign in to comment.