Skip to content
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

[meta] Example contributions #143

Open
formatc1702 opened this issue Aug 1, 2020 · 6 comments
Open

[meta] Example contributions #143

formatc1702 opened this issue Aug 1, 2020 · 6 comments

Comments

@formatc1702
Copy link
Collaborator

If you have used WireViz for a project, and want to showcase your work, feel free to post it here!
We may add it to the example gallery as well, provided you allow it :)

@formatc1702
Copy link
Collaborator Author

formatc1702 commented Aug 1, 2020

@ericbhanson
I want to thank you for your comment in #120! I thought I'd start this thread and get back to you here so as not to derail the discussion there.
It's amazing seeing WireViz being used for more complex harnesses. This is good for pushing it a bit and seeing how it performs for more demanding applications. It really highlights the need for a netlist, for example ;)

Would you mind if we added the harness above to the example gallery?

Also, there are things you could simplify in your YAML while retaining the same output!

  • When connecting only one pin/wire, there's no need for the square brackets:
    connections:
      -
        - ALT: 1
        - W-PK: 1
        - REG-REC: 2
  • Instead of
      W-GN:
        category: bundle
        colors: [GN, GN, GN, GN, GN, GN, GN, GN, GN, GN]
        gauge: 16 AWG
    try
      W-GN:
        category: bundle
        wirecount: 10
        colors: [GN]  # brackets still needed here, as of now
        gauge: 16 AWG
  • Try YAML anchors and aliases to DRY your code :)
  • I obviously can't comment on the technical/electrical correctness of your harness, but it's interesting you seem to be bundling wires strictly by color?

@kvid
Copy link
Collaborator

kvid commented Aug 2, 2020

@ericbhanson
Copy link

@formatc1702 it's my pleasure - I'm glad I could help move the project forward! I would be honored if my harness were added to the gallery.

Thank you for the notes about how to DRY the YAML. I was actually using templates initially, but I'm now getting an error when doing so, so I've removed them. Here's a example:

When attempting to process the following YAML file:

  Bullet: &bullet
    subtype: male
    pincount: 1
  GR-SW-M:
    <<: *bullet
    notes: Green Shockwave Module

I get the following stack trace:

  File "/Library/Frameworks/Python.framework/Versions/3.8/bin/wireviz", line 11, in <module>
    load_entry_point('wireviz', 'console_scripts', 'wireviz')()
  File "/Users/eric/Downloads/WireViz/src/wireviz/wireviz.py", line 248, in main
    parse(yaml_input, file_out=file_out)
  File "/Users/eric/Downloads/WireViz/src/wireviz/wireviz.py", line 178, in parse
    harness.output(filename=file_out, fmt=('png', 'svg'), view=False)
  File "/Users/eric/Downloads/WireViz/src/wireviz/Harness.py", line 430, in output
    graph = self.create_graph()
  File "/Users/eric/Downloads/WireViz/src/wireviz/Harness.py", line 392, in create_graph
    g = graph_from_dot_data(dot.create_dot(prog="dot", f="dot").decode('utf-8'))[0]
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pydot.py", line 1722, in new_method
    return self.create(
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pydot.py", line 1945, in create
    assert process.returncode == 0, process.returncode
AssertionError: 1

As far as bundling wires by color: that was an organizational choice to make it easier to make sure I had everything wired up properly. To be honest, I'm a little confused by the purpose of bundles; what are they intended to do?

@formatc1702
Copy link
Collaborator Author

formatc1702 commented Aug 2, 2020

@ericbhanson
As for the templates, I'll have to look into it in some more detail.

As far as bundling wires by color: that was an organizational choice to make it easier to make sure I had everything wired up properly. To be honest, I'm a little confused by the purpose of bundles; what are they intended to do?

You can picture bundles as individual wires being routed together physically (as if zip-tied into a literal bundle).
If you had one bundle of wires going from your fusebox to your handlebars, and another one going from your fusebox to the engine, and another to the rear of the bike, you could organize them as such.
Currently, all wires in a bundle are assumed/forced to be the same length, which makes sense since they will be routed together... but this restriction will likely be loosened in the future.
A big difference is that cables are listed as a single BOM entry (one 4-wire cable of length X) where as bundles list every wire individually (four wires of length X).

@formatc1702
Copy link
Collaborator Author

@kvid your color code test script sounds like a good tool for development, but including all the examples in the repo is probably overkill... maybe we could add a new directory for these kinds of tools?

@ericbhanson
Copy link

Thanks @formatc1702 - I'm going to recreate the configuration with proper use of bundles in mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants