-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automatically generate docstring for each existing and newly written …
…processes (#67) * Automatically generates a docstring for each existing and newly written process, if autodoc=True in the process decorator. * Update autodoc to deal with pytest * Reorganize how docstring is generated/incorporated The formatting of the docstring has been outsourced to a separate function in formatting.add_attribute_section(). This way, the render_docstrings() only needs to call that function and pass its return to the __doc__ attribute of the base class (and subclasses). There are more suggestions in the PR but I had the impression that it's beneficial to update the recent code. * Set conditional string assignment, wrap variable description For readability, variable description in var_details() now assigned with a separate conditional expression. To account for indents in the docstring, variable description is now wrapped after 62 characters. * explicit if-clause * Include a test for `add_attribute_section()` With this commit, a test for the autodoc-feature will be implemented. For now, however, pytest returns an AssertionError because `add_attribute_section()` in `test_add_attribute_section()` returns the docstring twice. Reason unknown. Also, `@pytest.mark.xfail` was introduced to circumvent failures in `test_process_decorator()` and `test_add_attribute_section()`. This will be only temporary. * Align recent changes of master with autodoc Fork is now synched with latest commit 1d995b4 of original repo. whats_new.rst has been updated. Placeholder and if-clause if no description has been given for individual variables. Docstring for `process.process.py` has been updated. Lastly, tests included for `add_attribute_section()` and `process_decorator()` in `test_formatting` and `test_process`, respectively. * Added parameter note for test_add_attribute_section() * Rewrite whats_new.rst and xsimlab.process docstring
- Loading branch information
Showing
5 changed files
with
104 additions
and
13 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