-
Notifications
You must be signed in to change notification settings - Fork 223
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
Processing Jumpers and Loops, Plus Processing Wires inside the Table as Edges #369
base: dev
Are you sure you want to change the base?
Conversation
Now everything from #350 is implemented. |
Syntax:
|
Changed the syntax and added options for the shorts, see ex15 for more
New Syntax:
|
I'm sorry that I've not yet had time to play with this PR, but it seems to work as proof of concept for the #350 discussions.
|
I mainly have problems with the bom and how I add the shorts to the bom |
Have you considered making the additional components list be a union of shorts and explicitly specified entries, instead of having a separate list for shorts? Then adding to BOM could be handled equally as well. |
@kvid @martinrieder could you look at the new syntax in ex15 & 16? |
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.
This needs a bit of rework. Comments added.
examples/ex15.yml
Outdated
manufacturer: WireViz | ||
mpn: 42XCD42A5 | ||
type: shortPartA | ||
qty: 42 |
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.
I find qty
confusing for unit mm
. How about length
as an alias?
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.
Yes, but Additional Components works with qty
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.
Yes, just leave it, as changing this is not in scope.
examples/ex15.yml
Outdated
shorts: | ||
- SH1: [1, 5, 7] | ||
- SH2: [2, 6] |
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.
Using a list here is fine. Does not match the syntax description though.
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.
Syntax description is yet to be updated.
} | ||
else: | ||
common_args = { | ||
"qty": part.qty * component.get_qty_multiplier(part.qty_multiplier), |
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.
numShorts
could be the return value of the function.
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.
Do not completely understand what you mean
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.
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.
You had the qty_multiplier
choice extended for shorted
, so I thought that the function get_qty_multiplier
might return numShorts
as an integer in that case. The meaning has changed now with references
.
src/wireviz/wv_bom.py
Outdated
else: | ||
numShorts = len(part.shorts) | ||
|
||
if numShorts > 0: |
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.
This could be avoided, see below.
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.
Do not completely understand what you mean
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.
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, the order of comments got mixed up and my statement was possibly misleading.
Overall question is if the syntax is acceptable? |
@tobiasfalk wrote:
I would prefer a solution that does not require using Overall, I would say that this implementation is quite close to what was discussed in #224 (comment). The only difference is that Please also have a look at #288, which also implements some loop handling and might cause some merge issues. What I need for my daily work is having alphanumeric pin names and pinlabels matching to work also on loops. I am currently using a workaround for this. ex15 connectors:
X1:
#[...]
pinlabels: [GND, VCC, RX, TX, GND, VCC, GND]
shorts:
- SH1: [1, 5, 7]
- SH2: [2, 6]
additional_components:
- reference: SH1 # discussed in #224
color: PK
#[...]
- reference: SH2
color: RD
#[...]
X2:
#[...]
pinlabels: [GND, VCC, RX, TX, GND, VCC, GND]
shorts:
- SH1: [1, 5, 7] # same designator as above...
- SH2: [2, 6] # does this imply the same attributes? EDIT: Cross-referring to #224 (comment) for additional details. |
@tobiasfalk I fixed it by adding the line os.environ['GVPRPATH'] = str(Path(__file__).parent) |
@martinrieder to where exactly? |
Just before the call to |
@martinrieder could you test it again? |
Some commits back, do not know exactly which one, I implemented #352 and it works without a problem for me |
Then I propose you edit the description of the PR to include this and the other issues from #369 (comment) as well. |
If everything is now Ok, then I would now wait for #251 |
Oh yes I need to clean up the code a bit, I know that |
@tobiasfalk: While working on another machine I ran into a dependency issue for
It was a fresh install of Python 3.12.4, see the detailed log below: Details
During some research, I found out that https://docs.python.org/3.12/whatsnew/3.12.html#distutils
Doing |
@martinrieder |
https://peps.python.org/pep-0632/
|
I realized that |
I still want to look if there is a current way to do it since it is already depricated. |
@martinrieder in #412 I have now replaced |
Hey, @tobiasfalk I am loosely following the progress on this project and just saw the awesome results you achieved with the jumpers. I digged a little bit into the implementation and got really confused about all the changes of the dev branch and different merge requests. Does #412 replace this one (#369)? I wanted to give banded wires #109 and twisted wires #3 another go and I've seen that your solution is quite similar to what I did back in the day. Using I see however that you used gvpr scripts. The syntax in this scripts is very foreign to me. And I found this comment by an graphviz developer:
https://forum.graphviz.org/t/im-trying-to-use-gvpr-is-that-a-mistake/1825/6 I think you could achieve the same with using a different graphviz package. I just tried pydot again wich received updates in the meantime and is actively maintained. Switching out the graphviz package with pydot for this project is fairly easy (about 30 lines in the 0.4.1 release, I started here before looking into the dev/branch but i figure it shouldn't be much harder). And the manipulation of the graph after layout could be implemented in python instead of gpvr. Should help with maintainability of the project! I will be looking into you branch and will try to work on #103 and #3 ontop of it. Thanks for your great contribution to this project! 👍 And thanks for all the other maintainers and contributors. |
Yes, since #412 is based on #251(Large scale refactoring), which is hopeful merged soon™
For #109, as said there, I think that a pure GrapViz solution is not relay possible but by going over SVG and then convert the SVG to the other wanted formats it could be possible (#423, wanted to hear the opinion on this idea and actually did not have the time to start on it, or had other thing that I wanted to do).
I used gvpr, since this is what they have given me in the GraphViz forum, see https://forum.graphviz.org/t/straitening-one-line-throu-a-table/2196 and https://forum.graphviz.org/t/way-of-drawing-a-black-circle-inside-a-table-field/2273/12 , it is also quite foreign for me, also why I link to the forum posts at the top of the script.
Seams interesting, and feel free to change as much as you like, I personally would say that you should look in to #251, since it changes a bunch of stuff and you most likely would have to redo your work if you base it on the current dev branch. |
Here I started to implement Jumpers, and a new way of drawing Wires inside the Wire table.
Currently, only the Black circles are done and nothing else.
See ex15.png
Ps. And now even the right branch
Edit:
Ex15:
Ex16: