13 Commits

Author SHA1 Message Date
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
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