catalystneuro / roiextractors

Python-based module for extracting from, converting between, and handling optical imaging data from several file formats. Inspired by SpikeInterface.
https://roiextractors.readthedocs.io/en/latest/index.html
BSD 3-Clause "New" or "Revised" License
12 stars 7 forks source link

Remove squeezing frames in get_frames for `MultiImagingExtractor` #186

Closed weiglszonja closed 2 years ago

weiglszonja commented 2 years ago

MultiImagingExtractor get_video calls through get_frames to handle iterating over frames from multiple ImagingExtractors. This condition in catalystneuro/neuroconv#54 was necessary because it can happen that for one of the extractors a single frame is returned, so in order to remove it, we have to make sure that frames are not squeezed in MultiImagingExtractor and the get_video returns the frames correctly.

This PR removes squeezing the frames in MultiImagingExtractor and adds a test for get_video.

Resolve #161

weiglszonja commented 2 years ago

@bendichter I don't get why coverage for extraction_tools.py decreases like this since I removed the decorator function from get_frames. It looks so bad, how can I fix it?

CodyCBakerPhD commented 2 years ago

@weiglszonja just a guess until I can take a closer look but the diff of 0.53% appears to be due to the entire get_frames_arga decorator now being untested (likely because it is no longer called on any frame retrieval function?) : https://app.codecov.io/gh/catalystneuro/roiextractors/compare/186/changes#D1L291

Simple fix is to also remove the code for the decorator along with this but perhaps that’s best done in a separate PR. As long as the interface itself has full coverage, it’s fine. Can always improve global coverage in follow-ups

codecov[bot] commented 2 years ago

Codecov Report

Merging #186 (0eeab92) into master (1f8a479) will decrease coverage by 0.52%. The diff coverage is 80.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #186      +/-   ##
==========================================
- Coverage   72.56%   72.03%   -0.53%     
==========================================
  Files          33       33              
  Lines        2114     2117       +3     
==========================================
- Hits         1534     1525       -9     
- Misses        580      592      +12     
Flag Coverage Δ
unittests 72.03% <80.00%> (-0.53%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/roiextractors/multiimagingextractor.py 98.68% <80.00%> (-1.32%) :arrow_down:
src/roiextractors/extraction_tools.py 67.12% <0.00%> (-5.03%) :arrow_down: