-
Notifications
You must be signed in to change notification settings - Fork 226
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
Implement mates between connectors, better autogeneration #186
Conversation
0ed7c5d
to
5a7c684
Compare
5a7c684
to
524b80c
Compare
ea49e9a
to
0c4b4bb
Compare
The current state is able to parse all current examples/tutorials/demos (only minor changes to the source file necessary), as well as all test files, inspired by the discussions in the issues mentioned above. See Main open TODO is re-implementing the check for alternating connectors and cables inside each connection set. |
23ec5c7
to
49a748f
Compare
49a748f
to
83cb755
Compare
83cb755
to
ecbc7d5
Compare
0d1e3d7
to
74aeaa5
Compare
I realize this is a major refactoring of the WireViz core. Nevertheless, it would be great to merge this to add some valuable new functionality to the project. I am toying with the idea of trying out the "show" type PR merge as proposed by Martin Fowler to speed things up. The linked article is based on having a proper CI system; the bullet points above support the claim that the PR is mature. @kvid please share your thoughts on this :) thanks |
Just an anecdotal comment, I had been using this branch (prior to rebase) almost exclusively for several months now without issue. Have now updated my local to be after the rebase and will comment if I have any issues. A merge into dev would be greatly appreciated assuming everything is ok. |
Thanks @awb1015 for the feedback! Usually I've waited for @kvid's approval before merging into |
@formatc1702 No problem, definitely not trying to rush the process or skip any amount of review. I have noticed over the last few hours, since moving over to the post-rebase version of the branch, that mating arrows between pairs of mating connectors aren't shown properly. Prior to rebase I hadn't had any issues but now in the output |
Could you provide some |
I've put together a sample to show the issue I'm attempting to describe. This https://gist.github.com/awb1015/8019172cc474c3e0f98999f74a2fa387 contains the YAML file as well as the intermediate files generated both before and after a rebase. I've also attached the respective |
I experimented with the YAML file after posting it and if I gave Connector 2 (both sides) a sequential pin list of 1,2,3,4,5,6 instead of 37,17,18,21,20,19 it seems like the issue went away. Obviously this isn't something I could do on actual diagrams as it changes the information being presented. However, I thought it might be helpful towards diagnosing the issue |
Please try the updated code; your bug should be fixed in 02a800a. Root cause:
|
Looks good. Ran several dozens diagrams to confirm. Thank you for the update! |
- Use pin names instead of pin indices, until the last moment when generating the ports for the GraphViz nodes - `Harness.add_mate_pin()` now uses pin names - Remove unused `if is_arrow()` check from `Harness.connect()` - Consolidate calling of `Connector.activate_pin()` to prevent subtle bugs - Call it from `connect()` and `add_mate_pin()` - No longer call it from `create_graph()` - Misc. other tuning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about this long period without any reply. These changes looks good. I only have a couple of suggestions.
This looks promising for my use case. Would it be possible to group together the two sides of the mate in one box, instead of those arrows? I'm thinking a box with numbering on both left and right sides and labels between indicating the name of the pin pair. As I noted in #295 there are certain connectors where pin numberings change on the same conductor, so these numbers would ideally not be fixed. |
Changes in wireviz#186 made it impossible to hide cable wire numbers. wireviz#186 (comment)
It seems that the user-configurable autogeneration character from 45bcc1d became an undocumented feature. |
@martinrieder wrote:
You are right, it's not mentioned in the v0.4 docs, but I don't know if it might be due to lack of testing, unstability, side effects, just forgotten, or something else. Maybe @formatc1702 remembers any reason for omitting it from the docs? Edit: If you @martinrieder have the time, maybe you could test this optional feature with a few different values, and verify the intended effect? Does it only work with a single character, or also with longer strings? Do you observe any unfortunate side-effects with certain characters/strings? Please store a few YAML input test cases for future regression testing. |
Thanks. I have added a line in the syntax description (in the It's a good idea to do some testing as suggested; then the documentation can be expanded accordingly. |
@kvid wrote:
I can do that. I guess that quotation characters could be problematic in this case. For sure, there should be a check to not accept an empty string here. |
This is a sandbox to try an implementation of #134 and #184 (with possible effects for #142 and #185).
Since both involve changing the WireViz syntax, I figured it might make sense to tackle both at the same time, to make sure there are no conflicts between the two syntax additions.
This PR will try to reflect the results in those discussions.
The implementation will work towards being able to parse the included
test/test1.yml
and produce the expected result. This test file will try to reflect and test any related new features suggested in the discussions.No detailed code review is necessary at the moment, consider this a work in progress;