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 — Fixed InterconnectedSystems name bugs. by samlaf · Pull Request #400 · python-control/python-control Conversation
Contributor
3 fixes to InterconnectedSystem's init:
For example, if we Interconnected these two systems we would get Now instead, we get
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
bnavigator
requested changes
Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page. Co-authored-by: Ben Greiner <[email protected]>
bnavigator
reviewed
Uh oh!
There was an error while loading. Please reload this page. Co-authored-by: Ben Greiner <[email protected]> Only the outlist specification I am not sure. First, why can subsystem inputs be connected to system outputs? Then, why was the specification and code in __init__ different from that for the inplist? I changed it to match inplist, but left the weird subsystem input configuration. Check comment that starts with "Convert the output list to a matrix". …hon-control into interconnectedsystems
|
There was an error while loading. Please reload this page.
|
Coverage decreased (-0.2%) to 84.044% when pulling b2c8d44 on samlaf:interconnectedsystems into d3142ff on python-control:master. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Here's a short code snippet to visualize the signal names for different Connections: And the output after my last push:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@samlaf Can you add some unit tests to cover your new code and show that things are working? The examples that you have in your comment from 20 May would probably be fine. You might also try mixing named systems and named signals with unnamed systems/signals to make sure that nothing funny happens. And, as a harder test, try creating a system/signal with a name that would conflict with the default name (eg, create a system whose name is |
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 an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Should I be enforcing sys/signals names here? Wouldn't this render the API a bit too rigid (in case people want to change the naming conventions later, etc.) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| states = [] | ||
| for sys in sysobj_list: | ||
| states += [sys.name + '.' + statename for statename in sys.state_index.keys()] | ||
|
|
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 This is the part that would break if you add a named signal with a generic 'sys[i]' that will cause a conflict (it's no different from having two systems with the same name). The only "bad" thing that happens is that the system will be missing the state names of the systems with conflicting names (only the first 'sys[i].states' will be present).
Right now we are only raising a warning. As I mention in the comment, users can use sys.copy() first to create a unique name. Is this ok?
Edit: see the comment above this snippet of code... I'm new to this and not sure how to include it in the comment.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Co-authored-by: Ben Greiner <[email protected]>
Co-authored-by: Ben Greiner <[email protected]>
There was an error while loading. Please reload this page.
…hon-control into interconnectedsystems
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Unit tests are failing because no longer works. It seems like it should be possible to take two copies of a system and put them in series (which is what this does) without generating an error. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Co-authored-by: Ben Greiner <[email protected]>
…est conversation.
…hon-control into interconnectedsystems
|
Thank you for pointing this out @murrayrm, and thanks a lot to both of you two for your patience... newbie at work here. The system naming convention code should be fine now. Still need to write the signal name convention unit test though. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Looks like git got confused by the new unit test. I don't see any actual conflicts, but you may need to fiddle with things to allow the automatic merge check to work. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
It seems like a conflict between my branch and master branch? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
That's what it's saying, but what's odd is that I don't see the conflict. You added in a test and it shouldn't conflict with other tests. If you agree, I can try to fix it via the web interface and we'll see if that gets things running again. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sure, please do. I wouldn't know what to try anyways and would be scared to break other things. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I added the last unit tests. This is ready to be reviewed and hopefully should be close to done. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
The changes remove test coverage of the functions In fact, those functions are not used by the whole package anymore. But they are public API. So a unit test for them should be present. (I would personally prefer that they are created in the style of #438. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sure I can do that. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Yes, that is correct. The unit tests should make sure that using those functions results in the documented behavior. Previously, this was more or less implicit by the tests when |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
revert this commit when merging into or with python-control#400 and python-control#431
revert this commit when merging into or with python-control#400 and python-control#431
|
Hi @samlaf, if you still intend to update your PR with the requested unit tests, please do so based on the iosys_test.py in #438. We are discussing in #451 about the proper merge sequence, and #438 will likely be the first. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hi @bnavigator, I was planning on doing these, but I got major neck pain recently, and am spending some time away from the keyboard. Are you waiting on me to merge the other PRs? I'm not sure when I'll have time to write these, but if it's not a hurry I will eventually get to them. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
No hurry, get well soon! As I wrote, I removed the dependency in my PR so your PR can be merged later. Whenever you can get to it. You will have to rebase. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
revert this commit when merging into or with python-control#400 and python-control#431
revert this commit when merging into or with python-control#400 and python-control#431
revert this commit when merging into or with python-control#400 and python-control#431
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.