Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F8308812
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
View Options
diff --git a/pyext/yoda/include/Point1D.pyx b/pyext/yoda/include/Point1D.pyx
--- a/pyext/yoda/include/Point1D.pyx
+++ b/pyext/yoda/include/Point1D.pyx
@@ -1,89 +1,89 @@
cimport util
cdef class Point1D(Point):
"""
A 1D point with errors, used by the Scatter1D class.
"""
cdef c.Point1D* p1ptr(self) except NULL:
return <c.Point1D*> self.ptr()
def __init__(self, x=0, xerrs=0, source=""):
if source==None: source=""
cutil.set_owned_ptr(self, new c.Point1D())
self.setX(x)
self.setXErrs(xerrs, source)
def copy(self):
return cutil.new_owned_cls(Point1D, new c.Point1D(deref(self.p1ptr())))
# TODO: add clone() as mapping to (not yet existing) C++ newclone()?
def setXErrs(self, val, source):
if source==None: source=""
self.p1ptr().setXErrs(util.read_symmetric(val))
# property x:
# """x coordinate"""
# def __get__(self):
# return self.p1ptr().x()
# def __set__(self, x):
# self.p1ptr().setX(x)
# property xErrs:
# """The x errors"""
# def __get__(self):
# return util.read_error_pair(self.p1ptr().xErrs())
# def __set__(self, val):
# self.p1ptr().setXErrs(util.read_symmetric(val))
def x(self):
"""The x value"""
return self.p1ptr().x()
def setX(self, x):
"""Set the x value"""
self.p1ptr().setX(x)
def xErrs(self):
"""The x errors"""
return util.read_error_pair(self.p1ptr().xErrs())
def setXErrs(self, val):
"""Set the x errors"""
def __set__(self, val):
self.p1ptr().setXErrs(util.read_symmetric(val))
#@property
def xMin(self):
"""The minimum x position, i.e. lowest error"""
return self.p1ptr().xMin()
#@property
def xMax(self):
"""The maximum x position, i.e. highest error"""
return self.p1ptr().xMax()
def xErrAvg(self):
return self.p1ptr().xErrAvg()
def scaleX(self, a):
"""(float) -> None
Scale the x values and errors by factor a."""
self.p1ptr().scaleX(a)
def __repr__(self):
- return '<Point1D(x=%g)>' % self.x
+ return '<Point1D(x=%g)>' % self.x()
def __richcmp__(Point1D self, Point1D other, int op):
if op == 0:
return deref(self.p1ptr()) < deref(other.p1ptr())
elif op == 1:
return deref(self.p1ptr()) <= deref(other.p1ptr())
elif op == 2:
return deref(self.p1ptr()) == deref(other.p1ptr())
elif op == 3:
return deref(self.p1ptr()) != deref(other.p1ptr())
elif op == 4:
return deref(self.p1ptr()) > deref(other.p1ptr())
elif op == 5:
return deref(self.p1ptr()) >= deref(other.p1ptr())
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Dec 21, 1:13 PM (1 d, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4022911
Default Alt Text
(2 KB)
Attached To
rYODAHG yodahg
Event Timeline
Log In to Comment