-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simpler Workflow instantiation (#158)
### Workflow instantiation Makes the creation of `Workflow` objects more flexible by accepting `kwargs` that can be workflow/calculator/plotting parameters e.g. ``` wf = SinglepointWorkflow(atoms, functional='ki', ecutwfc=40.0) ``` whereas previously this would have to be ``` wf = SinglepointWorkflow(atoms, parameters={'functional': 'ki}, master_calc_params={'kcp': {'ecutwfc': 40.0}, 'pw': {'ecutwfc': 40}}) ``` Closes #145 ### Changes to running subworkflows This PR also introduces the `@classmethod` `fromparent` to the `Workflow` class and deprecated `Workflow.wf_kwargs` and `Workflow.run_subworkflow()`. Previously to create and run a subworkflow one had to do something like ``` subwf = Workflow(**self.kwargs) self.run_subworkflow(subwf) ``` but instead now we do ``` subwf = Workflow.fromparent(self) subwf.run() ``` which is cleaner and more pythonic ### Documentation Added the docstrings of the `Workflow` class to the docs module using `autodoc` and `numpydoc`. This starts to address (but does not fully resolve) #147
- Loading branch information
Showing
21 changed files
with
425 additions
and
225 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ Contents | |
theory | ||
installation | ||
running | ||
modules | ||
tutorials | ||
links | ||
references | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Modules | ||
======= | ||
|
||
In this section we document the various classes defined within the ``koopmans`` python package. | ||
|
||
The workflow module | ||
^^^^^^^^^^^^^^^^^^^ | ||
|
||
The central objects in ``koopmans`` are ``Workflow`` objects. We use these to define and run workflows, as described :ref:`here <running:Running via python>`. The workflow that runs most calculations is the ``SinglepointWorkflow``, defined as follows. | ||
|
||
|
||
.. autoclass:: koopmans.workflows.SinglepointWorkflow | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
sphinx>=3.0 | ||
sphinxcontrib-bibtex>=2.1.4 | ||
sphinx_toolbox>=2.5.0 | ||
sphinx_rtd_theme>=1.0.0 | ||
recommonmark>=0.7.1 | ||
numpydoc>=1.4.0 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
'Python module for running KI and KIPZ calculations with Quantum Espresso' | ||
from pathlib import Path | ||
|
||
__version__ = '0.5.0' | ||
__version__ = '0.6.0' | ||
base_directory = Path(__path__[0]).parent |
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
Oops, something went wrong.