[adios] 02/11: extra changes to py3.patch

Alastair McKinstry mckinstry at moszumanska.debian.org
Tue Mar 1 11:42:50 UTC 2016


This is an automated email from the git hooks/post-receive script.

mckinstry pushed a commit to tag debian/1.9.0-2
in repository adios.

commit 0dc63fa08f5df36af2cdcdcc45bed97f125229e5
Author: Alastair McKinstry <mckinstry at debian.org>
Date:   Mon Oct 26 17:39:14 2015 +0000

    extra changes to py3.patch
---
 debian/patches/py3.patch | 230 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 230 insertions(+)

diff --git a/debian/patches/py3.patch b/debian/patches/py3.patch
index c78a823..9723a72 100644
--- a/debian/patches/py3.patch
+++ b/debian/patches/py3.patch
@@ -327,3 +327,233 @@ Index: adios-1.9.0/wrappers/numpy/Makefile
  clean:
  	rm -rf build
  
+Index: adios-1.9.0/wrappers/numpy/adios_mpi.pyx
+===================================================================
+--- adios-1.9.0.orig/wrappers/numpy/adios_mpi.pyx
++++ adios-1.9.0/wrappers/numpy/adios_mpi.pyx
+@@ -4,6 +4,7 @@
+ .. moduleauthor:: Jong Choi <choij at ornl.gov>
+ """
+ 
++from __future__ import print_function
+ import numpy as np
+ cimport numpy as np
+ 
+@@ -346,7 +347,7 @@ cpdef int write_double (int64_t fd_p, ch
+ 
+ cpdef int read(int64_t fd_p, char * name, np.ndarray val):
+     assert val.flags.contiguous, 'Only contiguous arrays are supported.'
+-    print "Reading ... ", val.itemsize * val.size, "(bytes)"
++    print ("Reading ... ", val.itemsize * val.size, "(bytes)")
+     return adios_read(fd_p, name, <void *> val.data, val.itemsize * val.size)
+ 
+ cpdef int close(int64_t fd_p):
+@@ -497,24 +498,24 @@ cpdef np.dtype adios2npdtype(ADIOS_DATAT
+     return ntype
+ 
+ cdef printfile(ADIOS_FILE * f):
+-    print '%15s : %lu' % ('fh', f.fh)
+-    print '%15s : %d' % ('nvars', f.nvars)
+-    print '%15s : %s' % ('var_namelist', [f.var_namelist[i] for i in range(f.nvars)])
+-    print '%15s : %d' % ('nattrs', f.nattrs)
+-    print '%15s : %s' % ('attr_namelist', [f.attr_namelist[i] for i in range(f.nattrs)])
+-    print '%15s : %d' % ('current_step', f.current_step)       
+-    print '%15s : %d' % ('last_step', f.last_step)       
+-    print '%15s : %s' % ('path', f.path)
+-    print '%15s : %d' % ('endianness', f.endianness)       
+-    print '%15s : %d' % ('version', f.version)       
+-    print '%15s : %lu' % ('file_size', f.file_size)
++    print ('%15s : %lu' % ('fh', f.fh))
++    print ('%15s : %d' % ('nvars', f.nvars))
++    print ('%15s : %s' % ('var_namelist', [f.var_namelist[i] for i in range(f.nvars)]))
++    print ('%15s : %d' % ('nattrs', f.nattrs))
++    print ('%15s : %s' % ('attr_namelist', [f.attr_namelist[i] for i in range(f.nattrs)]))
++    print ('%15s : %d' % ('current_step', f.current_step))
++    print ('%15s : %d' % ('last_step', f.last_step))
++    print ('%15s : %s' % ('path', f.path))
++    print ('%15s : %d' % ('endianness', f.endianness))       
++    print ('%15s : %d' % ('version', f.version))
++    print ('%15s : %lu' % ('file_size', f.file_size))
+ 
+ cdef printvar(ADIOS_VARINFO * v):
+-    print '%15s : %d' % ('varid', v.varid)
+-    print '%15s : %s' % ('type', adios2npdtype(v.type))
+-    print '%15s : %d' % ('ndim', v.ndim)
+-    print '%15s : %s' % ('dims', [v.dims[i] for i in range(v.ndim)])
+-    print '%15s : %d' % ('nsteps', v.nsteps)
++    print ('%15s : %d' % ('varid', v.varid))
++    print ('%15s : %s' % ('type', adios2npdtype(v.type)))
++    print ('%15s : %d' % ('ndim', v.ndim))
++    print ('%15s : %s' % ('dims', [v.dims[i] for i in range(v.ndim)]))
++    print ('%15s : %d' % ('nsteps', v.nsteps))
+ 
+ cdef ADIOS_READ_METHOD str2adiosreadmethod(bytes name):
+     if (name == "BP"):
+@@ -530,7 +531,7 @@ cdef ADIOS_READ_METHOD str2adiosreadmeth
+     elif (name == "ICEE"):
+         method = READ_METHOD.ICEE
+     else:
+-        print '[WARN] Invalid read method name:', name, '. Use default BP method'
++        print ('[WARN] Invalid read method name:', name, '. Use default BP method')
+         method = READ_METHOD.BP
+         
+     return method
+@@ -728,8 +729,8 @@ cdef class file:
+     cpdef printself(self):
+         """ Print native ADIOS_FILE structure. """
+         assert self.fp != NULL, 'Not an open file'
+-        print '=== AdiosFile ==='
+-        print '%15s : %lu' % ('fp', <unsigned long> self.fp)
++        print ('=== AdiosFile ===')
++        print ('%15s : %lu' % ('fp', <unsigned long> self.fp))
+         printfile(self.fp)
+ 
+     cpdef advance(self, int last = 0, float timeout_sec = 0.0):
+@@ -993,9 +994,9 @@ cdef class var:
+     cpdef printself(self):
+         """ Print native ADIOS_VARINFO structure. """
+         assert self.vp != NULL, 'Not an open variable'
+-        print '=== AdiosVariable ==='
+-        print '%15s : %lu' % ('vp', <unsigned long> self.vp)
+-        print '%15s : %lu' % ('fp', <unsigned long> self.file.fp)
++        print ('=== AdiosVariable ===')
++        print ('%15s : %lu' % ('vp', <unsigned long> self.vp))
++        print ('%15s : %lu' % ('fp', <unsigned long> self.file.fp))
+         printvar(self.vp)
+         
+     def __repr__(self):
+@@ -1119,8 +1120,8 @@ cdef class attr:
+                 self.dtype = self.value.dtype
+                     
+             elif self.dtype is None:
+-                print 'Warning: No support yet: %s (type=%d, bytes=%d)' % \
+-                      (self.name, atype, bytes)
++                print ('Warning: No support yet: %s (type=%d, bytes=%d)' % \
++                      (self.name, atype, bytes))
+             else:
+                 len = bytes/self.dtype.itemsize
+                 if len == 1:
+@@ -1473,7 +1474,7 @@ def readvar(fname, varname):
+     """
+     f = file(fname, comm=MPI.COMM_SELF)
+     if not f.var.has_key(varname):
+-        print "No valid variable"
++        print ("No valid variable")
+         return
+ 
+     v = f.var[varname]
+Index: adios-1.9.0/wrappers/numpy/adios.pyx
+===================================================================
+--- adios-1.9.0.orig/wrappers/numpy/adios.pyx
++++ adios-1.9.0/wrappers/numpy/adios.pyx
+@@ -4,6 +4,7 @@
+ .. moduleauthor:: Jong Choi <choij at ornl.gov>
+ """
+ 
++from __future__ import print_function
+ import numpy as np
+ cimport numpy as np
+ 
+@@ -349,7 +350,7 @@ cpdef int write_double (int64_t fd_p, ch
+ 
+ cpdef int read(int64_t fd_p, char * name, np.ndarray val):
+     assert val.flags.contiguous, 'Only contiguous arrays are supported.'
+-    print "Reading ... ", val.itemsize * val.size, "(bytes)"
++    print ("Reading ... ", val.itemsize * val.size, "(bytes)"))
+     return adios_read(fd_p, name, <void *> val.data, val.itemsize * val.size)
+ 
+ cpdef int close(int64_t fd_p):
+@@ -500,24 +501,24 @@ cpdef np.dtype adios2npdtype(ADIOS_DATAT
+     return ntype
+ 
+ cdef printfile(ADIOS_FILE * f):
+-    print '%15s : %lu' % ('fh', f.fh)
+-    print '%15s : %d' % ('nvars', f.nvars)
+-    print '%15s : %s' % ('var_namelist', [f.var_namelist[i] for i in range(f.nvars)])
+-    print '%15s : %d' % ('nattrs', f.nattrs)
+-    print '%15s : %s' % ('attr_namelist', [f.attr_namelist[i] for i in range(f.nattrs)])
+-    print '%15s : %d' % ('current_step', f.current_step)       
+-    print '%15s : %d' % ('last_step', f.last_step)       
+-    print '%15s : %s' % ('path', f.path)
+-    print '%15s : %d' % ('endianness', f.endianness)       
+-    print '%15s : %d' % ('version', f.version)       
+-    print '%15s : %lu' % ('file_size', f.file_size)
++    print ('%15s : %lu' % ('fh', f.fh))
++    print ('%15s : %d' % ('nvars', f.nvars))
++    print ('%15s : %s' % ('var_namelist', [f.var_namelist[i] for i in range(f.nvars)]))
++    print ('%15s : %d' % ('nattrs', f.nattrs))
++    print ('%15s : %s' % ('attr_namelist', [f.attr_namelist[i] for i in range(f.nattrs)]))
++    print ('%15s : %d' % ('current_step', f.current_step))
++    print ('%15s : %d' % ('last_step', f.last_step))
++    print ('%15s : %s' % ('path', f.path))
++    print ('%15s : %d' % ('endianness', f.endianness))       
++    print ('%15s : %d' % ('version', f.version)) 
++    print '%15s : %lu' % ('file_size', f.file_size))
+ 
+ cdef printvar(ADIOS_VARINFO * v):
+-    print '%15s : %d' % ('varid', v.varid)
+-    print '%15s : %s' % ('type', adios2npdtype(v.type))
+-    print '%15s : %d' % ('ndim', v.ndim)
+-    print '%15s : %s' % ('dims', [v.dims[i] for i in range(v.ndim)])
+-    print '%15s : %d' % ('nsteps', v.nsteps)
++    print ('%15s : %d' % ('varid', v.varid))
++    print ('%15s : %s' % ('type', adios2npdtype(v.type)))
++    print ('%15s : %d' % ('ndim', v.ndim))
++    print ('%15s : %s' % ('dims', [v.dims[i] for i in range(v.ndim)]))
++    print ('%15s : %d' % ('nsteps', v.nsteps))
+ 
+ cdef ADIOS_READ_METHOD str2adiosreadmethod(bytes name):
+     if (name == "BP"):
+@@ -533,7 +534,7 @@ cdef ADIOS_READ_METHOD str2adiosreadmeth
+     elif (name == "ICEE"):
+         method = READ_METHOD.ICEE
+     else:
+-        print '[WARN] Invalid read method name:', name, '. Use default BP method'
++        print ('[WARN] Invalid read method name:', name, '. Use default BP method')
+         method = READ_METHOD.BP
+         
+     return method
+@@ -731,8 +732,8 @@ cdef class file:
+     cpdef printself(self):
+         """ Print native ADIOS_FILE structure. """
+         assert self.fp != NULL, 'Not an open file'
+-        print '=== AdiosFile ==='
+-        print '%15s : %lu' % ('fp', <unsigned long> self.fp)
++        print ('=== AdiosFile ===')
++        print ('%15s : %lu' % ('fp', <unsigned long> self.fp))
+         printfile(self.fp)
+ 
+     cpdef advance(self, int last = 0, float timeout_sec = 0.0):
+@@ -996,9 +997,9 @@ cdef class var:
+     cpdef printself(self):
+         """ Print native ADIOS_VARINFO structure. """
+         assert self.vp != NULL, 'Not an open variable'
+-        print '=== AdiosVariable ==='
+-        print '%15s : %lu' % ('vp', <unsigned long> self.vp)
+-        print '%15s : %lu' % ('fp', <unsigned long> self.file.fp)
++        print ('=== AdiosVariable ===')
++        print ('%15s : %lu' % ('vp', <unsigned long> self.vp))
++        print ('%15s : %lu' % ('fp', <unsigned long> self.file.fp))
+         printvar(self.vp)
+         
+     def __repr__(self):
+@@ -1122,8 +1123,8 @@ cdef class attr:
+                 self.dtype = self.value.dtype
+                     
+             elif self.dtype is None:
+-                print 'Warning: No support yet: %s (type=%d, bytes=%d)' % \
+-                      (self.name, atype, bytes)
++                print ('Warning: No support yet: %s (type=%d, bytes=%d)' % \
++                      (self.name, atype, bytes))
+             else:
+                 len = bytes/self.dtype.itemsize
+                 if len == 1:
+@@ -1476,7 +1477,7 @@ def readvar(fname, varname):
+     """
+     f = file(fname, comm=MPI_COMM_SELF)
+     if not f.var.has_key(varname):
+-        print "No valid variable"
++        print ("No valid variable")
+         return
+ 
+     v = f.var[varname]

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/adios.git



More information about the debian-science-commits mailing list