-
Notifications
You must be signed in to change notification settings - Fork 8
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
Only writes on stop document #10
Comments
There is not an append-only way to extend a json file (as you have to insert new next before the closing If there is no option but to do communication to the live analysis via files, I guess we need a |
I don't know if there is anything unique in the stop document that isn't (or can't be) in the start already, is there? it's not like the metadata is changing during the scan? I don't know much about ZMQ, but it seems like it could be a possibility. (one that would require a bit of coding on the analysis side, which I was hoping to minimize while I rewrite the analysis in a python friendly way) |
I'm not sure what you mean. The stop document contains information that we can't know at the beginning, like how it exited (success/failure) and when it exited. What code is consuming this |
From a live analysis point of view the only interesting info in the Json to me is the contents of the md dictionary. This can’t be used for live plotting or analysis (in Igor) when it isn’t written until the whole scan is complete. A different suitcase that just wrote the md dictionary on the start document and that was it, I would be happy. I would have called this json metadata, but I’m probably confused about the scope of what json metadata is meant to cover. |
Oh I see. I think this misunderstanding validates a concern we had about inventing user-facing formats like "json-metadata" without a specific consumer in mind. You can bend # Write a JSON file with just the RunStart document in it
# as soon as the document is emitted by the RunEngine.
import event_model
import suitcase.jsonl
def factory(name, start_doc):
with suitcase.jsonl.Serializer(directory='...', file_prefix='...') as serializer:
serializer(name, start_doc)
# We do not need any further documents from the RunRouter.
return [], []
rr = event_model.RunRouter([factory])
RE.subscribe(rr) Tested interactively, works. |
Excellent. Thank you! |
Let's make the action item on this issue "improve the documentation." We already decided that we won't bother to do full sphinx-based docs for every suitcase. I propose just adding some information to the README. @awalter-bnl Can you add some rough documentation to the README that shows the example output file for a basic example like |
I will start that now @danielballan |
Issue moved to bluesky/suitcase-jsonl #14 via ZenHub |
moved this issue as it was resolved via a change to the readme file in suitcase-jsonl |
Documentation for suitcase-jsonl is welcome, but the problem in this issue was confusion around the intent of |
Hm. I see that "moved by ZenHub" creates a copy of all the comments whereas GitHub's "Transfer this Issue" is better because it actually moves the issue instead of copying. |
Not sure if this is fundamental to the structure of json metadata suitcase, but is there any reason why it can't partially write the json on the start document, so that this metadata can be used for live analysis? Right now it doesn't even create the file until the stop document.
The text was updated successfully, but these errors were encountered: