-
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: add support for multiple recording specs per file to gaze.from_asc() #887
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #887 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 74 74
Lines 3372 3380 +8
Branches 594 595 +1
=========================================
+ Hits 3372 3380 +8 ☔ View full report in Codecov by Sentry. |
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, thanks a lot for the submission!
I would like to increase the scope of this PR to not only account for changes of tracked eyes but also changes of the overall recording configuration. They are all included in the same line and can be matched with a single regex.
Apart from this, please put tests into https://github.com/aeye-lab/pymovements/blob/feature/metadata/tests/unit/utils/parsing_test.py
You can test it two ways: either create a new test file with changing configs or just specify a string like it is done for ASC_TEXT
to create a file on the fly.
(Test include only one recording config line at the moment)
…guration are match continously instead of only once
…guration are match continously instead of only once
…hanges in the metadata dict, modified parsing_test.py to account for the changes
…hanges in the metadata dict, modified parsing_test.py to account for the changes
…hanges in the metadata dict, modified parsing_test.py to account for the changes
…hanges in the metadata dict, modified parsing_test.py to account for the changes
…hanges in the metadata dict, modified parsing_test.py to account for the changes
…hanges in the metadata dict, modified parsing_test.py to account for the changes
…hanges in the metadata dict, modified parsing_test.py to account for the changes, modified parsing.py to adhere to pylint
…hanges in the metadata dict, modified parsing_test.py to account for the changes, modified parsing.py to adhere to pylint
|
if not recording_config: | ||
sampling_rate = None | ||
else: | ||
sampling_rate = float(recording_config[0]['sampling_rate']) |
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.
I think it's sufficient for now to just check for consistency and raise a warning if it's inconsistent.
We can improve on that in a follow-up. Moreover, the logic for calculating data loss will be moved away from this module into the measure module. This way users will be able to calculate these measures on any GazeDataFrame
not just when parsed via from_asc()
.
), | ||
pytest.param( | ||
'** DATE: Wed Mar 8 09:25:20 2023\n' |
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.
these added date strings aren't really necessary, right?
It really doesn't matter in this case and you don't need to revert them, but usually I would advise to avoid changes to existing test logic, e.g. changing test values.
Your other changes here, like adding documentation or changing test ids, are of course the spirit that we need! 🥇
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.
Thanks for all your Feedback 😄
The thing is, without this additional line, the metadata will be empty, since the MSG line gets parsed into the recording_config and not metadata anymore. However if metadata is empty/ none the code will raise a warning and all the tests, where I added the Date line, will fail due to that.
line 367
"""
if not metadata:
raise Warning('No metadata found. Please check the file for errors.')
"""
So I figured, I add a line that should be present in any dataset, which gets parsed by the metadata.
Is there a better way, to solve this?
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, thanks a lot for your update!
Apart from the comments I left, there is the issue that #884 is now conflicting with your PR. We will probably merge #884 first, as it's close to finished.
We will then need to work out how to integrate this PR here into the new functionality from that PR.
I would probably suggest to do something similar as it's done with the screen distance, which can be statically defined in Experiment
, but can also be dynamically defined as a column in GazeDataFrame
.
Let's think about how to work this issue out and discuss that next week.
Until then, the work on the other comments should be straight forward.
Probably not the cleanest way to do it
Probably not the cleanest way to do it
Probably not the cleanest way to do it
Probably not the cleanest way to do it
Description
Record all the tracked eye sides in the metadata to fix the issue #875
Implemented changes
Insert a description of the changes implemented in the pull request.
I modified the code in parsing.py to record every time it can be matched in the message line of the asci files
Type of change
How Has This Been Tested?
I ran it on the to ascii converted ch1hr007.edf of the pilot-hr-1-zh data to verify the output, but no further testing has been done so far
Checklist: