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

Create a CONTRIBUTING file (or include contributing info on README) #20

Open
ericonr opened this issue Mar 24, 2019 · 2 comments
Open

Comments

@ericonr
Copy link
Contributor

ericonr commented Mar 24, 2019

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.
    """
@masfaraud
Copy link
Owner

Thanks for the suggestion. For docstrings do you know if this format is recognized by sphinx?

@ericonr
Copy link
Contributor Author

ericonr commented Apr 7, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants