Skip to content

Conversation

@lucie271
Copy link
Contributor

This PR is to adress a tiny issue with the matching of the video being processed with its annotations from the csv file. Indeed, many video files have originally dots in their filename (like "28.03.2025.mp4"for example), so I needed to go from

participant_excel["FileName"].str.split(".").str[0]

to

participant_excel["FileName"].str.rsplit(".", n=1).str[0]

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @lucie271, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves a subtle bug in the video processing workflow that caused an incorrect association between video files and their corresponding annotations. The problem arose when video filenames contained dots other than the one preceding the file extension, leading to premature truncation of the filename during matching. The updated logic now accurately extracts the base filename by splitting only on the last dot, ensuring reliable data correlation.

Highlights

  • Filename Parsing Fix: Corrected an issue where video filenames containing multiple dots were incorrectly parsed, leading to mismatches with annotation data.
  • Robust Extension Handling: Changed the filename extraction logic from str.split(".").str[0] to str.rsplit(".", n=1).str[0] to ensure only the file extension is removed, preserving dots within the base filename.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly addresses an issue with matching video filenames that contain dots by using rsplit instead of split. This is a good, robust fix. My review includes one comment pointing out that the same bug pattern exists elsewhere in the file and should also be updated to ensure the issue is fully resolved.

]
mask = (
participant_excel["FileName"].str.split(".").str[0]
participant_excel["FileName"].str.rsplit(".", n=1).str[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This is a great fix for handling filenames with multiple dots. However, the same issue appears to exist in another part of the file. The determine_session_from_excel function also uses participant_excel["FileName"].str.split(".").str[0] on line 302. To ensure consistency and fully resolve the bug, you should apply this rsplit logic there as well.

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.03%. Comparing base (f098f57) to head (33e91d7).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #33   +/-   ##
=======================================
  Coverage   80.03%   80.03%           
=======================================
  Files           5        5           
  Lines        1052     1052           
=======================================
  Hits          842      842           
  Misses        210      210           

☔ 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.

@lucie271 lucie271 requested a review from fabiocat93 November 10, 2025 16:11
@fabiocat93
Copy link
Collaborator

looks good. do you want me to merge it or are there more changes in plan? @lucie271

@fabiocat93 fabiocat93 merged commit 5d955ef into main Nov 10, 2025
6 checks passed
@lucie271 lucie271 deleted the fix_error_BIDS_conversion branch November 24, 2025 14:52
lucie271 pushed a commit that referenced this pull request Dec 15, 2025
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.

4 participants