-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
read_n returns remaining frames (#105)
Modified read_n to return the number of frames available if less than the number of frames requested. ```python #f is a CtbRawFile containing 10 frames f.read_n(7) # you get 7 frames f.read_n(7) # you get 3 frames f.read_n(7) # RuntimeError ``` Also added support for chunk_size when iterating over a file: ```python # The file contains 10 frames with CtbRawFile(fname, chunk_size = 7) as f: for headers, frames in f: #do something with the data # 1 iteration 7 frames # 2 iteration 3 frames # 3 iteration stops ```
- Loading branch information
Showing
2 changed files
with
23 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters