BMSpy
BMSpy copied to clipboard
Create a CONTRIBUTING file (or include contributing info on README)
Hey there, back again!
Seeing as there are at least three different contributors to the project, it would be nice if there was a guideline for contributing to the project, such as docstring styles, formatting, and other stuff. Seeing as you are the owner of the project, I believe it would be best if you decided on it. If you want, I can write one based on what you decide. Making the project follow a certain standard makes it easier for new contributors to get used to the code.
Things like spacing between operators and values, tabs-vs-spaces, maximum number of characters per line, could be included.
Regarding docstrings, I'm partial to the following style, using Google docstring formatting and .. math
for displaying formulas:
class Saturation(Block):
"""Defines a saturation block.
.. math::
output =
\\begin{cases}
min\_value, & \\textrm{if } input < min\_value
max\_value, & \\textrm{if } input > max\_value
input, & \\textrm{if } min\_value \leq input \leq max\_value
\\end{cases}
Args:
input_variable (Variable): This is the input of the block.
output_variable (Variable): This is the output of the block.
min_value: This is the lower bound for the output.
max_value: This is the upper bound for the output.
"""
Thanks for the suggestion. For docstrings do you know if this format is recognized by sphinx?
I have added the necessary option to the sphinx Makefile, so it renders it beautifully. As can be seen in the generated documentation for the Saturation block here.