[yoda-svn] r403 - trunk/pyext/yoda/include

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Thu Oct 27 14:51:08 BST 2011


Author: buckley
Date: Thu Oct 27 14:51:07 2011
New Revision: 403

Log:
Cosmetic tweaks and TODO comments

Modified:
   trunk/pyext/yoda/include/10-AnalysisObject.pyx
   trunk/pyext/yoda/include/30-Scatter2D.pyx
   trunk/pyext/yoda/include/40-Histo1D.pyx
   trunk/pyext/yoda/include/40-ReaderAIDA.pyx

Modified: trunk/pyext/yoda/include/10-AnalysisObject.pyx
==============================================================================
--- trunk/pyext/yoda/include/10-AnalysisObject.pyx	Mon Oct 24 20:17:07 2011	(r402)
+++ trunk/pyext/yoda/include/10-AnalysisObject.pyx	Thu Oct 27 14:51:07 2011	(r403)
@@ -2,7 +2,7 @@
     cdef cppclass cAnalysisObject "YODA::AnalysisObject":
         string type()
 
-ctypedef cAnalysisObject* AOptr 
+ctypedef cAnalysisObject* AOptr
 
 cdef class AnalysisObject:
     """Base object class"""
@@ -12,3 +12,5 @@
     def type(self):
         """The type of this analysis object as a string"""
         return self.thisptr.type().c_str()
+
+    # TODO: Map annotations, etc.

Modified: trunk/pyext/yoda/include/30-Scatter2D.pyx
==============================================================================
--- trunk/pyext/yoda/include/30-Scatter2D.pyx	Mon Oct 24 20:17:07 2011	(r402)
+++ trunk/pyext/yoda/include/30-Scatter2D.pyx	Thu Oct 27 14:51:07 2011	(r403)
@@ -6,10 +6,6 @@
 
 cdef class Scatter2D(AnalysisObject):
 
-    @property
-    def numPoints(self):
-        return self.ptr().numPoints()
-    
     cdef cScatter2D * ptr(self):
         return <cScatter2D *> self.thisptr
 
@@ -18,6 +14,10 @@
         return self
 
     @property
+    def numPoints(self):
+        return self.ptr().numPoints()
+
+    @property
     def points(self):
         cdef vector[cPoint2D] vec
         cdef int i

Modified: trunk/pyext/yoda/include/40-Histo1D.pyx
==============================================================================
--- trunk/pyext/yoda/include/40-Histo1D.pyx	Mon Oct 24 20:17:07 2011	(r402)
+++ trunk/pyext/yoda/include/40-Histo1D.pyx	Thu Oct 27 14:51:07 2011	(r403)
@@ -1,4 +1,5 @@
 cdef extern from "YODA/Histo1D.h" namespace "YODA":
+    # TODO: We can use these in place of the workaround when Cython 0.15 is available
     #cHisto1D operator + (cHisto1D &, cHisto1D &)
     #cHisto1D operator - (cHisto1D &, cHisto1D &)
     #cScatter2D operator / (cHisto1D &, cHisto1D &)"""
@@ -58,7 +59,7 @@
     cdef setptr(self, cHisto1D *ptr):
         self.thisptr = ptr
         return self
-    
+
     def fill(self, double x, double weight=1.0):
         self.ptr().fill(x, weight)
 
@@ -80,7 +81,7 @@
     def bins(self):
         cdef size_t numbins = self.ptr().numBins()
         cdef size_t i
-        
+
         cdef vector[cHistoBin1D] bins = self.ptr().bins()
 
         cdef cHistoBin1D *b
@@ -91,7 +92,7 @@
             out.append(HistoBin1D().set(bins[i]))
 
         return out
-    
+
     @property
     def lowEdge(self):
         return self.ptr().lowEdge()
@@ -171,9 +172,8 @@
                 return x._div_scalar(y)
             elif ty is Histo1D:
                 return x._div_histo(y)
-        
+
         raise RuntimeError('Cannot multiply %r by %r' % (tx, ty))"""
-    
+
     def __repr__(self):
         return 'Histo1D%r' % self.bins
-

Modified: trunk/pyext/yoda/include/40-ReaderAIDA.pyx
==============================================================================
--- trunk/pyext/yoda/include/40-ReaderAIDA.pyx	Mon Oct 24 20:17:07 2011	(r402)
+++ trunk/pyext/yoda/include/40-ReaderAIDA.pyx	Thu Oct 27 14:51:07 2011	(r403)
@@ -4,6 +4,7 @@
 class ReaderAIDA:
     """Read AIDA files"""
 
+    @staticmethod
     def read(self, char *filename):
         """Takes a file, returns a list of AnalysisObjects"""
         cdef vector[AOptr] vec = vector[AOptr]()
@@ -23,7 +24,7 @@
                 ana = AnalysisObject()
             ana.thisptr = vec[i]
             out.append(ana)
-        
+
         #print str(vec[0].type().c_str())
 
         return out


More information about the yoda-svn mailing list