-
Notifications
You must be signed in to change notification settings - Fork 296
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
Add group_files and from_files utility functions for creating Scenes from multiple files #576
Conversation
Codecov Report
@@ Coverage Diff @@
## master #576 +/- ##
==========================================
+ Coverage 77.44% 77.72% +0.28%
==========================================
Files 136 136
Lines 19154 19305 +151
==========================================
+ Hits 14834 15005 +171
+ Misses 4320 4300 -20
Continue to review full report at Codecov.
|
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.
LGTM
This is partially discussed in #310. Basically when using
MultiScene
objects or when you want to create a lot of Scenes from an unorganized series of files. I've had to do this "manually" for a lot of theMultiScene
examples I've created where doing it requires that I know something about the file pattern. Usually that means knowing when/where the "start_time" field occurs in filenames and grouping files by that time. This PR adds asatpy.readers.group_files
utility function to help with this by using a reader's file patterns to figure out thestart_time
but allow for other fields to be used too.Additionally, I add a
from_files
classmethod toMultiScene
to use this newgroup_files
method and create a MultiScene. Should I add a classmethod toScene
to do the same (return a list of Scenes)?I still need to add tests and something in the sphinx docs.
git diff origin/master -- "*py" | flake8 --diff