-
Notifications
You must be signed in to change notification settings - Fork 56
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 WaveformBrowser compatibility to DataLoader #484
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main legend-exp/pygama#484 +/- ##
==========================================
+ Coverage 47.93% 48.17% +0.23%
==========================================
Files 104 104
Lines 12314 12443 +129
==========================================
+ Hits 5903 5994 +91
- Misses 6411 6449 +38
☔ View full report in Codecov by Sentry. |
Hi Ian, very nice! Don't you think we should replace
I totally agree. |
Oh, seems like Numba throws a new warning in the latest release... |
The error that is currently causing the checks to fail is due to a new warning that appears in numba 0.57.0 (released yesterday). I've submitted a bug report for it: numba/numba#8936. For now, I've added this to the list of numba versions to avoid in setup. |
Ok, now that all checks are passing again:
Either way, if there are no objections I would suggest merging this quickly, as I think @erin717 is planning on using |
In my view, In this view, I like very much the idea that Anyways, we can always change things at some point in the future, if you like the idea. You can go ahead and merge from my point of view! |
Implemented
DataLoader.browse
, addedDataLoader.load_iterator
, and made necessary changes toLH5Iterator
andWaveformBrowser
to make these work well.Details:
LH5Iterator
to work across tiers and groups. It can now take a list of groups (enabling different groups from the same file). It can also "friend" together multiple LH5Iterators to read them in parallel, much like friending TChains in ROOTlgdo.expand_path
can now work with abase_path
. This fixed some bugs associated with usingLH5_Store
with a base pathload_iterator
toDataLoader
. This constructs and returns anLH5Iterator
across all tiers/groups/files. This can be used for iterating over files in chunks (although I see @gipert working on something similar). Right now this is only implemented for hits mode. This also doesn't solve the problem of needing to separately load the entry list first (some sort of lazy entry_list would be really nice here). Since the WaveformBrowser is built around LH5 iterator, this is useful to have.DataLoader.browse
to return aWaveformBrowser
object. Note that this ignores the field_mask created by the DataLoader in favor of constructing it from the requested lines to draw.LH5Iterator
initialize faster by being "lazy" about mapping files. Before, a map of file lengths and entries in each file was constructed on start up; with large numbers of files, this caused a long hang from opening up all of the files and reading the size of each group. Now, the maps are constructed as you iterate through files; this gets rid of the hang on start up (although you still see a hang whenever it reaches a new file). This is a quality of life improvement for waveform browsing mainly.