Skip to content

BOM simplifications#62

Merged
17o2 merged 5 commits into
wireviz:devfrom
kvid:kvid/bom-simplifications
Jul 5, 2020
Merged

BOM simplifications#62
17o2 merged 5 commits into
wireviz:devfrom
kvid:kvid/bom-simplifications

Conversation

@kvid
Copy link
Copy Markdown
Collaborator

@kvid kvid commented Jul 5, 2020

Three suggested independent commits that affect generation of BOM:

  1. Correct a wrong TODO statement.

  2. 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.

  3. 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.

kvid added 3 commits July 5, 2020 02:46
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.
Comment thread src/wireviz/Harness.py Outdated


# Return the value indexed if it is a list, or simply the value otherwise.
# TODO: Maybe move this to wv_helper?
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. Move to vw_helper.

Comment thread src/wireviz/Harness.py Outdated
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']
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think bundle is fine, since that is what we are looking for. If becomes clear after if bundle.category == 'bundle': at the latest.

@17o2
Copy link
Copy Markdown
Collaborator

17o2 commented Jul 5, 2020

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.

@17o2 17o2 merged commit 4e9933f into wireviz:dev Jul 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants