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

[WIP]Processing Jumpers and Loops, Plus Processing Wires inside the Table as Edges based on #251 #412

Draft
wants to merge 117 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
1878244
Make prefix for autogenerated component names configurable
formatc1702 Oct 17, 2021
e034fb3
Rebuild all examples before refactoring
formatc1702 Oct 17, 2021
1435d9c
Add `metadata.title` to `demo01.yml`
formatc1702 Oct 17, 2021
82b5cb7
Add temporary loop to `demo01`
formatc1702 Oct 17, 2021
f7359ff
WIP
formatc1702 Oct 17, 2021
046a1c2
Refactor connector node generation
formatc1702 Oct 17, 2021
60b2f6c
Further refactor connector node generation
formatc1702 Oct 17, 2021
98e594c
Rebuild demos
formatc1702 Oct 17, 2021
7134b68
Generate gauge string inside Cable object
formatc1702 Oct 17, 2021
d348ebe
WIP: refactor cable node generation
formatc1702 Oct 17, 2021
1f8dd49
Implement HTML indentation
formatc1702 Oct 18, 2021
f46bce6
WIP
formatc1702 Oct 18, 2021
d652229
More WIP
formatc1702 Oct 18, 2021
0078a18
Remove old stuff, slightly simplify code
formatc1702 Oct 18, 2021
064c7fd
Outsource `gv_pin_table()`, simplify padding
formatc1702 Oct 18, 2021
2f03dcd
Add TODOs
formatc1702 Oct 18, 2021
587b359
Outsource `set_dot_basics()` and `apply_dot_tweaks()`
formatc1702 Oct 18, 2021
31c5e1a
Make setting HTML tag attributes easier through `kwargs`
formatc1702 Oct 19, 2021
84dd10a
Fix and simplify bgcolor logic
formatc1702 Oct 19, 2021
266eb65
Reactivate cable edge generation
formatc1702 Oct 19, 2021
8aaee0c
Outsource `gv_edge_wire()`
formatc1702 Oct 19, 2021
d951386
Make connecting things more object-oriented
formatc1702 Oct 19, 2021
9e6d327
Alphabetize HTML tags, improve bgcolor rendering
formatc1702 Oct 19, 2021
fc82007
Make mates object-oriented
formatc1702 Oct 19, 2021
9b40858
Add `devtools.txt`
formatc1702 Oct 19, 2021
21bfebb
Run `autoflake -i`
formatc1702 Oct 19, 2021
ebd271d
Run `autoflake -i --remove-all-unused-imports`
formatc1702 Oct 19, 2021
94f9d96
Add sample use to `devtools.txt`
formatc1702 Oct 19, 2021
8200e89
Streamline assignment of ports to simple connectors
formatc1702 Oct 19, 2021
03518ab
Add `cleanup.sh` (maybe move/delete later? or add commit hook?)
formatc1702 Oct 19, 2021
1b31a6f
Implement color objects
formatc1702 Oct 20, 2021
e95f4bd
Use color objects in WireViz
formatc1702 Oct 20, 2021
22cd258
Re-sort `wv_colors.py`
formatc1702 Oct 20, 2021
95cc1be
Make green color darker
formatc1702 Oct 20, 2021
cc0bd76
Break longer lines not caught by `black`
formatc1702 Oct 21, 2021
96a3a87
Make variable name more expressive
formatc1702 Oct 21, 2021
842e174
Apply dot tweaks last
formatc1702 Oct 21, 2021
ef2b406
Remove unused line
formatc1702 Oct 21, 2021
36ffa96
Improve subclassing of components, prepare for BOM refactoring
formatc1702 Oct 21, 2021
8ae4dc3
Clean up
formatc1702 Oct 21, 2021
a4f6c6a
Include nested additional components in BOM
formatc1702 Oct 21, 2021
b60db79
do not add autogenerated designators to BOM
formatc1702 Oct 21, 2021
5c18001
Improve BOM generation (TODO: wires from a bundle)
formatc1702 Oct 21, 2021
fe016d6
Prepare `harness.populate_bom()`
formatc1702 Oct 21, 2021
5c4c6d8
Change `description` to `type` in additional BOM item YAML
formatc1702 Oct 21, 2021
f2bc5d7
Define CLI epilog str in single statement
formatc1702 Oct 21, 2021
7111a33
Deprecate Python 3.7, add Python 3.10
formatc1702 Oct 21, 2021
fb91be4
Rename modules, adjust imports, move `build_examples.py`
formatc1702 Oct 21, 2021
6ba3f66
Add `pyan` to `devtools.txt`
formatc1702 Oct 22, 2021
df06e00
Restructure and update `.gitignore`
formatc1702 Oct 23, 2021
4db8c16
Clarify `wireviz.parse()` input types
formatc1702 Oct 23, 2021
8b9d997
Implement BOM population (missing: qty multipliers)
formatc1702 Oct 24, 2021
7902ba6
Make `pin_objects` and `wire_objects` dictionaries
formatc1702 Oct 24, 2021
b2e5c46
Compute qty's of additional components (WIP)
formatc1702 Oct 24, 2021
b787c41
Add qty test file
formatc1702 Oct 24, 2021
c33c649
Adapt `tutorial08.yml` (remove `unit` field)
formatc1702 Oct 24, 2021
d549c1e
Add `tabulate` to dependency list (might remove later if not needed)
formatc1702 Oct 24, 2021
1d99889
Sort BOM by category, assign BOM IDs
formatc1702 Oct 24, 2021
6304634
Rename `Options.color_mode` to `.color_output_mod` for consistency
formatc1702 Oct 24, 2021
df1e972
Change BOM output file extension from `.bom.tsv` to `.tsv`
formatc1702 Oct 24, 2021
b15658b
Implement BOM bubbles
formatc1702 Oct 25, 2021
c7537f0
Stop recursive nesting of additional components
formatc1702 Oct 25, 2021
4a9a4c8
Add BOM bubble to additional component list (WIP)
formatc1702 Oct 25, 2021
728741e
Fix gauge conversion
formatc1702 Oct 25, 2021
b4cd8a7
Fix line breaks in code
formatc1702 Oct 25, 2021
6f79064
Optimize BOM bubble geometry
formatc1702 Oct 25, 2021
44d5966
Implement pin color output
formatc1702 Oct 31, 2021
6d33edd
Add some test files to `tests/` directory
formatc1702 Oct 31, 2021
2ede4f5
Update test files
formatc1702 Oct 31, 2021
2fc132b
Allow multiple colors for components
formatc1702 Oct 31, 2021
1b6030c
Implement multiple colors for components, improve multicolor table re…
formatc1702 Oct 31, 2021
634cdd5
Fix color cell implementation
formatc1702 Oct 31, 2021
c21f81a
Fix node background color rendering
formatc1702 Oct 31, 2021
b03dfc7
Add test file for node and title bgcolors
formatc1702 Oct 31, 2021
d8a6da3
WIP: BOM modes
formatc1702 Oct 31, 2021
4b6f791
Add TODO for empty connector pin tables
formatc1702 Nov 15, 2021
91b02fc
Comment out BOM modes (WIP) and BOM bubbles
formatc1702 Aug 5, 2022
3b048ba
Resume work on BOM
formatc1702 Aug 5, 2022
af230a4
Include part number info in BOM table
formatc1702 Aug 5, 2022
7d49f50
Fix BOM output in TSV and HTML
formatc1702 Aug 5, 2022
8c9a8c1
Add bundles' wires' part number info to BOM
formatc1702 Aug 5, 2022
35f751e
Add TODOs
formatc1702 Aug 5, 2022
238bc25
Implement bundle part number rendering
formatc1702 Aug 5, 2022
1f8d8b3
Improve conductor table rendering
formatc1702 Aug 5, 2022
c7dcac4
Fix additional component BOM table layout
formatc1702 Aug 5, 2022
fc06491
Disable CLI BOM output
formatc1702 Aug 5, 2022
c3b07cf
Add suggestions from #246
formatc1702 Aug 5, 2022
162fe44
Add suggestions from #186
formatc1702 Aug 5, 2022
271fb13
Add .vscode/ to .gitignore
Mar 27, 2023
310e596
Fix PyLance problems
formatc1702 Mar 27, 2023
477a3f7
Update interim version number
formatc1702 Mar 27, 2023
8c1d277
Fix zero-size cell for simple connectors without type
formatc1702 Mar 27, 2023
00d5271
Implement additional parameters dict for components
formatc1702 Mar 27, 2023
1e4e63e
Implement note for additional components
formatc1702 Mar 27, 2023
e2e04f7
Thicken additional component table
formatc1702 Mar 27, 2023
5183fda
Add placeholder for add.comp. PN info
formatc1702 Mar 27, 2023
0b17370
Apply black
formatc1702 Mar 27, 2023
af338f6
Change version string to comply with PEP440
kvid Aug 27, 2023
8e2debb
Change BOM output file extension from `.bom.tsv` to `.tsv`
kvid Sep 8, 2023
f122278
Include "tests" folders in the build tool groups
kvid Sep 9, 2023
ca7b134
Handle also int colors in colon separated string
kvid Sep 16, 2023
4238a8a
Avoid wrong function name in warnings
kvid Oct 10, 2023
8cd76eb
Add PN string in gv_additional_component_table()
kvid Oct 11, 2023
98e8f7f
Rename fill_partnumbers() to __post_init__()
kvid Oct 20, 2023
49556bd
Split out class AdditionalBomItem from AdditionalComponent
kvid Oct 27, 2023
3539b2f
Move `parse_number_and_unit()` and `NumberAndUnit` definition to `wv_…
formatc1702 Apr 16, 2024
78f2c4a
Remove unused attribute
formatc1702 Apr 16, 2024
4adad9d
Remove unused `&&` in GitHub workflow
formatc1702 Apr 16, 2024
9e72905
Remove duplicate `category` attribute
formatc1702 Apr 16, 2024
cc18c62
Remove unnecessary casting of `int` to `float`
formatc1702 Apr 16, 2024
1da0b0f
Continue work on BOM handling (WIP)
formatc1702 Apr 26, 2024
4546413
Implemented Base Jumpers
tobiasfalk Jul 20, 2024
57386a9
Update wv_harness.py
tobiasfalk Jul 20, 2024
bb475ea
Added List syntax for shorts and loops
tobiasfalk Jul 20, 2024
a58679b
fix invalid shorts table data and delete old wire table
SnowMB Oct 13, 2024
5964908
rebuild examples
SnowMB Oct 13, 2024
acd245f
Merge pull request #1 from SnowMB/fix_examples_for_jumper_branch
tobiasfalk Oct 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ docs/* linguist-documentation
examples/* linguist-documentation
tutorial/* linguist-documentation

**/*.bom.tsv linguist-generated
**/*.bom.csv linguist-generated
**/*.tsv linguist-generated
**/*.csv linguist-generated
**/*.gv linguist-generated
**/*.html linguist-generated
**/*.png linguist-generated
Expand Down
42 changes: 21 additions & 21 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [3.7, 3.8]
python-version: ["3.8", "3.10"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v1
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
- name: Create Examples
run: PYTHONPATH=$(pwd)/src:$PYTHONPATH cd src/wireviz/ && python build_examples.py
- name: Upload examples, demos, and tutorials
uses: actions/upload-artifact@v2
with:
name: examples-and-tutorials
path: |
examples/
tutorial/
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v1
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
- name: Create Examples
run: PYTHONPATH=$(pwd)/src:$PYTHONPATH python src/wireviz/tools/build_examples.py
- name: Upload examples, demos, and tutorials
uses: actions/upload-artifact@v2
with:
name: examples-and-tutorials
path: |
examples/
tutorial/
28 changes: 17 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
# OS-specific files
.DS_Store
desktop.ini
Thumbs.db

# Development aids
.idea/
.eggs
__pycache__
.*.swp
*.egg-info
*.pyc
build
data
dist
.vscode/
temp/
venv/
.venv/
desktop.ini
thumbs.db
temp/

# Build/compile/release artifacts
build/
dist/
*.egg-info
*.pyc

# Other temporary files
__pycache__
.*.swp
5 changes: 5 additions & 0 deletions cleanup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/zsh

autoflake -i --remove-all-unused-imports src/wireviz/*.py
isort src/wireviz/*py
black src/wireviz/*.py
12 changes: 12 additions & 0 deletions devtools.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# The following tools have proven useful during development
# Feel free to install while inside the WireViz virtualenv, using:
# pip install -r devtools.txt

# Code formatting
black # black src/wireviz/*.py
isort # isort src/wireviz/*py

# Development aids
pudb # import pudb; pudb.set_trace()
autoflake # autoflake -i --remove-all-unused-imports src/wireviz/*.py
pyan # pyan3 src/wireviz/*.py -uncge --html > temp/pyan.html
13 changes: 10 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ Output file:

![Sample output diagram](../examples/demo01.png)

[Bill of Materials](../examples/demo01.bom.tsv) (auto-generated)
[Bill of Materials](../examples/demo01.tsv) (auto-generated)

### Demo 02

![](../examples/demo02.png)

[Source](../examples/demo02.yml) - [Bill of Materials](../examples/demo02.bom.tsv)
[Source](../examples/demo02.yml) - [Bill of Materials](../examples/demo02.tsv)

### Syntax, tutorial and example gallery

Expand Down Expand Up @@ -133,7 +133,7 @@ Depending on the options specified, this will output some or all of the followin
mywire.gv GraphViz output
mywire.svg Wiring diagram as vector image
mywire.png Wiring diagram as raster image
mywire.bom.tsv BOM (bill of materials) as tab-separated text file
mywire.tsv BOM (bill of materials) as tab-separated text file
mywire.html HTML page with wiring diagram and BOM embedded
```

Expand All @@ -148,6 +148,13 @@ To see how to specify the output formats, as well as additional options, run:
$ wireviz --help
```

For using the .gv output one needs to use the following command:

```
dot <filename>.gv | gvpr -q -cf <filename>_pin2pin.gvpr | neato -n2 -T<type> -o <filename>.<type>
```



### (Re-)Building the example projects

Expand Down
2 changes: 1 addition & 1 deletion docs/buildscript.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Possible group names:
- `tutorial` to process`tutorial/{readme.md,tutorial*.*}`
- `demos` to process`examples/demo*.*`

Affected filetypes: `.gv`, `.bom.tsv`, `.png`, `.svg`, `.html`
Affected filetypes: `.gv`, `.tsv`, `.png`, `.svg`, `.html`


## Usage hints
Expand Down
21 changes: 19 additions & 2 deletions docs/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,25 @@ tweak: # optional tweaking of .gv output
hide_disconnected_pins: <bool> # defaults to false

# loops
loops: <List> # every list item is itself a list of exactly two pins
# on the connector that are to be shorted
loops: # a list(dict) of loops
- <str>: <List> # every list item is itself a list of pins
# on the connector that are to be shorted with a cable loop
# more information about the loop can be added by additional
# components definition (see below)
# OR
- <List> # a list of pins to be looped
# Shorts
shorts: # a list(dict) of shorts
<str>: <List> # every list item is itself a list of pins
# on the connector that are to be shorted represented inside
# the connector table
# more information about the loop can be added by additional
# components definition (see below)
# OR
- <List> # a list of pins to be shorted
# it is not posable to combine those two
shorts_hide_lable: <bool> # A Boolean to control if the lable of the shorts should be shown, if a list is used this is automatically turned true.

```

## Cable attributes
Expand Down
Loading