Daniel Rojas
9821ca31f7
Update demo02 to showcase more features
...
zzz
2021-03-23 18:09:16 +01:00
Daniel Rojas
37bf5309f0
Allow line breaks in additional parameters
2021-03-23 18:09:16 +01:00
Daniel Rojas
b4a0ae50b8
Implement additional parameter table
...
as proposed in #222
2021-03-23 15:57:38 +01:00
Daniel Rojas
1f86c97c67
Fix rendering bug for empty add.comp. table
2021-03-23 15:15:20 +01:00
Daniel Rojas
09d5496ca4
Add new bom_item_number property to components
2021-03-23 13:04:31 +01:00
Daniel Rojas
6aa53f6ce4
Remove unused columns in BOM table
2021-03-23 12:40:56 +01:00
Daniel Rojas
aaf88d7601
Remove vertical separators in BOM table
2021-03-23 12:15:03 +01:00
Daniel Rojas
f928bc73ca
Add BOM bubble cell to cables
2021-03-23 11:50:02 +01:00
Daniel Rojas
7e168ea775
Improve GraphViz output, remove debug print
2021-03-23 11:26:13 +01:00
Daniel Rojas
4338b7a1c5
Remove header row for additional components
2021-03-23 11:22:09 +01:00
Daniel Rojas
9a93d86058
remove component_table_entry() as separate func.
...
to simplyfy code
2021-03-23 11:19:20 +01:00
Daniel Rojas
0dc02fe8b5
Correctly determine qty
2021-03-23 11:14:49 +01:00
Daniel Rojas
53fefa8f3c
Add note attribute to additional components
2021-03-23 11:04:33 +01:00
Daniel Rojas
e61d14ba43
Create bom_bubble() function
2021-03-23 11:00:26 +01:00
Daniel Rojas
8c26c8fbbd
New addit. compo. BOM table proof of concept
2021-03-23 10:49:56 +01:00
KV
523d0c659e
Group common function arguments into a dict
2021-03-14 05:49:33 +01:00
KV
183a9432c3
Move repeated code into new optional_fields() function
2021-02-20 21:30:10 +01:00
KV
30dbd9573b
Rename the 'item' key to 'description' in all BOMEntry dicts
...
This way, both BOM and harness.additional_bom_items uses the same
set of keys in their dict entries. This was originally suggested
in a #115 review, but had too many issues to be implemented then.
2021-01-06 22:53:33 +01:00
KV
8e7c48d42e
Eliminate local variable
2021-01-05 04:20:44 +01:00
KV
2e244981fe
Move default qty value=1 to BOM deduplication
2021-01-05 04:12:05 +01:00
KV
d15eeb1f9f
Build output string in one big expression
...
Build output string in component_table_entry() as the similar strings
in generate_bom(). Repeating a couple of minor if-expressions is small
cost to obtain a more compact and readable main expression.
2021-01-03 06:13:09 +01:00
KV
d6d0d2a486
Rename extra variable to part for consistency
2021-01-03 06:13:09 +01:00
KV
c22c42e722
Add BOMEntry type alias
...
This type alias describes the possible types of keys and values in
the dict representing a BOM entry.
2021-01-03 06:13:09 +01:00
KV
12e570fdad
Add function type hints and doc strings
2021-01-03 06:13:09 +01:00
KV
1d653c44ed
Replace accumulation loop with sum expressions
...
Make a list from the group iterator for reusage in sum expressions
and to pick first group entry. The expected group sizes are very small,
so performance loss by creating a temporary list should be neglectable.
Alternativly, itertools.tee(group, 3) could be called to triplicate
the iterator, but it was not chosen for readability reasons.
2020-12-30 08:46:01 +01:00
KV
96d393dfb7
Use a generator expressions and raise exception if failing
...
Seems to be the most popular search alternative:
https://stackoverflow.com/questions/8653516/python-list-of-dictionaries-search
Raising StopIteration if not found is better than returning None
to detect such an internal error more easily.
2020-12-30 08:46:01 +01:00
KV
f13f8a7dd7
Make the BOM grouping function return string tuple for sorting
2020-12-30 08:46:01 +01:00
KV
cdca708da9
Move BOM sorting above grouping to use groupby()
...
- Use one common entry loop to consume iterator only once.
- Use same key function for sort() and groupby(),
except replace None with empty string when sorting.
2020-12-30 08:46:01 +01:00
KV
10b1198b77
Move out code from inner loop into helper functions
2020-12-30 08:46:00 +01:00
KV
74462cd225
Remove parentheses around return expressions
...
https://stackoverflow.com/questions/4978567/should-a-return-statement-have-parentheses
2020-12-30 08:46:00 +01:00
KV
e1d7babf63
Simplify deduplication and sorting of collected designators
2020-12-30 08:46:00 +01:00
KV
d2f8034961
Simplify collecting designators for a joined BOM entry
...
Assign input designators once to a temporary variable for easy reusage.
2020-12-30 08:46:00 +01:00
KV
6378b96541
Simplify BOM header row logic
2020-12-30 08:46:00 +01:00
KV
347f1e3031
Redefine the common lambda to an ordinary function
2020-12-30 08:46:00 +01:00
KV
da453db9f0
Convert dataclass object to dict to use the same lambda
2020-12-30 08:46:00 +01:00
KV
45b13ef797
Use the same lambda in get_bom_index() as for deduplicating BOM
...
Move the lambda declaration out of the function scope for common
access from two different functions.
2020-12-30 08:46:00 +01:00
KV
6525537312
Simplify get_bom_index() parameters
...
- Use the actual BOM as first parameter instead of the whole harness.
- Use a whole AdditionalComponent as second parameter instead of each
attribute separately.
2020-12-30 08:46:00 +01:00
KV
0f3b5e9edf
Skip assignment and return expression directly
2020-12-30 08:46:00 +01:00
kvid
da56841290
Assign the default cable length unit when not present ( #206 )
...
Bug: Failing to assign the default cable length unit when not present.
It was introduced in #198 .
Fix: Test the correct cable attribute. This fix solves issue #205 .
2020-12-29 13:31:55 +01:00
Daniel Rojas
606ddbf977
Detect and assign unit within cable length attribute ( #198 )
...
Co-authored-by: kvid <kvid@users.noreply.github.com>
2020-12-13 12:39:29 +01:00
William Sutton
dec64abaf5
Add support for wire length units
...
Based on #161 , #162 , #171 .
Co-authored-by: stevegt <stevegt@t7a.org>
Co-authored-by: kvid <kvid@users.noreply.github.com>
2020-11-16 17:14:46 +01:00
Daniel Rojas
96bd121403
Create separate modules for BOM and HTML functions
2020-11-15 08:42:57 +01:00
Daniel Rojas
eebf932c8d
Show pin labels of adjacent connectors in cable node ( #70 )
2020-11-14 23:21:08 +01:00
Daniel Rojas
3bf448c692
Update example 08 to reference wires using colors
2020-11-14 23:21:08 +01:00
Daniel Rojas
03e6077512
Allow referencing wires by color/label (#169,#193)
2020-11-14 23:21:08 +01:00
Daniel Rojas
feff47f47b
Add option to add colors to connector pins ( #141 )
2020-11-14 09:43:01 +01:00
KV
64bd34a7c6
Add type aliases that reflect their semantics
...
Using Any or str in type annotations might increase the need for extra
comments to explain the real valid values. However, such needs can be
drastically reduced with the help of semanticly named type aliases.
Each type alias have their legal values described in comments.
Actual validation might be implemented in the future.
2020-11-01 15:26:11 +01:00
KV
3f091bb419
Update the types of dataclass attributes according to usage
...
Fixes #156
2020-11-01 15:26:11 +01:00
Miklos Marton
e2e8bbfb91
Remove input text hyperlinks except in the HTML BOM
...
GraphViz does not support the a HTML tag when generating the tables for the
cables/connectors, so this change will remove these tags for the graph generation.
However for the HTML BOM output table these links will be generated.
2020-10-22 23:08:13 +02:00
Tyler Ward
e85ee5d285
Allow addittional BOM items within components ( #115 )
2020-10-22 17:53:33 +02:00