-
Notifications
You must be signed in to change notification settings - Fork 6
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
VitessceConfig.to_python method #115
Conversation
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.
Lots of comments on the trees, not really understanding the forest.
Rather than test on the structure of the reconstructed_vc_dict
, I'd be interested to see a check on the actual output of to_python
.
Did you consider building the python as a syntax tree, rather than as a string? It would be harder, no doubt, but it would give us a better guarantee that the structure is good.
").set_coordination_value(\n", | ||
" c_type=\"spatialTargetY\", c_scope=\"A\", c_value=-900\n", | ||
").add_view(\n", | ||
" dataset=\"dries-2019\",\n", |
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.
I think it would be good to clarify with Nils what precisely he wants from the generated node that the json doesn't offer. One thing he might be looking for is avoiding cases like this where the same uuid string is incorporated as multiple points in the code... which might be tricky. Or maybe it's enough to get it into the python syntax and avoid the extra quotes around everything.
Also: This is awesome! Thank you so much for taking it on. |
Co-authored-by: Chuck McCallum <mccalluc@users.noreply.github.com>
Co-authored-by: Chuck McCallum <mccalluc@users.noreply.github.com>
Co-authored-by: Chuck McCallum <mccalluc@users.noreply.github.com>
Co-authored-by: Chuck McCallum <mccalluc@users.noreply.github.com>
Co-authored-by: Chuck McCallum <mccalluc@users.noreply.github.com>
Co-authored-by: Chuck McCallum <mccalluc@users.noreply.github.com>
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.
More thoughts!
From @mccalluc in the Spatial Omics Meeting Agenda:
I wrote my understanding of the problem in the meeting agenda document. Building on your PR #66, in this PR I added a
.to_python
method for VitessceConfig instances. Runningvc.to_python
generates Python code that can be used to reconstruct the view config. It is kind of a hybrid of proposals 1 and 3 above. I added an example notebook atdocs/notebooks/config_to_python.ipynb
. Would this solution work for the notebook generation use case?Also:
Fixes #63
Fixes #54
Fixes #62