-
Notifications
You must be signed in to change notification settings - Fork 192
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
Adding to dynamic output_namespace
results in ValidationError
#5536
Comments
After looking further into this, it seems to me this issue is somehow connected to caching. In the case above caching was enabled. After disabling caching for the calculation class in question I'm no longer able to reproduce the validation error. |
Seems possible that caching is involved. The validation is supposed to happen on the nested namespace structure in memory so the path would be |
Great, that makes sense. I guess this means the issue is not in plumpy but rather in aiida-core; let me know in case you're planning to have a look into this - if not I can also look later today I guess it will be somewhere around here aiida-core/aiida/orm/nodes/node.py Lines 529 to 538 in 5c1eb3f
|
I am not sure it is, because that is on the |
In essence I'm just trying to follow the example of aiida-quantumespresso:
Define a dynamic output namespace
https://github.com/aiidateam/aiida-quantumespresso/blob/95a7d94230c37c9a3f3e0cec4226bd2eed7a1939/src/aiida_quantumespresso/calculations/pp.py#L89
and then output a dictionary to that dynamic output namespace:
https://github.com/aiidateam/aiida-quantumespresso/blob/95a7d94230c37c9a3f3e0cec4226bd2eed7a1939/src/aiida_quantumespresso/parsers/pp.py#L155
In my case, the output namespace is called
json
and one of its dynamic ports is calledscf
.However, when I do this, I get an unexpected validation error from plumpy
The exception is raised inside the call to
validate_dynamic_ports
here:https://github.com/aiidateam/plumpy/blob/8c7640b6443410424bf3cfdd5b201ed24bf0dae1/src/plumpy/processes.py#L1269-L1276
Stepping through the code, I realize that
port_name
isjson__scf
KeyError
is raisedport
is set to the top-level'outputs'
namespace.This leads to the validation error because
port.validate_dynamic_ports
checks whetherport
is dynamic (and the top-level 'outputs' port is not, only the 'json' port namespace is).https://github.com/aiidateam/plumpy/blob/8c7640b6443410424bf3cfdd5b201ed24bf0dae1/src/plumpy/ports.py#L735-L737
It's not exactly clear to me what the intended logic is here but it seems to me that there is an issue.
It's a bit weird because I don't see any obvious recent changes here and I don't understand how the code in aiida-qe can work but not mine.
@sphuber any ideas what might be going on here?
The text was updated successfully, but these errors were encountered: