-
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
BaseRestartWorkChain
: allow to override priority in handler_overrides
#5546
BaseRestartWorkChain
: allow to override priority in handler_overrides
#5546
Conversation
Still want to add docs to this as the |
@sphuber Thanks a lot. Happy to add docs. Where should it go? |
instance method of the `process_class` that has been decorated with the `process_handler` decorator. The values | ||
should be boolean. | ||
The ``handler_overrides`` should be a dictionary where keys are strings that are the name of a process handler, i.e. | ||
an instance method of the `process_class` that has been decorated with the `process_handler` decorator. The values |
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.
Should process_handler
still be in single quotes?
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, missed that one. Fixed now.
…des` The `handler_overrides` could so far be used to override the `enabled` keyword of the corresponding handler. This would allow to disable or enable a handler on a per process instance basis. A user may want to do the same for the `priority`. To make this possible the type of the `handler_overrides` is changed where the values should now be dictionaries where the keys `enabled` and `priority` are supported. These can be used to override the original values declared in the source code of the work chain. To provide backwards-compatibility, the old syntax is still supported and automatically converted, with a deprecation warning being displayed.
0f686e2
to
8df037a
Compare
Thanks for the review @espenfl . I actually noticed there was a subtle bug that wasn't being tested for. The initial implementation would actually affect the handlers for multiple executions and not just the single instance. This is now fixed and explicitly tested. I have also added the docs. |
Fixes #5545
The
handler_overrides
could so far be used to override theenabled
keyword of the corresponding handler. This would allow to disable or
enable a handler on a per process instance basis.
A user may want to do the same for the
priority
. To make this possiblethe type of the
handler_overrides
is changed where the values shouldnow be dictionaries where the keys
enabled
andpriority
aresupported. These can be used to override the original values declared
in the source code of the work chain.
To provide backwards-compatibility, the old syntax is still supported
and automatically converted, with a deprecation warning being displayed.