Skip to content

Commit

Permalink
make sampling_freq_nominal class attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
qian-chu committed Nov 22, 2024
1 parent eb622a7 commit d3126b4
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions pyneon/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ def __init__(self, file: Path):
super().__init__(file)
if self.data.index.name != "timestamp [ns]":
raise ValueError("Stream data should be indexed by `timestamp [ns]`.")
self.sampling_freq_nominal = None

@property
def timestamps(self) -> np.ndarray:
Expand Down Expand Up @@ -239,9 +238,10 @@ class NeonGaze(NeonStream):
Gaze data that inherits attributes and methods from :class:`NeonStream`.
"""

sampling_freq_nominal = int(200)

def __init__(self, file: Path):
super().__init__(file)
self.sampling_freq_nominal = int(200)
self.data = self.data.astype(
{
"gaze x [px]": float,
Expand All @@ -260,9 +260,10 @@ class NeonEyeStates(NeonStream):
3D eye states data that inherits attributes and methods from :class:`NeonStream`.
"""

sampling_freq_nominal = int(200)

def __init__(self, file: Path):
super().__init__(file)
self.sampling_freq_nominal = 200
self.data = self.data.astype(
{
"pupil diameter left [mm]": float,
Expand All @@ -288,9 +289,10 @@ class NeonIMU(NeonStream):
IMU data that inherits attributes and methods from :class:`NeonStream`.
"""

sampling_freq_nominal = int(110)

def __init__(self, file: Path):
super().__init__(file)
self.sampling_freq_nominal = int(110)
self.data = self.data.astype(
{
"gyro x [deg/s]": float,
Expand All @@ -315,7 +317,8 @@ class CustomStream(NeonStream):
Custom stream data that inherits attributes and methods from :class:`NeonStream`.
"""

file = None
sampling_freq_nominal = None

def __init__(self, data: pd.DataFrame):
self.file = None
self.data = data
self.sampling_freq_nominal = None

0 comments on commit d3126b4

Please sign in to comment.