Skip to content

Documentation updates #633

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

Merged
merged 7 commits into from
Jun 16, 2021
Merged

Conversation

murrayrm
Copy link
Member

This PR updates the documentation to resolve issue #604 and #631:

  • The docstring description for the updfcn and outfcn parameters for NonlinearIOSystem has been updated to reflect the fact that the param argument is required (issue update documentation for iosys/updfcn to indicate param is not optional #631; see also discussion Using a class method in a NonlinearIOSystem #630).

  • The sphinx documentation for classes has been modified so that the __call__ method is now included in the documentation when it exists (issue __call__ and other new methods not described in sphinx docs #604). This required updating the sphinx conf.py file to allow special member functions to be included. I also put information in the class docstrings for transfer functions and state space systems about calling these objects to get the frequency response.

  • The docstrings for classes yave been updated so that the sphinx documentation is now more uniform. The documentation for constructor arguments and attributes are now included in the class documentation and the __init__ docstring is suppressed in the sphinx-generated documentation (prior to this, it was sometimes in the class docstring and comes in the __init__ docstring). This change also allows the unwanted documentation of the deprecated input, output, and state attributes to be omitted (part of issue __call__ and other new methods not described in sphinx docs #604).

  • Various other PEP8 and consistency issues were addressed.

These changes required some refactoring the code, in particular in the use of the property decorator. I also changed some of the internal class attributes to be hidden attributes (names starting with underscore) since otherwise they show up in the documentation.

The best way to see the impact of these changes is to look at the compiled documentation. You can find a version here.

@coveralls
Copy link

coveralls commented Jun 13, 2021

Coverage Status

Coverage increased (+0.03%) to 89.658% when pulling 866a07c on murrayrm:docstring_updates into 9f27293 on python-control:master.

Copy link
Contributor

@namannimmo10 namannimmo10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some typos to consider;

smooth : bool, optional
If ``True``, create an interpoloation function that allows the
frequency response to be computed at any frequency within the range of
frquencies give in ``w``. If ``False`` (default), frequency response
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
frquencies give in ``w``. If ``False`` (default), frequency response
frequencies give in ``w``. If ``False`` (default), frequency response

w : iterable of real frequencies
List of frequency points for which data are available.
smooth : bool, optional
If ``True``, create an interpoloation function that allows the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If ``True``, create an interpoloation function that allows the
If ``True``, create an interpolation function that allows the

ninputs, noutputs, nstates : int
Number of input, output and state variables.
num, den : 2D list of array
Polynomial coeffients of the numerator and denominator.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Polynomial coeffients of the numerator and denominator.
Polynomial coefficients of the numerator and denominator.

Comment on lines 145 to 146
>>> s = TransferFunction.s
>>> G = (s + 1)/(s**2 + 2*s + 1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
>>> s = TransferFunction.s
>>> G = (s + 1)/(s**2 + 2*s + 1)
>>> s = TransferFunction.s
>>> G = (s + 1)/(s**2 + 2*s + 1)

Copy link
Contributor

@bnavigator bnavigator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an inconsistency in the TOC tree:

  • Differentially flat Systems
    • Module classes and functions
      • Flat system classes
        • control.flatsys.BasisFamily
        • ...
      • Flat system functions
  • Input/output systems
    • Module classes and functions
      • Input/output system classes -> Table with links to *Control system classes >> *
  • Describing functions
    • Module classes and functions
      • control.DescribingFunctionNonlinearity
      • ...
  • Optimal control
    • Module classes and functions
      • control.optimal.OptimalControlProblem
      • ...

Copy link
Contributor

@bnavigator bnavigator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just another typo:

@murrayrm murrayrm force-pushed the docstring_updates branch from 7b81723 to f4b09b6 Compare June 15, 2021 15:10
@murrayrm murrayrm force-pushed the docstring_updates branch from f4b09b6 to 866a07c Compare June 15, 2021 15:10
@murrayrm murrayrm merged commit da27d35 into python-control:master Jun 16, 2021
@murrayrm murrayrm deleted the docstring_updates branch November 25, 2021 22:06
@murrayrm murrayrm added this to the 0.9.1 milestone Dec 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants