-
Notifications
You must be signed in to change notification settings - Fork 439
Update docstrings for LTI class constructors #171
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
Update docstrings for LTI class constructors #171
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
converting
control/margins.py
Outdated
@@ -338,7 +336,9 @@ def phase_crossover_frequencies(sys): | |||
|
|||
|
|||
def margin(*args): | |||
"""Calculate gain and phase margins and associated crossover frequencies | |||
"""margin(sys) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
, andFRD
constructors are documented. In this PR, the first line of the docstring is modified for the each of the above classes, as well as theirinit
methods and the correspondingss
,tf
, andfrd
functions 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.