Update docstrings for LTI class constructors#171
Update docstrings for LTI class constructors#171murrayrm merged 7 commits intopython-control:masterfrom
Conversation
|
Added more information to main documentation on class constructors + updated docstrings for other functions with variable arguments. The justification for including them in this PR is that they are consistent with the initial changes and the comments in PR #163. |
doc/conventions.rst
Outdated
|
|
||
| .. math:: | ||
|
|
||
| G(s) = \frac{\text{num}(s)}{\text{den(s)}} |
There was a problem hiding this comment.
in first case (s) is outside \text{}, in second case inside it.
doc/conventions.rst
Outdated
| Linear time invariant (LTI) systems are represented in python-control in | ||
| state space, transfer function, or frequency response data (FRD) form. Most | ||
| functions in the toolbox will operate on any of these data types and | ||
| functions for convering between between compatible types is provided. |
control/margins.py
Outdated
|
|
||
| def margin(*args): | ||
| """Calculate gain and phase margins and associated crossover frequencies | ||
| """margin(sys) |
There was a problem hiding this comment.
Just below (line 345) the name "sysdata" is used; perhaps that should be used here?
control/ctrlutil.py
Outdated
| # Hack for sphinx.ext.autodoc: if numpy is a mock import, then numpy.pi | ||
| # will be assigned to _Mock() and this generates a type error | ||
| if not isinstance(pi, float): | ||
| pi = 3.14 |
There was a problem hiding this comment.
how about "from math import pi" here? Or does that result in a mocked instance of some sort too?
There was a problem hiding this comment.
Much better fix since math is included in the base python distribution.
doc/conventions.rst
Outdated
| = \frac{a_0 s^n + a_1 s^{n-1} + \cdots + a_n} | ||
| {b_0 s^m + b_1 s^{m-1} + \cdots + b_m}, | ||
|
|
||
| where n is generally greater than m (for a proper transfer function). |
There was a problem hiding this comment.
maybe greater than or equal to?
|
Good feedback @roryyorke. Small updates pushed to address these. |
This PR addresses the documentation issues raised in PR #163 related to how the
StateSpace,TransferFunction, andFRDconstructors are documented. In this PR, the first line of the docstring is modified for the each of the above classes, as well as theirinitmethods and the correspondingss,tf, andfrdfunctions to have the most common call signature.This PR leaves in place the copy constructor functionality and only modifies the documentation.
While I was at it, I also fixed some indentation problems and other issues that were causing warnings in sphinx.