Title: Allow signal names to be used for time/freq responses and subsystem indexing by murrayrm · Pull Request #1069 · python-control/python-control · GitHub
Open Graph Title: Allow signal names to be used for time/freq responses and subsystem indexing by murrayrm · Pull Request #1069 · python-control/python-control
X Title: Allow signal names to be used for time/freq responses and subsystem indexing by murrayrm · Pull Request #1069 · python-control/python-control
Description: This PR adds the ability to access response signals and subsystem inputs and outputs using signal names. As described in the documentation: Time signal indexing: The input, output, and state elements of the response can be access using signal names in place of integer offsets:: plt.plot(response. time, response.states['x[1]'] For multi-trace systems generated by :func:step_response and :func:impulse_response, the input name used to generate the trace can be used to access the appropriate input output pair:: plt.plot(response.time, response.outputs['y[0]', 'u[1]']) Frequency response indexing: Frequency response objects are also available as named properties of the response object: response.magnitude, response.phase, and response.response (for the complex response). For MIMO systems, these elements of the frequency response can be accessed using the names of the inputs and outputs:: response.magnitude['y[0]', 'u[1]'] where the signal names are based on the system that generated the frequency response. Subsystem indexing: Subsets of input/output pairs for LTI systems can be obtained by indexing the system using either numerical indices (including slices) or signal names:: subsys = sys[[0, 2], 0:2] subsys = sys[['y[0]', 'y[2]'], ['u[0]', 'u[1]']] Signal names for an indexed subsystem are preserved from the original system and the subsystem name is set according to the values of control.config.defaults['iosys.indexed_system_name_prefix'] and control.config.defaults['iosys.indexed_system_name_suffix']`. The default subsystem name is the original system name with '$indexed' appended. Summary of changes: Signals are now returned as a NamedSignal object, which is a subclass of np.ndarray that overrides the __getitem__ method to allow processing of signal names via the _parse_key method. All signal/subsystem indexing now allows integers, strings (new), lists of integers or strings (new), or slices. Refactored code for processing signal names to make everything consistent across time and frequency domain signals as well as state and input/output vectors. See iosys.NamedSignal._parse_key and changes in frdata.py and timeresp.py. Refactored code for processing subsystem indices and made index processing consistent for StateSpace, TransferFunction, and FrequencyResponseData systems. See iosys._process_subsys_index and changes in frdata.py, statesp.py, and xferfcn.py. Unit tests, docstrings, and user documentation updated to cover new functiionality.
Open Graph Description: This PR adds the ability to access response signals and subsystem inputs and outputs using signal names. As described in the documentation: Time signal indexing: The input, output, and state elem...
X Description: This PR adds the ability to access response signals and subsystem inputs and outputs using signal names. As described in the documentation: Time signal indexing: The input, output, and state elem...
Opengraph URL: https://github.com/python-control/python-control/pull/1069
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:b3eb7199-0725-421d-5417-380316de2cd2 |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | AEC8:1DF41E:166A8D3:1E73B4A:697A9516 |
| html-safe-nonce | c4486c2d3644c6dbcb821c5cd457ba1ccbf77fab7f5cd8671c6beab1868f4df0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRUM4OjFERjQxRToxNjZBOEQzOjFFNzNCNEE6Njk3QTk1MTYiLCJ2aXNpdG9yX2lkIjoiNjYyNTI5OTYyMjA5NDYwNzYzOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 86b3966f274d27c659310e9c42b38270b920c6183d3a507c4fd93faf1b8e8e32 |
| hovercard-subject-tag | pull_request:2209131361 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python-control/python-control/pull/1069/checks |
| twitter:image | https://avatars.githubusercontent.com/u/293362?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/293362?s=400&v=4 |
| og:image:alt | This PR adds the ability to access response signals and subsystem inputs and outputs using signal names. As described in the documentation: Time signal indexing: The input, output, and state elem... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0912f2a9aa0160e08239520d461a4b4c4ce1caa972a8370b7442b94a38a194c5 |
| turbo-cache-control | no-cache |
| go-import | github.com/python-control/python-control git https://github.com/python-control/python-control.git |
| octolytics-dimension-user_id | 2285872 |
| octolytics-dimension-user_login | python-control |
| octolytics-dimension-repository_id | 22791752 |
| octolytics-dimension-repository_nwo | python-control/python-control |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 22791752 |
| octolytics-dimension-repository_network_root_nwo | python-control/python-control |
| turbo-body-classes | logged-out env-production page-responsive full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f8f5270c10a913bfa56f2dad4b864f1cda383754 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width