-
Notifications
You must be signed in to change notification settings - Fork 1
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 "JSON" generator to facilitate testing of live workflows in downstream packages #115
Conversation
Requires scipp/essreduce#115 for CI to pass.
generator = event_data_generator(monitor) | ||
for i in range(len(monitor)): | ||
group = json_nexus_group(next(generator)) | ||
assert_identical(group[()], monitor[i : i + 1]) |
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.
Can you add a test that the generator has finished after the loop? I.e., that next(generator)
raises StopIteration
. Asking because the loop uses monitor
and not generator
.
Parameters | ||
---------- | ||
data: | ||
A data array with event data, equivalent to what ScippNexus would load from an |
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.
It's a dict, not a data array.
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.
Hmm, do you mean the return value? This docstring line is about the input.
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.
Yes, I meant the return value. My bad.
Can you add an explanation of it? In particular, there is no explanation of how data is encoded.
For now this only supports NXevent_data. More might be added in the future.