René's URL Explorer Experiment


Title: Time response data class by murrayrm · Pull Request #649 · python-control/python-control · GitHub

Open Graph Title: Time response data class by murrayrm · Pull Request #649 · python-control/python-control

X Title: Time response data class by murrayrm · Pull Request #649 · python-control/python-control

Description: This PR adds a TimeResponseData class, following the discussion in #645, which provides a more object-oriented approach to the representation of time response data. All time responses functions now return an instance of TimeResponseData containing the results of simulations. The class implements an __iter__ method that allows backward compatibility with current call signatures. Old approach (still works): t, y = ct.step_response(siso_sys) plt.plot(t, y) t, y = ct.step_response(mimo_sys) plt.plot(t, y[0, 1], label="input 1 to output 0") plt.plot(t, y[1, 1], label="input 1 to output 1") New approach: response = ct.step_response(siso_sys) plt.plot(response.time, response.outputs) response = ct.step_response(mimo_sys) plt.plot(response.time, response.outputs[0, 1], label="input 1 to output 0") plt.plot(response.time, response.outputs[1, 1], label="input 1 to output 1") The attributes time, outputs, states and inputs are actually class properties that carry out "squeeze processing" allowing use of 1D arrays for SISO systems. Time response data can also be accessed via the attributes t, y, x, and u, which are always in "MIMO" format (indexed by output, input (trace), and time: response = ct.step_response(siso_sys) plt.plot(response.t, response.y[0, 0]) Other notes: I adopted the terminology of a "trace" to handle the time response data returned by step_response and impulse_response, where a MIMO system generates a full matrix of input/output responses. The output, state, and input responses for those functions are represented by a 3D array indexed by output/state/input, trace, and time. The terminology for time, outputs, states and inputs was chosen to be consistent with the OptimalControlResult class. This is implemented via a set of properties that perform the squeeze (and transpose) processing to provide compatibility with our existing functionality. The InputOutputData class is currently only used to store the output of simulations, but it is set up to serve as a pure data representation class (similar to FrequencyResponseData) and could later be useful for things like input to system identification routines. No changes to existing unit tests were needed => should be fully backwards compatible. At a future date, we may want to consider adding some additional functionality: Plot methods that plot input/output simulations in a uniform way Methods to convert data into DataFrame format for use of pandas plotting capabilities I'm still not completely sure if this is a useful PR, but I was motivated by the way a similar approach taken in JuliaControl and thought I would give it a try. Suggestions and comments welcome (will leave in draft form for a bit to allow for discussion).

Open Graph Description: This PR adds a TimeResponseData class, following the discussion in #645, which provides a more object-oriented approach to the representation of time response data. All time responses functions no...

X Description: This PR adds a TimeResponseData class, following the discussion in #645, which provides a more object-oriented approach to the representation of time response data. All time responses functions no...

Opengraph URL: https://github.com/python-control/python-control/pull/649

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:52eebbd0-8606-faec-c177-13e033e20d40
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8728:2258EB:F3B9C8:15690C0:6979D64D
html-safe-nonceb5cec8cfbc67d75c3626ec4545bc445f45c80d0b4894d099a928e006d276317d
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NzI4OjIyNThFQjpGM0I5Qzg6MTU2OTBDMDo2OTc5RDY0RCIsInZpc2l0b3JfaWQiOiI0NzgyNTMyMTAxMTc1NjI5Mzg5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacb079cc05371f8d18418fc5aea458c9e912ad179c6ece6553a348161c71a8b047
hovercard-subject-tagpull_request:720197942
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python-control/python-control/pull/649/files
twitter:imagehttps://avatars.githubusercontent.com/u/293362?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/293362?s=400&v=4
og:image:altThis PR adds a TimeResponseData class, following the discussion in #645, which provides a more object-oriented approach to the representation of time response data. All time responses functions no...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonec049b65ec7e54cbf2521f5a560b6527714c612b0bd169188e2ea6e16f83bd5f4
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/python-control/python-control git https://github.com/python-control/python-control.git
octolytics-dimension-user_id2285872
octolytics-dimension-user_loginpython-control
octolytics-dimension-repository_id22791752
octolytics-dimension-repository_nwopython-control/python-control
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id22791752
octolytics-dimension-repository_network_root_nwopython-control/python-control
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseaa81cb94735f56e8afe352515e35f16bd5c0018b
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python-control/python-control/pull/649/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-control%2Fpython-control%2Fpull%2F649%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-control%2Fpython-control%2Fpull%2F649%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python-control%2Fpython-control
Reloadhttps://github.com/python-control/python-control/pull/649/files
Reloadhttps://github.com/python-control/python-control/pull/649/files
Reloadhttps://github.com/python-control/python-control/pull/649/files
python-control https://github.com/python-control
python-controlhttps://github.com/python-control/python-control
Notifications https://github.com/login?return_to=%2Fpython-control%2Fpython-control
Fork 447 https://github.com/login?return_to=%2Fpython-control%2Fpython-control
Star 2k https://github.com/login?return_to=%2Fpython-control%2Fpython-control
Code https://github.com/python-control/python-control
Issues 87 https://github.com/python-control/python-control/issues
Pull requests 8 https://github.com/python-control/python-control/pulls
Discussions https://github.com/python-control/python-control/discussions
Actions https://github.com/python-control/python-control/actions
Projects 0 https://github.com/python-control/python-control/projects
Wiki https://github.com/python-control/python-control/wiki
Security 0 https://github.com/python-control/python-control/security
Insights https://github.com/python-control/python-control/pulse
Code https://github.com/python-control/python-control
Issues https://github.com/python-control/python-control/issues
Pull requests https://github.com/python-control/python-control/pulls
Discussions https://github.com/python-control/python-control/discussions
Actions https://github.com/python-control/python-control/actions
Projects https://github.com/python-control/python-control/projects
Wiki https://github.com/python-control/python-control/wiki
Security https://github.com/python-control/python-control/security
Insights https://github.com/python-control/python-control/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fpython-control%2Fpython-control%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython-control%2Fpython-control%2Fissues%2Fnew%2Fchoose
bnavigatorhttps://github.com/bnavigator
python-control:masterhttps://github.com/python-control/python-control/tree/master
murrayrm:timeresponse_classhttps://github.com/murrayrm/python-control/tree/timeresponse_class
Conversation 8 https://github.com/python-control/python-control/pull/649
Commits 14 https://github.com/python-control/python-control/pull/649/commits
Checks 0 https://github.com/python-control/python-control/pull/649/checks
Files changed https://github.com/python-control/python-control/pull/649/files
Please reload this pagehttps://github.com/python-control/python-control/pull/649/files
Time response data class https://github.com/python-control/python-control/pull/649/files#top
Show all changes 14 commits https://github.com/python-control/python-control/pull/649/files
ab59657 initial class definition (as passthru) murrayrm Aug 21, 2021 https://github.com/python-control/python-control/pull/649/commits/ab59657202413e03072790787cc495a60330e083
bb12598 Update timeresp, iosys to return InputOutputResponse, with properties murrayrm Aug 21, 2021 https://github.com/python-control/python-control/pull/649/commits/bb1259874545c84ae7ba82fc156bcfd0dd84483d
724d1df all time response functions return InputOutput response object murrayrm Aug 21, 2021 https://github.com/python-control/python-control/pull/649/commits/724d1dfebc09b5768ddb52482bc1c88795d70f0a
85231b5 move I/O processing to property functions murrayrm Aug 22, 2021 https://github.com/python-control/python-control/pull/649/commits/85231b59b0f66ef48d0abc5b38b780b680386c50
3bc9871 update naming conventions + initial unit tests murrayrm Aug 23, 2021 https://github.com/python-control/python-control/pull/649/commits/3bc9871c2196a3399c87d05962cc8df64f3b9edb
44274c3 update names and clean up zero input/state and single trace processing murrayrm Aug 25, 2021 https://github.com/python-control/python-control/pull/649/commits/44274c3250fd9b42aca29f71abcbd9c94dfdd94d
97ae02b clean up trace processing + shape checks murrayrm Aug 25, 2021 https://github.com/python-control/python-control/pull/649/commits/97ae02b27be12748c5ef64a249f13890e814d7f8
bab117d clean up _process_time_response + use ndim murrayrm Aug 25, 2021 https://github.com/python-control/python-control/pull/649/commits/bab117dbc63597f8ea8098ea785d3da365b28c99
7e116f0 clean up siso processing, remove internal property calls murrayrm Aug 25, 2021 https://github.com/python-control/python-control/pull/649/commits/7e116f048ad6fa3e6b7985be3e2302982551d2eb
ea45b03 documentation cleanup/additions + PEP8 murrayrm Aug 26, 2021 https://github.com/python-control/python-control/pull/649/commits/ea45b032c77615403b8d827e275942ec6a903e4d
03f0e28 docstring and signature tweaks murrayrm Aug 26, 2021 https://github.com/python-control/python-control/pull/649/commits/03f0e28b804c004512f149d0aceb7efecbd9cf75
8aa68eb move input/output processing and add __call__ to change keywords murrayrm Aug 26, 2021 https://github.com/python-control/python-control/pull/649/commits/8aa68ebd92bb104e85d9baf1c3c54eed760b8172
ce5a95c consistent squeezing for state property + legacy interface + doc updates murrayrm Aug 26, 2021 https://github.com/python-control/python-control/pull/649/commits/ce5a95c317382c95baedec1517ef3cb2db8709c0
136d6f4 add signal labels + more unit tests/coverage + docstring tweaks murrayrm Aug 28, 2021 https://github.com/python-control/python-control/pull/649/commits/136d6f4fe5e3ff4634dd5a8701d02f6ea744422f
Clear filters https://github.com/python-control/python-control/pull/649/files
Please reload this pagehttps://github.com/python-control/python-control/pull/649/files
Please reload this pagehttps://github.com/python-control/python-control/pull/649/files
iosys.py https://github.com/python-control/python-control/pull/649/files#diff-12b378d96d36c9d59a9fbc5afbc7cc158d153ff7591b4769f8312772e1d74ed1
optimal.py https://github.com/python-control/python-control/pull/649/files#diff-19ca2bf58874b6519164f42d62448fdcc1e05efe2b45263f6761f39392cdde01
statesp.py https://github.com/python-control/python-control/pull/649/files#diff-b5aac033a6dd07653e82d9f5a40afaa775010c2d2d5af8beeb159487b566df72
timeresp_test.py https://github.com/python-control/python-control/pull/649/files#diff-ecf5a23a5f3aa1be4faff8673255c1610fd61b011b8ed010e1dc1497e3d8a9b1
trdata_test.py https://github.com/python-control/python-control/pull/649/files#diff-ed6c733b7c1a545372efca829ca62919b9947eec7d48edaa931922024c42c729
timeresp.py https://github.com/python-control/python-control/pull/649/files#diff-3200453f1cf62f183f04dbf39d1129d91245c53a9f74675cee6bd384351c45b4
classes.rst https://github.com/python-control/python-control/pull/649/files#diff-7ace42a025609df89447e9513968d95b8191259149e34bb7d088987aa28ec85e
conventions.rst https://github.com/python-control/python-control/pull/649/files#diff-04f5af9adedfe548dc7beedc5952a1aff00fb279a868e337028b2487e655e2f4
control/iosys.pyhttps://github.com/python-control/python-control/pull/649/files#diff-12b378d96d36c9d59a9fbc5afbc7cc158d153ff7591b4769f8312772e1d74ed1
View file https://github.com/murrayrm/python-control/blob/136d6f4fe5e3ff4634dd5a8701d02f6ea744422f/control/iosys.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python-control/python-control/pull/649/{{ revealButtonHref }}
https://github.com/python-control/python-control/pull/649/files#diff-12b378d96d36c9d59a9fbc5afbc7cc158d153ff7591b4769f8312772e1d74ed1
https://github.com/python-control/python-control/pull/649/files#diff-12b378d96d36c9d59a9fbc5afbc7cc158d153ff7591b4769f8312772e1d74ed1
https://github.com/python-control/python-control/pull/649/files#diff-12b378d96d36c9d59a9fbc5afbc7cc158d153ff7591b4769f8312772e1d74ed1
https://github.com/python-control/python-control/pull/649/files#diff-12b378d96d36c9d59a9fbc5afbc7cc158d153ff7591b4769f8312772e1d74ed1
https://github.com/python-control/python-control/pull/649/files#diff-12b378d96d36c9d59a9fbc5afbc7cc158d153ff7591b4769f8312772e1d74ed1
https://github.com/python-control/python-control/pull/649/files#diff-12b378d96d36c9d59a9fbc5afbc7cc158d153ff7591b4769f8312772e1d74ed1
https://github.com/python-control/python-control/pull/649/files#diff-12b378d96d36c9d59a9fbc5afbc7cc158d153ff7591b4769f8312772e1d74ed1
https://github.com/python-control/python-control/pull/649/files#diff-12b378d96d36c9d59a9fbc5afbc7cc158d153ff7591b4769f8312772e1d74ed1
https://github.com/python-control/python-control/pull/649/files#diff-12b378d96d36c9d59a9fbc5afbc7cc158d153ff7591b4769f8312772e1d74ed1
https://github.com/python-control/python-control/pull/649/files#diff-12b378d96d36c9d59a9fbc5afbc7cc158d153ff7591b4769f8312772e1d74ed1
https://github.com/python-control/python-control/pull/649/files#diff-12b378d96d36c9d59a9fbc5afbc7cc158d153ff7591b4769f8312772e1d74ed1
https://github.com/python-control/python-control/pull/649/files#diff-12b378d96d36c9d59a9fbc5afbc7cc158d153ff7591b4769f8312772e1d74ed1
https://github.com/python-control/python-control/pull/649/files#diff-12b378d96d36c9d59a9fbc5afbc7cc158d153ff7591b4769f8312772e1d74ed1
control/optimal.pyhttps://github.com/python-control/python-control/pull/649/files#diff-19ca2bf58874b6519164f42d62448fdcc1e05efe2b45263f6761f39392cdde01
View file https://github.com/murrayrm/python-control/blob/136d6f4fe5e3ff4634dd5a8701d02f6ea744422f/control/optimal.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python-control/python-control/pull/649/{{ revealButtonHref }}
https://github.com/python-control/python-control/pull/649/files#diff-19ca2bf58874b6519164f42d62448fdcc1e05efe2b45263f6761f39392cdde01
https://github.com/python-control/python-control/pull/649/files#diff-19ca2bf58874b6519164f42d62448fdcc1e05efe2b45263f6761f39392cdde01
https://github.com/python-control/python-control/pull/649/files#diff-19ca2bf58874b6519164f42d62448fdcc1e05efe2b45263f6761f39392cdde01
https://github.com/python-control/python-control/pull/649/files#diff-19ca2bf58874b6519164f42d62448fdcc1e05efe2b45263f6761f39392cdde01
control/statesp.pyhttps://github.com/python-control/python-control/pull/649/files#diff-b5aac033a6dd07653e82d9f5a40afaa775010c2d2d5af8beeb159487b566df72
View file https://github.com/murrayrm/python-control/blob/136d6f4fe5e3ff4634dd5a8701d02f6ea744422f/control/statesp.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python-control/python-control/pull/649/{{ revealButtonHref }}
https://github.com/python-control/python-control/pull/649/files#diff-b5aac033a6dd07653e82d9f5a40afaa775010c2d2d5af8beeb159487b566df72
https://github.com/python-control/python-control/pull/649/files#diff-b5aac033a6dd07653e82d9f5a40afaa775010c2d2d5af8beeb159487b566df72
control/tests/timeresp_test.pyhttps://github.com/python-control/python-control/pull/649/files#diff-ecf5a23a5f3aa1be4faff8673255c1610fd61b011b8ed010e1dc1497e3d8a9b1
View file https://github.com/murrayrm/python-control/blob/136d6f4fe5e3ff4634dd5a8701d02f6ea744422f/control/tests/timeresp_test.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python-control/python-control/pull/649/{{ revealButtonHref }}
https://github.com/python-control/python-control/pull/649/files#diff-ecf5a23a5f3aa1be4faff8673255c1610fd61b011b8ed010e1dc1497e3d8a9b1
https://github.com/python-control/python-control/pull/649/files#diff-ecf5a23a5f3aa1be4faff8673255c1610fd61b011b8ed010e1dc1497e3d8a9b1
Please reload this pagehttps://github.com/python-control/python-control/pull/649/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.