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

Improve some docstrings #177

Open
natema opened this issue Nov 20, 2022 · 7 comments
Open

Improve some docstrings #177

natema opened this issue Nov 20, 2022 · 7 comments
Labels
documentation Improvements or additions to documentation

Comments

@natema
Copy link
Member

natema commented Nov 20, 2022

Returns the value of a function with input `x`, by linearly interpolating the function itself through the table `yvalues` and the range `xrange`. If `x` is out of the range, the value at the corresponding extremity is returned. This function corresponds to the `TABHL` function in the `DYNAMO` language. This latter function receives a table (that is, `yvalues`), a value (that is, `x`), a left and a right extreme of an interval (that is, `xrange`), and an increment value.

  • What about enforcing one-line-per-sentence in docstrings?
  • The definition of interpolate is unclear and can be improved, in particular when we say by linearly interpolating the function itself through the table.
  • The docstring of the Interpolate single value is missing.
@natema natema added the documentation Improvements or additions to documentation label Nov 20, 2022
@paulobruno
Copy link
Collaborator

What about enforcing one-line-per-sentence in docstrings?

The common approach is to enforce at most 80 characters. I'm fine with 80 chars.

The docstring of the Interpolate single value is missing

Do we need it? It's no supposed to be public.
Maybe adding an underscore to follow the common "private" functions pattern. What do you think?

@natema
Copy link
Member Author

natema commented Nov 21, 2022

I agree with underscore with no docstrings.
I'm also fine with the 80 char limit if that's more common, even though one-sentence-per-line should be easier to diff.

@paulobruno
Copy link
Collaborator

paulobruno commented Nov 22, 2022

Yes, one sentence per line is better to diff, which is very useful for text files, like readme and latex.

@natema
Copy link
Member Author

natema commented Nov 22, 2022

Does it mean you agree with adopting that convention in docstrings?

@paulobruno
Copy link
Collaborator

The case of code and docstrings is that some things, like old terminal versions and Julia documentation renderer, trim the text.
In this case, we should go for the 80 chars limitation.

@natema
Copy link
Member Author

natema commented Nov 22, 2022

Julia doesn't trim the text.
I don't know what terminals still used today do.

@natema
Copy link
Member Author

natema commented Nov 22, 2022

Ah sorry I read it too fast, you mean code blocks displayed in the documentation pages... right.

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

2 participants