Skip to content

Commit

Permalink
tiny fix to scanpath saving
Browse files Browse the repository at this point in the history
  • Loading branch information
JGHartel committed Sep 25, 2024
1 parent 6ef6732 commit 46fb50f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pyneon/recording.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,13 @@ def scanpath(self) -> Union[pd.DataFrame, None]:
Returns the scanpath data if it exists, otherwise None.
"""
if self._scanpath is None:
if (scanpath_file := self.recording_dir / "scanpath.pkl").is_file():
scanpath_file = self.recording_dir / "scanpath.pkl"
if scanpath_file.is_file():
self._scanpath = pd.read_pickle(scanpath_file)
else: # compute scanpath
self._scanpath = self.estimate_scanpath()
#save scanpath
self._scanpath.to_pickle(scanpath_file)
return self._scanpath

def concat_streams(
Expand Down

0 comments on commit 46fb50f

Please sign in to comment.