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: Add __str__() methods to EventDataFrame and GazeDataFrame #727

Merged
merged 13 commits into from
May 24, 2024

Conversation

josephine-funken
Copy link
Collaborator

Description

Added string representations to EventDataFrame and GazeDataFrame

Fixes issue # 448

Implemented changes

Insert a description of the changes implemented in the pull request.

  • Add EventDataFrame.__str__() method which includes frame in output
  • Add GazeDataFrame.__str__() method which includes experiment and frame in output
  • Remove the use of frame from all tutorial notebooks

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

@josephine-funken josephine-funken linked an issue May 8, 2024 that may be closed by this pull request
3 tasks
@github-actions github-actions bot added the enhancement New feature or request label May 8, 2024
Copy link

codecov bot commented May 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (38e93da) to head (befc4f6).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #727   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           60        60           
  Lines         2813      2823   +10     
  Branches       714       715    +1     
=========================================
+ Hits          2813      2823   +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

I noticed that a lot of print()statements are being used. this is because the python interpreter uses the __repr__() method right?

can you additionally implement a __repr__() method for both classes and that just forward to the __str__() method?

like this:

def __repr__(self): -> str:
    return self.__str__()

then you should be able to remove all the print statements in the notebooks and examples

src/pymovements/events/frame.py Outdated Show resolved Hide resolved
src/pymovements/gaze/gaze_dataframe.py Outdated Show resolved Hide resolved
@dkrako dkrako enabled auto-merge (squash) May 17, 2024 08:59
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! I just did some minor reformattings in the notebokos.
Now its's ready to merge, thanks a lot for your work!

src/pymovements/events/frame.py Show resolved Hide resolved
@dkrako dkrako merged commit cb32c39 into main May 24, 2024
21 checks passed
@dkrako dkrako deleted the 448-__str__-methods branch May 24, 2024 08:45
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.

Add __str__() methods to GazeDataFrame and EventDataFrame
2 participants