Skip to content
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

Merged
merged 9 commits into from
Jul 9, 2024
Merged

feat: autodetect column names #719

merged 9 commits into from
Jul 9, 2024

Conversation

prassepaul
Copy link
Member

Description

Added auto_column_detection

@prassepaul prassepaul linked an issue Apr 19, 2024 that may be closed by this pull request
1 task
Copy link

codecov bot commented Apr 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (7c5180e) to head (4f236c4).

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.
📢 Have feedback on the report? Share it here.

@prassepaul prassepaul marked this pull request as ready for review April 22, 2024 07:54
Copy link
Contributor

@dkrako dkrako left a 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?

# 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)

@dkrako dkrako changed the title add autodetect of column names feat: add autodetect of column names Apr 23, 2024
@dkrako dkrako added the enhancement New feature or request label Apr 23, 2024
dkrako
dkrako previously requested changes Apr 23, 2024
Copy link
Contributor

@dkrako dkrako left a 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
@prassepaul
Copy link
Member Author

prassepaul commented May 17, 2024

I did the changes. the pylint error is from other files:
pylint: commands[0]> pylint --rcfile=pylintrc --output-format=parseable --ignore-paths=/home/runner/work/pymovements/pymovements/src/pymovements/_version.py /home/runner/work/pymovements/pymovements/src/pymovements
************* Module pymovements.plotting.tsplot
src/pymovements/plotting/tsplot.py:154: [E0606(possibly-used-before-assignment), tsplot] Possibly using variable 'ylims' before assignment
************* Module pymovements.events.properties
src/pymovements/events/properties.py:259: [E0606(possibly-used-before-assignment), location] Possibly using variable 'expression_component' before assignment

@prassepaul prassepaul requested a review from dkrako May 17, 2024 09:18
@dkrako
Copy link
Contributor

dkrako commented May 17, 2024

this should be the fix: #729
can you approve and merge the changes afterwards from the mainbranch into your PR?

@dkrako dkrako enabled auto-merge (squash) May 17, 2024 09:40
@dkrako dkrako changed the title feat: add autodetect of column names feat: autodetect column names May 17, 2024
@prassepaul prassepaul mentioned this pull request Jul 8, 2024
Copy link
Member

@SiQube SiQube left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dkrako dkrako merged commit 1e2eac1 into main Jul 9, 2024
21 checks passed
@dkrako dkrako deleted the feature/auto_column_detection branch July 9, 2024 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

auto column detection when initializing gaze
3 participants