Skip to content

fix: copy trial_columns when copying EventDataFrame #1128

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

SiQube
Copy link
Member

@SiQube SiQube commented Apr 27, 2025

resolves #1127

the described d.py now returns:

(venv) siqube@c-cube:/tmp/pymovements
$ python d.py 
['n']
['n']

Copy link

codecov bot commented Apr 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (c4ed6bc) to head (9195c16).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1128   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           87        87           
  Lines         3818      3818           
  Branches       679       679           
=========================================
  Hits          3818      3818           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Thanks for taking care! Can you add a test to prevent regressions?

@dkrako dkrako changed the title hotfix: copy trial_columns when copying EventDataFrame fix: copy trial_columns when copying EventDataFrame Apr 28, 2025
@dkrako
Copy link
Contributor

dkrako commented Apr 28, 2025

As a side note, hotfix: is no valid conventional commit prefix. the correct prefix is fix:.

https://www.conventionalcommits.org/en/v1.0.0/

@dkrako dkrako added the fix label Apr 28, 2025
@dkrako
Copy link
Contributor

dkrako commented May 12, 2025

This could also be changed in this PR (but can be also treated separately):

def clone(self) -> GazeDataFrame:
"""Return a copy of the GazeDataFrame.
Returns
-------
GazeDataFrame
A copy of the GazeDataFrame.
"""
gaze = GazeDataFrame(
data=self.frame.clone(),
experiment=deepcopy(self.experiment),
)
gaze.n_components = self.n_components
return gaze

It also doesn't clone self.events.

Strange that we have Gaze.clone() and Events.copy().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EventDataFrame.trial_columns deleted if copied
2 participants