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

Handle non-ptp datasets #53

Merged
merged 24 commits into from
Oct 25, 2023
Merged

Handle non-ptp datasets #53

merged 24 commits into from
Oct 25, 2023

Conversation

edeno
Copy link
Collaborator

@edeno edeno commented Oct 17, 2023

Fixes #38

@samuelbray32 can you review/test?

@edeno edeno requested a review from samuelbray32 October 17, 2023 22:04
@codecov
Copy link

codecov bot commented Oct 17, 2023

Codecov Report

Attention: 20 lines in your changes are missing coverage. Please review.

Comparison is base (4669bc9) 91.34% compared to head (d076473) 92.14%.
Report is 6 commits behind head on main.

❗ Current head d076473 differs from pull request most recent head e8e25d2. Consider uploading reports for the commit e8e25d2 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #53      +/-   ##
==========================================
+ Coverage   91.34%   92.14%   +0.80%     
==========================================
  Files          20       24       +4     
  Lines        2056     2241     +185     
==========================================
+ Hits         1878     2065     +187     
+ Misses        178      176       -2     
Files Coverage Δ
src/spikegadgets_to_nwb/convert.py 72.64% <100.00%> (-1.46%) ⬇️
...pikegadgets_to_nwb/tests/test_convert_intervals.py 89.83% <100.00%> (+0.35%) ⬆️
src/spikegadgets_to_nwb/convert_intervals.py 80.00% <60.00%> (-3.73%) ⬇️
...spikegadgets_to_nwb/tests/test_convert_position.py 97.94% <94.11%> (-0.82%) ⬇️
src/spikegadgets_to_nwb/spike_gadgets_raw_io.py 91.84% <0.00%> (-0.28%) ⬇️
src/spikegadgets_to_nwb/convert_position.py 86.44% <69.76%> (+5.24%) ⬆️

... and 5 files with indirect coverage changes

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can't comment directly on the trouble lines because not changed:

When going through the epochs here (lines 650-674)

for epoch in session_df.epoch.unique():
        try:
            position_tracking_filepath = session_df.loc[
                np.logical_and(
                    session_df.epoch == epoch,
                    session_df.file_extension == ".videoPositionTracking",
                )
            ].full_path.to_list()[0]
            # find the matching hw timestamps filepath
            video_index = position_tracking_filepath.split(".")[-2]
            video_hw_df = session_df.loc[
                np.logical_and(
                    session_df.epoch == epoch,
                    session_df.file_extension == ".cameraHWSync",
                )
            ]
            position_timestamps_filepath = video_hw_df[
                [
                    full_path.split(".")[-3] == video_index
                    for full_path in video_hw_df.full_path
                ]
            ].full_path.to_list()[0]

        except IndexError:
            position_tracking_filepath = None

The exception also needs an assertion error for the non-ptp case with no cameraHWSync files. May be better to use if ptp_enabled instead of the try except.

In the except case, still need to define something for position_timestamps_filepath, otherwise get undefined errors in the later lines. I'm not sure which is the correct file (if any) that should be going into get_position_timestamps() in the non-ptp case

@edeno edeno merged commit 9230269 into main Oct 25, 2023
8 checks passed
@edeno edeno deleted the non-ptp branch October 25, 2023 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Find dio channel and grab ephys times
2 participants