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

Make exception work for incomplete matadata too #249

Merged
merged 1 commit into from Mar 19, 2020

Conversation

JoranAngevaare
Copy link
Member

@JoranAngevaare JoranAngevaare commented Mar 18, 2020

This is a great feature of strax that is needed if one e.g. wants to load only a small part of the data. The exception is also gread in case the RunMetaData is not available.

However in case of incomplete RunMetaData the error is not a strax.RunMetadataNotAvailable but a KeyError since 'start' is not in the RunMetaData. Hence I'd propose to also accept the KeyError as an exception.

I've tested in on eb0 for run 7157 and 7158 while loading raw_records with incomplete RunMetaData:
rr = st.get_array('007158', targets = ['raw_records'], seconds_range = (0,5))

This is a great feature of strax that is needed if one e.g. wants to load only a small part of the data. The exception is also gread in case the RunMetaData is not available. 

However in case of incomplete RunMetaData the error is not a strax.RunMetadataNotAvailable but a KeyError since 'start' is not in the RunMetaData. Hence I'd propose to also accept the KeyError as an exception.

I've tested in on eb0 for run 7157 and 7158 while loading raw_records with incomplete RunMetaData.
@JelleAalbers JelleAalbers merged commit f409d10 into AxFoundation:master Mar 19, 2020
@JoranAngevaare JoranAngevaare deleted the patch-3 branch March 19, 2020 13:27
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.

None yet

2 participants