-
Notifications
You must be signed in to change notification settings - Fork 11
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
JSON repr not always working #804
Comments
Asking the notebook to show me the docstring gives a good hint where things are going wrong. I.e.
|
Ok, super. The issue was that in I'm making a PR now to give these classes' |
The
HasToDict
mix-in class used throughout theworkflow
module adds a custom_repr_json_
method to get nice notebook representations for the various objects. Unfortunately, this isn't working for a couple of objects (originally discussed in PR #658).M(ish)WE:
wf
is not good (Workflow(Node)
)wf.structure
is fine (SingleValue(Function(Node))
)wf.structure.inputs
is no good (Inputs
)wf.structure.inputs.cubic
is fine (DataChannel
)As a temporary fix in the linked PR, I added a
repr_json()
method that just explicitly wrapped the returned dictionary in_repr_json_
in aIPython.display.JSON
call before returning it, and this always works fine -- so it's just when the notebook tries to do it's magic that we run into trouble.I think I see the issue already (it has to do with overloading
__getattr__
), but I want the solution process documented. I hope to raise and close this in a sitting.The text was updated successfully, but these errors were encountered: