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>
Running 6 different Python versions (3.7 to 3.12) in parallel now.
NOTE: This is in conflict with #309, but can be resolved easily in a later PR.
GitHub Actions require an update:
- actions/upload-artifact@v3 is scheduled for deprecation on November
30, 2024.
- Similarly, v1/v2 are scheduled for deprecation on June 30, 2024.
- Updating this comes with a breaking change in upload-artifact@v4:
Uploading to the same named Artifact multiple times.
Due to how Artifacts are created in this new version, it is no longer
possible to upload to the same named Artifact multiple times. You must
either split the uploads into multiple Artifacts with different names,
or only upload once. Otherwise you will encounter an error.
The artifact .zip files therefore have the python version added to
their name.
This happened to be a regression for WireViz-Web [1], which aims to do
as much in memory as possible.
[1] https://github.com/daq-tools/wireviz-web.
kvid rebased and mixed original commit with similar change by Daniel Rojas
Co-authored-by: Andreas Motl <andreas.motl@panodata.org>
Co-authored-by: kvid <kvid@users.noreply.github.com>
Remove unused attribute
Remove unused `&&` in GitHub workflow
Remove duplicate `category` attribute
Removed from `Connector` class since it is already defined in the `Component` superclass.
Remove unnecessary casting of `int` to `float`
https://github.com/wireviz/WireViz/pull/251#discussion_r1359000766
Continue work on BOM handling (WIP)
Bug: 0x112233:0x445566 in YAML input didn't convert such colors
to #112233:#445566 and the strings where just passed as uppercase
to the .gv file. Hence Graphviz printed warnings about unknown
colors and used black as color instead.
Add test for int as string. Re-ordered if statements to give an
exception when a color has an unknown type.
It seems "-dev" (normalized to ".dev") should only be directly followed
by a number for different deveopment releases of the same version.
See full description: https://peps.python.org/pep-0440/
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