Add `url` field to Component, WireClass, and Cable with per-wire URL
support for bundles. URLs produce clickable href attributes on GraphViz
nodes/edges and appear as a linked column in HTML BOM output.
Adds output_dpi field to Options (default 96.0) and passes it to the
GraphViz graph attributes. Higher DPI produces sharper PNG/PDF renders,
useful for print-quality harness documentation.
Adds a _get_latest_revision() helper that extracts the last entry from
metadata.revisions. Allows templates to show the current revision
indicator without rendering the full revision table.
Port of v0.4.1 pin safety work (#432) to v0.5-dev architecture:
- normalize_pin() for int/str coercion at YAML boundary
- resolve_pin() for label-to-number resolution
- GraphViz port index fix for loops/shorts on non-sequential pins
- Apollo review hardening (duplicate detection, min pin count, float/bool rejection)
- Unique port names for multi-short rendering
- 52 new tests (71 total)
S2: Replace type() == list with isinstance() for list-to-dict conversion.
I4: Fix duplicate GraphViz port names when a pin appears in multiple
shorts. Port names now encode short column index (p{idx}j{col}) so
each cell in the shorts grid has a unique port. Edge generation in
gv_connector_shorts() updated to match.
S5: Add rendering tests for multi-pin loop edge chains and multi-short
port name uniqueness.
Add normalize_pin() for consistent int/str coercion at YAML boundary,
resolve_pin() for label-to-number resolution, and fix GraphViz port
index rendering for loops and shorts on non-sequential connectors.
Key changes:
- wv_utils: add normalize_pin(), reject floats/bools, refactor expand()
- wv_dataclasses: normalize pins/pinlabels/wirelabels in __post_init__,
add Connector.resolve_pin(), resolve loop/short pins through labels,
detect duplicate pins and minimum pin count in loops/shorts
- wv_graphviz: convert pin IDs to position indices in loop/short edges,
fix short membership test from pin.index to pin.id
- wv_harness: delegate connect() pin resolution to resolve_pin()
- tests: 50 tests covering resolution, coercion, rendering, validation
- Include *.gvpr files in package_data so wv_gvpr.gvpr ships
in the wheel distribution (reported by web-ui integration agent)
- Guard generate_html_output() against empty BOM list to prevent
IndexError when YAML has no connectors/cables
Document four new capabilities ported from upstream PRs since the
initial handoff: PDF output (#367), connector strip lengths (#446),
YAML-in-PNG round-trip (#234), and code quality improvements.
Updated dependencies and next-steps checklist.
Connectors now support a 'strip' property with sleeve and insulation
length specifications, rendered in the diagram node and available in
the data model for BOM/manufacturing use.
PNGs now contain the original YAML harness definition as compressed
iTXT metadata. Use read_yaml_from_png() to extract it — share a PNG,
recipient can regenerate or edit the harness.
Major refactor from upstream PR #455 adding jumper wires as a first-class
component type. Includes renamed modules (DataClasses→wv_dataclasses,
Harness→wv_harness), new color system, and updated BOM generation.
Preserved Jinja2 preprocessor (PR #382) in wv_cli.py alongside jumper changes.
A number of such warnings showed up when running e.g.
PYTHONWARNINGS=always python build_examples.py
PYTHONWARNINGS=always wireviz ../../examples/demo0?.yml
See https://github.com/wireviz/WireViz/pull/309#issuecomment-2170988381
Fix: All open() calls should be in a "with open() as x" statement
to ensure closing the file when exiting the block in any way.
Otherwise, use the new file_read_text() or file_write_text() functions
to read or write the whole utf-8 text file and closing it.
Co-authored-by: kvid <kvid@users.noreply.github.com>
Add local replacement_if_used() that call function to read the file
only when needed and append the return value as replacement.
Co-authored-by: kvid <kvid@users.noreply.github.com>
This will enable users to replace the SVG diagram with an embedded PNG,
that is an improved work-around when the SVG output from Graphviz
is not looking good. Suggested as work-around for Graphviz bug in
https://github.com/wireviz/WireViz/issues/175#issuecomment-2132206026
Co-authored-by: kvid <kvid@users.noreply.github.com>
This will e.g. enable users to replace the SVG diagram with PNG,
that is needed as a work-around when the SVG output from Graphviz
is not looking good. Suggested as work-around for Graphviz bug in
https://github.com/wireviz/WireViz/issues/175#issuecomment-2132206026
Co-authored-by: kvid <kvid@users.noreply.github.com>
The CLI handling code was redesigned for v0.4 and it seems the code
to assign a default title from v0.3.1 has been messed up. This bug
has not been triggered by build_examples.py due to it seems to call
the parse() function differently.
The output_name should be used as default title when present.
This will fix the #360 bug report.
Co-authored-by: kvid <kvid@users.noreply.github.com>
In Windows might OSError(errno=EINVAL) be raised instead of the already
catched exceptions in some cases (depending on the Python version).
Suggested fix posted by JarrettR in
https://github.com/wireviz/WireViz/issues/344#issuecomment-2113476151
Co-authored-by: kvid <kvid@users.noreply.github.com>
Co-authored-by: JarrettR <jrainier@gmail.com>