Skip to content
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

Add documentation of the python Workflow classes to the docs using autodoc #147

Open
elinscott opened this issue May 31, 2022 · 0 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@elinscott
Copy link
Collaborator

See here for details of the autodoc extension.

Will require us to tidy up the docstrings of these classes

@elinscott elinscott added the documentation Improvements or additions to documentation label May 31, 2022
@elinscott elinscott self-assigned this May 31, 2022
elinscott added a commit that referenced this issue Jul 14, 2022
### 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant