Skip to content

Commit

Permalink
Add property setters
Browse files Browse the repository at this point in the history
  • Loading branch information
banesullivan committed Oct 5, 2022
1 parent 779c050 commit 74fef3e
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions pvxarray/vtk_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,28 @@ def __init__(
elif time is not None:
raise TypeError

def __str__(self):
return f"""
data_array: {self._data_array}
resolution: {self._resolution}
x: {self._x}
y: {self._y}
z: {self._z}
order: {self._order}
component: {self._component}
time: {self._time}
time_index: {self._time_index}
"""

@property
def data_array(self):
return self._data_array

@data_array.setter
def data_array(self, data_array):
self._data_array = data_array
self.Modified()

@property
def resolution(self):
return self._resolution
Expand All @@ -81,6 +99,60 @@ def resolution(self, resolution: int):
self._resolution = resolution
self.Modified()

@property
def x(self):
return self._x

@x.setter
def x(self, x: str):
self._x = x
self.Modified()

@property
def y(self):
return self._y

@y.setter
def y(self, y: str):
self._y = y
self.Modified()

@property
def z(self):
return self._z

@z.setter
def z(self, z: str):
self._z = z
self.Modified()

@property
def time(self):
return self._time

@time.setter
def time(self, time: str):
self._time = time
self.Modified()

@property
def order(self):
return self._order

@order.setter
def order(self, order: str):
self._order = order
self.Modified()

@property
def component(self):
return self._component

@component.setter
def component(self, component: str):
self._component = component
self.Modified()

def resolution_to_sampling_rate(self, data_array):
"""Convert percentage to sampling rate."""
shape = np.array(data_array.shape)
Expand Down

0 comments on commit 74fef3e

Please sign in to comment.