-
Notifications
You must be signed in to change notification settings - Fork 235
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 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. |
Refactor connector node generation Further refactor connector node generation Rebuild demos Generate gauge string inside Cable object WIP: refactor cable node generation Implement HTML indentation WIP More WIP Remove old stuff, slightly simplify code Outsource `gv_pin_table()`, simplify padding Add TODOs Outsource `set_dot_basics()` and `apply_dot_tweaks()` Make setting HTML tag attributes easier through `kwargs` Fix and simplify bgcolor logic Reactivate cable edge generation Outsource `gv_edge_wire()` Make connecting things more object-oriented Alphabetize HTML tags, improve bgcolor rendering Make mates object-oriented Run `autoflake -i` Run `autoflake -i --remove-all-unused-imports` Streamline assignment of ports to simple connectors Implement color objects Use color objects in WireViz Re-sort `wv_colors.py` Make green color darker Break longer lines not caught by `black` because they were unbroken strings or comments Make variable name more expressive Apply dot tweaks last Remove unused line Improve subclassing of components, prepare for BOM refactoring Clean up Include nested additional components in BOM do not add autogenerated designators to BOM Improve BOM generation (TODO: wires from a bundle) Prepare `harness.populate_bom()` Change `description` to `type` in additional BOM item YAML Define CLI epilog str in single statement Rename modules, adjust imports, move `build_examples.py` Restructure and update `.gitignore` Clarify `wireviz.parse()` input types Implement BOM population (missing: qty multipliers) Make `pin_objects` and `wire_objects` dictionaries Compute qty's of additional components (WIP) Add qty test file Adapt `tutorial08.yml` (remove `unit` field) Add `tabulate` to dependency list (might remove later if not needed) Sort BOM by category, assign BOM IDs Rename `Options.color_mode` to `.color_output_mod` for consistency Change BOM output file extension from `.bom.tsv` to `.tsv` Implement BOM bubbles Stop recursive nesting of additional components Add BOM bubble to additional component list (WIP) Fix gauge conversion Fix line breaks in code Optimize BOM bubble geometry Implement pin color output Small issue: GraphViz warning ``` Warning: table size too small for content ``` Add some test files to `tests/` directory Update test files Allow multiple colors for components Implement multiple colors for components, improve multicolor table rendering Fix color cell implementation Fix node background color rendering Add test file for node and title bgcolors WIP: BOM modes Add TODO for empty connector pin tables Comment out BOM modes (WIP) and BOM bubbles Resume work on BOM Include part number info in BOM table Fix BOM output in TSV and HTML Add bundles' wires' part number info to BOM Add TODOs Implement bundle part number rendering Improve conductor table rendering Fix additional component BOM table layout Disable CLI BOM output Add suggestions from #246 Add suggestions from #186 Add .vscode/ to .gitignore Fix PyLance problems Update interim version number Fix zero-size cell for simple connectors without type Implement additional parameters dict for components Implement note for additional components Thicken additional component table Add placeholder for add.comp. PN info Apply black
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;