BOM simplifications#62
Merged
Merged
Conversation
Grouping the bundles has no purpose, as the same wires can be collected by just looping all bundles.
Allow one common value when they are equal for all wires, or a list of values to allow each wire a different value.
17o2
reviewed
Jul 5, 2020
|
|
||
|
|
||
| # Return the value indexed if it is a list, or simply the value otherwise. | ||
| # TODO: Maybe move this to wv_helper? |
17o2
reviewed
Jul 5, 2020
| items = {k: v for k, v in self.cables.items() if bundle_group(v) == group} | ||
| shared = next(iter(items.values())) | ||
| for bundle in items.values(): | ||
| # TODO: Maybe rename bundle to cable or maybe loop only [c for c in self.cables.values() if c.category == 'bundle'] |
Collaborator
There was a problem hiding this comment.
I think bundle is fine, since that is what we are looking for. If becomes clear after if bundle.category == 'bundle': at the latest.
Collaborator
|
I like this change! Simplification is always good. See my comments above.. I'll propably squash the commits into one once you're done to keep it simple, hope that's OK. |
The owner review comments can be seen here: wireviz#62
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three suggested independent commits that affect generation of BOM:
Correct a wrong TODO statement.
Remove bundle grouping as it is not needed for the wire grouping.
As long as the wires can be grouped across bundles,
grouping the bundles has no purpose, as the same
wires can be collected by just looping all bundles.
Allow one common value or list of values for each wire.
Allow one common value when they are equal for all wires,
e.g. the manufacturer is often equal for all wires,
or a list of values to allow each wire a different value.