-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The load_protocol_file method in the protocol utils.py module uses the path of the module file to obtain the path to the .yaml file that described the protocols. However, this fails in case the `ProtocolMixin` class is used by other packages, since the protocol files of the package's work chains will be stored in that package. Moreover, the user can only adapt the protocol by specifying `overrides` as a dictionary, or adapting the builder afterwards. Here we adapt the `ProtocolMixin` class as follows: * Add a `get_protocol_filepath()` class method that needs to be implemented by the work chain classes that use the `ProtocolMixin`. * Move the `load_protocol_file` method into the `ProtocolMixin` class as a hidden method that relies on the `get_protocol_filepath` method. * The `get_protocol_inputs` method is made more flexible by accepting a `pathlib.Path` for the `overrides` input. This allows the user to define protocol overrides in a `.yaml` file. The `Path` to the hardcoded protocols that ship with the package are now also obtained using `importlib_resources`.
- Loading branch information
Showing
6 changed files
with
62 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters