Open jakobchwastek opened 2 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 100.00%. Comparing base (
cb32c39
) to head (9d25122
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Description
The resample transformation function offers multiple ways to adjust the sampling rate of gaze data. This function enables the adjustment of temporal frequency through both upsampling and downsampling. Additionally, it enables achieving a constant sampling rate for gaze data with inconsistent timestamps.
Resampling can be applied to both
GazeDataFrame
and entireDataset
. By default, it interpolates all columns of the resampled data frame. When applied to aGazeDataFrame
containing multiple trials, the function resamples the data frame grouped bytrial_columns
. We excludetrial_columns
from the interpolation intransforms.resample
, as interpolation is not applicable to these columns. After processing, we fill thetrial_columns
.The new sampling rate determined by the resampling process is stored in the
Experiment
object of theGazeDataFrame
.The resampling function processes timestamps with microsecond precision, supporting only sampling rates that divide 1,000,000.
Supported strategies for filling column values in newly created rows through resampling include forward filling, backward filling, linear interpolation, and nearest value interpolation.
Fixes issue #689.
Implemented changes
transforms.resample
functiontransforms._apply_on_columns
helper function, applying a function on nested and normal columns of apl.DataFrame
GazeDataFrame.apply
GazeDataFrame.resample
with examples in docsDataset.resample
Type of change
How Has This Been Tested?
tests/unit/gaze/transforms/resample_test.py
, testing for expected return values and exceptionsGazeDataFrame
withtest_gaze_dataframe_resample_expected
inunit.gaze.gaze_transform_test
test_gaze_dataframe_resample_changes_experiemnt_sampling_rate
ofunit.gaze.gaze_transform_test