-
Notifications
You must be signed in to change notification settings - Fork 17
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
register viewer widget with customized key and allow fallback support #430
Conversation
@@ -71,7 +74,12 @@ def viewer(obj, downloadable=True, **kwargs): | |||
return obj | |||
|
|||
try: | |||
_viewer = AIIDA_VIEWER_MAPPING[obj.node_type] | |||
try: | |||
_viewer = AIIDA_VIEWER_MAPPING[(obj.node_type, obj.process_label)] |
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 am wondering, to make this more general we could use the obj.label
instead of obj.process_label
. I am just not sure if that would be a backwards compatible change for QeApp.
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.
Thanks for looking at this. I made this a draft since I did not decided if using process_label
is a good design. I was thinking to introduce a rule that stores some standard metadata to extra
attributes for use here.
You mentioned in the meeting yesterday that there is a new field that can be used for mapping the process name in TreeNodeWidget, what is that? Is it specific for process or for more general data node?
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.
No, it's just a hook for renaming the process_label
, see
Implemented here:
It would definitely help to make the node tree more user friendly, but is not needed for this particular feature.
…Workchain (#348) fixes #344 The register_viewer_widget decorator registers the viewer by class and the new viewer for QeAppWorkchain specifically also become the viewer of other WorkChain. It will raise the KeyError and raised which is not expected. Instead of raising the exception, nothing is returned. This is a workaround since ideally if there is no new specific viewer defined for a specific work chain, it needs to fall back to the native one of AWB. As tried in aiidalab/aiidalab-widgets-base#430
I think this has been implemented (in a slightly different way) in #541 |
No description provided.