Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A proposal reference on the docstring style.
I tried cleaning up the
model.py
docstrings a bit, following the google docstring style, to use this file as a reference (model.py
seemed to have the most consistent docstrings already).Alternative docstring styles are
(see here for some examples)
In my opinion, the google style is the most readable. But open to other proposals.
A decision which still needs to be made, regards the use of backticks. Single backticks render as italic text, double render as inline code. In some of our docstrings we use single where double would actually be more appropriate. There is an option in sphinx to render both as inline code, fixing the rendering without needing to change all out backtick use. But as included in this example template, it can still be useful to be able to make a distinction between the two. E.g.
.pickle
file format is referenced somewhere. We want to highlight it, but not make it an inline code. So single backtick makes it italic.So a proposal:
:func:`SolverLookup.solvernames() <cpmpy.solvers.utils.SolverLookup.solvernames>
.. code-block:: python
when not inline)(default: ...)
at the end of the argument description has already been used quite consistently, so we could stick with that styleWill add these guidelines to the wiki (and update them with any feedback provided here)