-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: autodetect column names #719
Conversation
for more information, see https://pre-commit.ci
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #719 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 60 60
Lines 2767 2780 +13
Branches 717 729 +12
=========================================
+ Hits 2767 2780 +13 ☔ View full report in Codecov by Sentry. |
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Now all of this can be removed from dataset_files.py
right?
pymovements/src/pymovements/dataset/dataset_files.py
Lines 283 to 313 in 8edc901
# suffixes as ordered after using GazeDataFrame.unnest() | |
component_suffixes = ['x', 'y', 'xl', 'yl', 'xr', 'yr', 'xa', 'ya'] | |
pixel_columns = ['pixel_' + suffix for suffix in component_suffixes] | |
pixel_columns = [c for c in pixel_columns if c in gaze_df.frame.columns] | |
position_columns = ['position_' + suffix for suffix in component_suffixes] | |
position_columns = [c for c in position_columns if c in gaze_df.frame.columns] | |
velocity_columns = ['velocity_' + suffix for suffix in component_suffixes] | |
velocity_columns = [c for c in velocity_columns if c in gaze_df.frame.columns] | |
acceleration_columns = ['acceleration_' + suffix for suffix in component_suffixes] | |
acceleration_columns = [c for c in acceleration_columns if c in gaze_df.frame.columns] | |
column_specifiers: list[list[str]] = [] | |
if len(pixel_columns) > 0: | |
gaze_df.nest(pixel_columns, output_column='pixel') | |
column_specifiers.append(pixel_columns) | |
if len(position_columns) > 0: | |
gaze_df.nest(position_columns, output_column='position') | |
column_specifiers.append(position_columns) | |
if len(velocity_columns) > 0: | |
gaze_df.nest(velocity_columns, output_column='velocity') | |
column_specifiers.append(velocity_columns) | |
if len(acceleration_columns) > 0: | |
gaze_df.nest(acceleration_columns, output_column='acceleration') | |
column_specifiers.append(acceleration_columns) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah and now I noticed that the auto_column_detect
argument should also be available for all the functions in gaze.integration
and gaze.io
. Could you add it to these functions too, please?
…ymovements into feature/auto_column_detection
I did the changes. the pylint error is from other files: |
this should be the fix: #729 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description
Added auto_column_detection