summaryrefslogtreecommitdiff
path: root/src/python/gudhi/cubical_complex.pyx
diff options
context:
space:
mode:
authorROUVREAU Vincent <vincent.rouvreau@inria.fr>2020-01-14 14:40:41 +0100
committerROUVREAU Vincent <vincent.rouvreau@inria.fr>2020-01-14 14:40:41 +0100
commit587a845289a4e29014f67d4c3379b2b4d6b1f102 (patch)
tree6a43e1ce25342d9707db2362c9577dd680845b1d /src/python/gudhi/cubical_complex.pyx
parent88c30209fe58d29d24d5bba3c137cd5e5def29c5 (diff)
print errors to stderr
Diffstat (limited to 'src/python/gudhi/cubical_complex.pyx')
-rw-r--r--src/python/gudhi/cubical_complex.pyx9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/python/gudhi/cubical_complex.pyx b/src/python/gudhi/cubical_complex.pyx
index 92ff6411..28913a32 100644
--- a/src/python/gudhi/cubical_complex.pyx
+++ b/src/python/gudhi/cubical_complex.pyx
@@ -7,11 +7,13 @@
# Modification(s):
# - YYYY/MM Author: Description of the modification
+from __future__ import print_function
from cython cimport numeric
from libcpp.vector cimport vector
from libcpp.utility cimport pair
from libcpp.string cimport string
from libcpp cimport bool
+import sys
import os
import numpy as np
@@ -87,10 +89,11 @@ cdef class CubicalComplex:
if os.path.isfile(perseus_file):
self.thisptr = new Bitmap_cubical_complex_base_interface(str.encode(perseus_file))
else:
- print("file " + perseus_file + " not found.")
+ print("file " + perseus_file + " not found.", file=sys.stderr)
else:
print("CubicalComplex can be constructed from dimensions and "
- "top_dimensional_cells or from a Perseus-style file name.")
+ "top_dimensional_cells or from a Perseus-style file name.",
+ file=sys.stderr)
def __dealloc__(self):
if self.thisptr != NULL:
@@ -199,5 +202,5 @@ cdef class CubicalComplex:
intervals_result = self.pcohptr.intervals_in_dimension(dimension)
else:
print("intervals_in_dim function requires persistence function"
- " to be launched first.")
+ " to be launched first.", file=sys.stderr)
return np.array(intervals_result)