-
Notifications
You must be signed in to change notification settings - Fork 32
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
EquationOfStateWorkChain
: use builder._merge
instead of builder._update
to update with inputs from sub_process
namespace
#206
Comments
Indeed I was asking the same in the PR and then came here to open this issue, great that you already did :-) |
As mentioned here, I realised while discussing today with @bosonie that even I guess having the update and merge functionality is good anyway, and maybe it could be a good default that covers most simple use cases. Here the added complexity is that the EOS inputs are actual inputs to AiiDA - so this prevents e.g. defining a This might be a bit complex - so having simple functionalities like updating, merging (and maybe thinking if there are more use cases) would be goo, but also having this as a last resort I think would be very useful. Finally, to support all functionalities, maybe we should define multiple namespaces (sub_process_update, sub_process_merge)? Or define a slightly more complex syntax to tell what you want to replace, what you want to merge, ...? |
In any case, in preparation for the common workflows meeting, it might be good to at least have the _merge option available, so people can use it and we see (while running) which other use cases pop up (and we prioritise solving those) |
Note that I have backported the fix and released it in |
I'd like to make this issue more general, about (in general) how overrides should work. Here are my thoughts (if we all agree, we might want to change the title of this issue, or otherwise open a brand new issue and move this comment there):
Therefore, my suggestion is that the best is to make the override input accepting a function/lambda instead. (Note: We can still offer a few simple things like replacing and merging, if we feel it simplifies some common use cases. But maybe it's not needed?) Providing "lambda override functions" that are code specific can also be interesting because an implementation can provide a "library" of them, for various purposes and with appropriate documentation, and these can just be reused and combined by the user, and passed to common workflows like the EOS. I'm happy to hear comments about this approach. |
The
builder._update
will not recursively merge the dictionaries which is not the expected behavior since thesub_process
namespace is intended to allow to define overrides which should target specific inputs to set to a custom value. If that value is in a nested namespace, it should not replace the entire namespace, but just merge the overrides in. This PR onaiida-core
implements theProcessBuilderNamespace._merge
method which will do exactly this. It will be shipped with v2.0 at which point we can use this here. Until then, the current behavior of thesub_process
input namespace is bugged, and if we want to fix it now, we have to do the recursion ourselves, until we drop support foraiida-core==1.*
. Or if this is a pain, someone could backport the_merge
feature onaiida-core==1.6.*
.The text was updated successfully, but these errors were encountered: