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

Large scale refactoring #251

Open
wants to merge 111 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 103 commits
Commits
Show all changes
111 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
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
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
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ 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 }}
Expand All @@ -22,11 +22,11 @@ jobs:
python -m pip install --upgrade pip
pip install .
- name: Create Examples
run: PYTHONPATH=$(pwd)/src:$PYTHONPATH cd src/wireviz/ && python build_examples.py
run: PYTHONPATH=$(pwd)/src:$PYTHONPATH && python src/wireviz/tools/build_examples.py
formatc1702 marked this conversation as resolved.
Show resolved Hide resolved
- name: Upload examples, demos, and tutorials
uses: actions/upload-artifact@v2
with:
name: examples-and-tutorials
path: |
examples/
tutorial/
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
6 changes: 3 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 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
2 changes: 2 additions & 0 deletions examples/demo01.gv

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

128 changes: 86 additions & 42 deletions examples/demo01.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified examples/demo01.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.