522 Commits

Author SHA1 Message Date
Tyler Ward
39ad070ca8 Added rendered output for new tutorial 2020-07-02 01:26:48 +01:00
Tyler Ward
4d2cb63350 Added part number tutorial 2020-07-02 01:20:26 +01:00
Tyler Ward
c200f66009 Merged in refactoring changes from upstream 2020-07-02 00:50:48 +01:00
Tyler Ward
9c5ea06ca2 Added spaces after MPN: and IPN: 2020-07-01 23:47:49 +01:00
Tyler Ward
f67235e326 Added diagram support for part numbers on ferrules 2020-07-01 23:45:35 +01:00
Tyler Ward
1ec9ca4f81 Improved part number support
Added internal part number and manufacturer fields
Added support for wire part numbers in a bundle
Moved part number information to seperate row in table
2020-07-01 23:17:20 +01:00
Daniel Rojas
fffb354d7c Merge branch 'dev' 2020-06-30 17:59:00 +02:00
Daniel Rojas
49322fc65f Fix demo 01 2020-06-30 17:58:44 +02:00
Daniel Rojas
b163b7a586 Update .gitignore to include venv/ directory 2020-06-30 14:10:32 +02:00
Daniel Rojas
23e22f5249 Reorder readme 2020-06-30 13:53:54 +02:00
Daniel Rojas
8b09facfce Merge branch 'dev' 2020-06-29 18:44:59 +02:00
Daniel Rojas
9d2c193533 Update example 08 to hide pincount on 3.5mm jack 2020-06-29 17:46:45 +02:00
Daniel Rojas
e047f06b6d Update readme to reflect changes from #41 2020-06-29 14:54:06 +02:00
Daniel Rojas
52a8af298d Rebuild example 02 after fixes from #41 2020-06-29 14:44:44 +02:00
Andreas Nordin
08e53bcd48
Feature: bidirectional AWG/mm2 unit conversion (#41)
* Fix AWG<-> mm2 conversions

Add an inverted dictionary and a lookup function from awg -> mm2. Also
do some minor refactoring. Both sides of the conversion table were
converted to strings, since '0000' and '2/0' are perfectly valid AWG
values.

* Update example ex02 with awg -> mm2 conversion

Show conversions for ex02, and make sure it displays conversions in both
directions. Rebuild the example files.

* Fix faulty conversion of non-(mm2,AWG) units

The parsing allows arbitrary units to be used for cable dimensions --
this might be valid units, e.g. square inches, or invalid, e.g. bananas.
We only allow conversion between mm2 and AWG, so check that the
gauge_unit is either of those before conversion. If not, pass through as
is.

* Fix AWG string casing in output

Convert e.g. 'awg, 'AwG' to upper case for consistent rendering. Leave
any other input gauge units as they were.

Co-authored-by: Daniel Rojas <github@danielrojas.net>
2020-06-29 14:41:45 +02:00
Daniel Rojas
c7014a2ea0 Fix URL in setup.py (fixes #42) 2020-06-29 14:22:32 +02:00
Daniel Rojas
7458118f4d Merge branch 'dev' 2020-06-29 12:37:24 +02:00
Daniel Rojas
c42b33b38d Address FIXMEs and fine-tune merge of #39 2020-06-29 12:35:40 +02:00
Gabe R
82b173f2ce Refactor and clean up code (#39)
* Format all files using autopep8 to add basic PEP8 conformity.
* Add Exception types to bare excepts to prevent catching `ctrl+c`
* Remove some unnecessary assignment to dummy variables before returning
* Add `Optional` to type hints that can be `NoneType`
* Change a number of single-letter variables to more descriptive names
* Replace string.format() use with Python's f-strings, as they tends to be cleaner, and provide a performance boost.
  * One multiline string was left as string.format() as I do not believe f-strings support multiline
  * Some of the string.format() instances had unused/ignored arguments. I left them out of the f-strings, but I marked those cases with a comments that begins `# FIXME:`
* Rename variables that were shadowding python standard functions (specifically `format->fmt`, `input->inp`, `type->maintype`)
  * Some instances of `type` were not changed, as it breaks the yaml parsing. Needs to be looked into.
* Move classes in `wireviz.py` to two new files `DataClasses.py` and `Harness.py`.

Co-authored-by: Daniel Rojas <github@danielrojas.net>
2020-06-29 11:57:03 +02:00
Tyler Ward
92b6b21895 Added ability to set part numbers 2020-06-28 22:11:05 +01:00
Daniel Rojas
8326ddd462 Merge branch 'dev' 2020-06-28 23:01:45 +02:00
Tyler Ward
a3728f52ce
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.
2020-06-28 22:58:24 +02:00
Daniel Rojas
0a42b350c8 Update readme 2020-06-28 15:24:03 +02:00
Daniel Rojas
4aac32b6bf Merge branch 'dev' 2020-06-28 15:00:40 +02:00
Florian Pigorsch
6cf7178a9f
[ci] Setup Github actions to run 'build_examples.py' as a test on each pull/pull request. (#34)
Co-authored-by: Florian Pigorsch <florian@concept.de>
2020-06-28 14:59:29 +02:00
Daniel Rojas
a7419c444e
Merge pull request #35 from flopp/typos
Fix some typos
2020-06-28 14:57:58 +02:00
Florian Pigorsch
eb65be39dc Fix some typos: budnle, conector, separetely 2020-06-28 14:55:09 +02:00
Daniel Rojas
69bc20a31e Remove TODO file, move to-do's to GitHub Projects 2020-06-28 13:16:38 +02:00
Daniel Rojas
37d5ebd5bc Merge branch 'dev' 2020-06-28 12:38:36 +02:00
Daniel Rojas
7060c38f07 Add parse_file() function and use it in build_examples.py 2020-06-28 12:28:13 +02:00
Daniel Rojas
5d84bb86eb Update gitignore 2020-06-28 11:43:31 +02:00
Daniel Rojas
154e28f257 Change gen_bom to generate_bom 2020-06-28 11:43:22 +02:00
Andreas Nordin
1f06c6017c refactor: rename 'input' -> 'yaml_data'
'input' overloads a python built-in name. Refactor to avoid this.
2020-06-28 10:52:08 +02:00
Andreas Nordin
f14a07fe95 feature: add --prepend-file option
- Allow prepending a separate YAML file for e.g. including common
  template definitions. This is accomodated by a new commandline option,
  --prepend-file, which takes a path to a YAML file. This is prepended
  to the regular input as-is.

- Refactor file loading to accomodate the above. This includes moving
  relevant parts to main() and instead supplying parse () with a string
  representation of the YAML data. Also add early file existance checks
  and bail out if any of the inputs are inaccessible or nonexistant.
2020-06-28 10:51:49 +02:00
Andreas Nordin
a1f511738e fix install notes
Explicitly mention the system graphviz dependency and clarify possible
need for separate python install on old ubuntus
2020-06-28 10:50:53 +02:00
Andreas Nordin
668667d4fe Fix typo 2020-06-28 10:50:12 +02:00
Andreas Nordin
cdb2cf2b91 update build_examples script 2020-06-28 10:49:47 +02:00
Andreas Nordin
60cd069754 add install instructions to readme 2020-06-28 10:48:14 +02:00
Andreas Nordin
9af391ff9d clean up imports, cmdline handling
Order imports properly. Fix path when running script directly from repo
rather than as an installed package. Refactor command line handling.
2020-06-28 10:47:15 +02:00
Andreas Nordin
5514fd4244 refactor dependencies and installation
There are hard copies of the graphviz and pyyaml dependencies included
in the repo. Remove these.

Sort out installation and dependency handling by writing a functional
setup.py script. Rename top level documentation. Refactor wireviz.py
slightly to allow it to run as an installed script.

# Conflicts:
#	src/batch.py
#	src/wireviz/batch.py
#	src/wireviz/build_examples.py
2020-06-28 10:46:24 +02:00
Daniel Rojas
dfb184c1a4 Move source from src/ to src/wireviz/
in preparation for merge of refactor brancb
2020-06-28 10:39:11 +02:00
Daniel Rojas
5c582cbe12 Merge branch 'dev' 2020-06-27 23:56:58 +02:00
Daniel Rojas
4661992151 Fine-tune wire BOM output if no gauge is specified 2020-06-27 23:54:55 +02:00
Daniel Rojas
790e9c93c4 Update demos and examples 2020-06-27 23:46:22 +02:00
Daniel Rojas
da80d4ba85 Auto-assign pincount = 1 for ferrules at initialization 2020-06-27 23:37:37 +02:00
Daniel Rojas
d0023c1d41 Make custom pin numbers and hidden unused pins work nicely together 2020-06-27 23:31:58 +02:00
Daniel Rojas
304152f6b6 Merge branch 'hide_unconnected' into dev
# Conflicts:
#	src/wireviz.py
2020-06-27 23:09:35 +02:00
Daniel Rojas
0c6326b740
Merge pull request #5 from elliotmr/master
Feature: hide pins that are not connected
2020-06-27 14:44:32 +02:00
Daniel Rojas
a5ca5be69d Merge branch 'dev' 2020-06-27 11:24:14 +02:00
Daniel Rojas
8bf296b186 Auto-generate pin numbers if only pincount is specified 2020-06-27 11:13:16 +02:00