GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — I/O system enhancements by murrayrm · Pull Request #1082 · python-control/python-control Conversation
|
|
coverage: 94.79% (+0.06%) from 94.73% |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
8888c03 to
e4d373c
Compare
|
I will finish reviewing this tomorrow |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I made several comments about misprints. Code appears to be correct. I am going to examine it a bit more in the morning.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| # | ||
| # List of arguments described in class docstrings | ||
| # | ||
| # These are the minimal arguments needed to initialized the class. Optional |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| # These are the minimal arguments needed to initialized the class. Optional | |
| # These are the minimal arguments needed to initialize the class. Optional |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| # List of attributes described in class docstrings | ||
| # | ||
| # This is the list of attributes for the class that are not already listed | ||
| # as parameters used to inialize the class. These should all be defined |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| # as parameters used to inialize the class. These should all be defined | |
| # as parameters used to initialize the class. These should all be defined |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| frequency : 1D array | ||
| Array of frequency points for which data are available. | ||
| ninputs, noutputs : int | ||
| Number of inputs and outputs signals. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| Number of inputs and outputs signals. | |
| Number of input and output signals. |
which is consistent with usage below (description of input_labels, output_labels), or could be "Number of inputs and outputs."
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| magnitude : array | ||
| Magnitude of the frequency response, indexed by frequency. | ||
| phase : array | ||
| Magnitude of the frequency response, indexed by frequency. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| Magnitude of the frequency response, indexed by frequency. | |
| Phase of the frequency response, indexed by frequency. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ----- | ||
| The attribues 'num' and 'den' are 2-D lists of arrays containing MIMO | ||
| numerator and denominator coefficients. For example, | ||
| The numerator and denominator polynomials are stored as 2D ndarray's |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| The numerator and denominator polynomials are stored as 2D ndarray's | |
| The numerator and denominator polynomials are stored as 2D ndarrays |
Style used in the NumPy documentation is "ndarrays" (no apostrophe); e.g., in https://numpy.org/doc/stable/user/basics.indexing.html and https://numpy.org/doc/stable/user/basics.creation.html.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| # | ||
| # Author: Richard M. Murray | ||
| # Date: 24 May 09 | ||
| # Revised: Kevin K. Chen, Dec 10 |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Outside the scope of this PR, but eventually we should consider removing comments with author names like this or add a note that
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I took a cut at this in the commit that is coming next. See what you think and we can fix things up globally (I have another PR in the works where I could do that).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I like your proposed change: it is concise and shows a simple command to get the list of authors.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| to prettier LaTeX representation """ | ||
| """Superscript all digits in a polynomial string and convert float | ||
| coefficients in scientific notation to prettier LaTeX | ||
| representation. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Docstring alignment is odd for this function.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| repr_format : str | ||
| String representation format ('iosys' or 'loadable'). |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Is there a repr_format attribute, or is this referring to __repr__? If the latter, I find it confusing to write "repr_format" in this list because it is not the name of an attribute. Also, note that __repr__ is a standard method described in the Python documentation, so probably OK to not document it here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I think this crept through from a separate PR that I am working on (and will show up next). Will delete from here (and one other spot where it shows up).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| # 13 Dec 2024: This now works correctly: creates static array (as tf) | ||
| # with pytest.raises(TypeError): | ||
| # TransferFunction([[0., 1.], [2., 3.]], [[5., 2.], [3., 0.]]) | ||
| # good input |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I recommend deleting this comment block (from "13 Dec..." to "good input"). The fact that this was previously tested as a known error is already recorded in commit history. If the goal with this comment is to notify users about the behavior change, then probably it will be easier to find in the next release announcement.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I'll remove this test completely, since it is now longer a "bad input type" (from the name of the test method).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| for arr in [num, den]: | ||
| for poly in np.nditer(arr, flags=['refs_ok']): | ||
| if poly.item().size > 1: | ||
| static = False |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| for arr in [num, den]: | |
| for poly in np.nditer(arr, flags=['refs_ok']): | |
| if poly.item().size > 1: | |
| static = False | |
| for arr in [num, den]: | |
| if not static: | |
| break | |
| for poly in np.nditer(arr, flags=['refs_ok']): | |
| if poly.item().size > 1: | |
| static = False | |
| break |
This is a small optimization: I noticed that after static = False is reached, the outer and inner loops can be exited immediately. For example, the system in the PR description:
s = ct.tf('s')
sys = ct.tf([[1/s, 0], [(s+1)/(s**2 + 2*s + 1), 1/(s+1)]])
results in several cases of needlessly reaching static = False more than once. However, I did not rigorously quantify the potential benefit, so OK to not do this.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Good catch.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Update coming in a bit to address these.
@slivingston Are you still reviewing, or is it OK to merge? (I have two more PR's coming that build on this one.)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@murrayrm Sorry for the delay. I am still reviewing but will be done in 30 minutes.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@murrayrm done now. There are 2 misprints and 1 bug. After handling these, ready to merge.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Great PR. Just came here to note that there is already an _isstatic method that is also short-circuiting. Can we use the same code for both - perhaps by moving the code to a separate function that tests num and den, and a method that calls it?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| lambda t, x, u, params: sys.A @ x + sys.B @ u, | ||
| lambda t, x, u, params: sys.C @ x + sys.D @ u, **kwargs) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| lambda t, x, u, params: sys.A @ x + sys.B @ u, | |
| lambda t, x, u, params: sys.C @ x + sys.D @ u, **kwargs) | |
| lambda t, x, u, params: sys_ss.A @ x + sys_ss.B @ u, | |
| lambda t, x, u, params: sys_ss.C @ x + sys_ss.D @ u, **kwargs) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This is a bug and needs to be fixed before merging.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Good catch on this. In the latest update, I added a unit test that catches the bug (and fixed the bug).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| params : dict, optional | ||
| System parameter values. By default, these will be copied from | ||
| `sys` and `ctrl`, but can be overriden with this keyword. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| `sys` and `ctrl`, but can be overriden with this keyword. | |
| `sys` and `ctrl`, but can be overridden with this keyword. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| ``ss(args, inputs=['u1', ..., 'up'], outputs=['y1', ..., 'yq'], states=['x1', ..., 'xn'])`` | ||
| ``ss(*args, inputs=['u1', ..., 'up'], outputs=['y1', ..., 'yq'], | ||
| states=['x1', ..., 'xn'])`` |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Splitting this in-line code expression across 2 lines breaks Sphinx processing, resulting in

Compare with the rendering of ss(A, B, C, D, dt) in the above image and the rendering of these in the current docs at https://python-control.readthedocs.io/en/0.10.1/generated/control.ss.html
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| for arr in [num, den]: | ||
| for poly in np.nditer(arr, flags=['refs_ok']): | ||
| if poly.item().size > 1: | ||
| static = False |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@murrayrm Sorry for the delay. I am still reviewing but will be done in 30 minutes.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.