Skip to content

Commit

Permalink
stderr printing errors, changed function call
Browse files Browse the repository at this point in the history
  • Loading branch information
itsmeludo committed Nov 21, 2016
1 parent 783c2c3 commit 62e27ab
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions phyloselect.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ def get_cmd():
params = parser.parse_args()

if params.interactive and not params.performtsne:
print("Error, interactive mode (--interactive) requires tsne (-t)", file=sys.stderr)
#print("Error, interactive mode (--interactive) requires tsne (-t)", file=sys.stderr)
sys.stderr.write("Error, interactive mode (--interactive) requires tsne (-t)")
sys.exit(1)
return params

Expand Down Expand Up @@ -112,7 +113,8 @@ def find_clusters(data, method, kwargs):
clusterer.fit(data)
labels = clusterer.labels_
else:
print("Error, unknown method {}".format(method), file=sys.stderr)
#print("Error, unknown method {}".format(method), file=sys.stderr)
sys.stderr.write("Error, unknown method {}".format(method))
return labels

def plot_labels(data, labels, algorithm, output):
Expand Down Expand Up @@ -250,7 +252,8 @@ def main():
s = matrix.shape[0]
n = np.sqrt(s)
if str(n).split(".")[1] != "0":
print("Error, weird shape for matrix {}".format(params.distmat), file=sys.stderr)
#print("Error, weird shape for matrix {}".format(params.distmat), file=sys.stderr)
sys.stderr.write("Error, weird shape for matrix {}".format(params.distmat))
sys.exit(1)
matrix = matrix.reshape((int(n), int(n)))
else:
Expand Down Expand Up @@ -373,4 +376,4 @@ def main():
ret = main()
sys.exit(ret)



0 comments on commit 62e27ab

Please sign in to comment.