Skip to content

Commit

Permalink
chore(point.pyx): settle deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nauaneed committed Sep 22, 2024
1 parent b2c0900 commit d349325
Showing 1 changed file with 30 additions and 28 deletions.
58 changes: 30 additions & 28 deletions pysph/base/point.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,27 @@ cdef class Point:
# Declared in the .pxd file.
#cdef public double x, y, z

property x:
def __get__(Point self):
return self.data.x
def __set__(Point self, double x):
self.data.x = x

property y:
def __get__(Point self):
return self.data.y
def __set__(Point self, double y):
self.data.y = y

property z:
def __get__(Point self):
return self.data.z
def __set__(Point self, double z):
self.data.z = z
@property
def x(Point self):
return self.data.x
@x.setter
def x(Point self, double x):
self.data.x = x

@property
def y(Point self):
return self.data.y
@y.setter
def y(Point self, double y):
self.data.y = y


@property
def z(Point self):
return self.data.z
@z.setter
def z(Point self, double z):
self.data.z = z

######################################################################
# `object` interface.
Expand Down Expand Up @@ -191,17 +195,15 @@ cdef class Point:

cdef class IntPoint:

property x:
def __get__(self):
return self.data.x

property y:
def __get__(self):
return self.data.y

property z:
def __get__(self):
return self.data.z
@property
def x(self):
return self.data.x
@property
def y(self):
return self.data.y
@property
def z(self):
return self.data.z

def __init__(self, int x=0, int y=0, int z=0):
self.data.x = x
Expand Down

0 comments on commit d349325

Please sign in to comment.