From 0a42b350c8de8d41b17c7804ddcf1eec500812e9 Mon Sep 17 00:00:00 2001 From: Daniel Rojas Date: Sun, 28 Jun 2020 15:22:59 +0200 Subject: [PATCH 1/2] Update readme --- README.md | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 8b2dc48..3b90b58 100644 --- a/README.md +++ b/README.md @@ -26,9 +26,9 @@ _Note_: WireViz is not designed to represent the complete wiring of a system. It ## Installation -WireWiz requires the ```graphviz``` package as well as it's python bindings. Graphviz itself is installed using your regular package manager, e.g. ```apt-get install graphviz```. The Graphviz python bindings are automatically installed as dependencies by the install script. +WireWiz requires GraphViz to be installed in order to work. See the [GraphViz download page](https://graphviz.org/download/) for OS-specific instructions. -Installation of the WireWiz package and its python dependencies can be done using pip after cloning the repository: +Installation of the WireWiz package and its Python dependencies can be done using pip after cloning the repository: ``` git clone @@ -38,14 +38,6 @@ pip3 install -e . ## Examples -### (re)building the example projects - -If you would like to rebuild all of the included demos, examples and tutorials, use the ```build_examples.py``` script: - -```cd src/wireviz -./build_examples.py -``` - ### Demo 01 [WireViz input file](examples/demo01.yml): @@ -96,6 +88,14 @@ Output file: See the [tutorial page](tutorial/readme.md) for sample code, as well as the [example gallery](examples/readme.md) to see more of what WireViz can do. +### (Re-)Building the example projects + +If you would like to rebuild all of the included demos, examples and tutorials, use the ```build_examples.py``` script: + +```cd src/wireviz +./build_examples.py +``` + ## Usage ``` @@ -114,11 +114,13 @@ mywire.html HTML page with wiring diagram and BOM embedded ## Status -This is very much a [work in progress](TODO). Source code, API, syntax and functionality may change wildly at any time. +This is very much a [work in progress](https://github.com/formatc1702/WireViz/projects/1). Source code, API, syntax and functionality may change wildly at any time. ## Requirements -Developed and tested using Python 3.7; might not work with older Python versions. Ubuntu 18.04 LTS users in particular may need to separately install Python 3.7 or above, as that comes with Python 3.6 as the included system Python install. +Developed and tested using Python 3.7; might not work with older Python versions. + +Ubuntu 18.04 LTS users in particular may need to separately install Python 3.7 or above, as that comes with Python 3.6 as the included system Python install. ## License From a3728f52ce5f3d6be6bcf82c0204d362d4c6376a Mon Sep 17 00:00:00 2001 From: Tyler Ward Date: Sun, 28 Jun 2020 21:58:24 +0100 Subject: [PATCH 2/2] Fix for Designators apearing across all colours of wires of a guage. (#37) The wirelist for the bom now has individual designators added. this also alows for the removal of designator list merging later. --- src/wireviz/wireviz.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/wireviz/wireviz.py b/src/wireviz/wireviz.py index 43b7613..83dba1e 100755 --- a/src/wireviz/wireviz.py +++ b/src/wireviz/wireviz.py @@ -287,15 +287,13 @@ class Harness: for bundle in items.values(): # add each wire from each bundle to the wirelist for color in bundle.colors: - wirelist.append({'gauge': shared.gauge, 'gauge_unit': shared.gauge_unit, 'length': shared.length, 'color': color, 'designators': list(items.keys())}) + wirelist.append({'gauge': shared.gauge, 'gauge_unit': shared.gauge_unit, 'length': shared.length, 'color': color, 'designator': bundle.name}) # join similar wires from all the bundles to a single BOM item types = Counter([(v['gauge'], v['gauge_unit'], v['color']) for v in wirelist]) for type in types: items = [v for v in wirelist if (v['gauge'], v['gauge_unit'], v['color']) == type] shared = items[0] - designators = [i['designators'] for i in items] - # flatten nested list - designators = [item for sublist in designators for item in sublist] # https://stackoverflow.com/a/952952 + designators = [i['designator'] for i in items] # remove duplicates designators = list(dict.fromkeys(designators)) designators.sort()