Add gauge_equiv options#499
Draft
kvid wants to merge 10 commits into
Draft
Conversation
Avoid string operation on a None gauge_unit value.
The same variable can store equivalents for both AWG and mm2, not just AWG.
Avoid gauge equivalents bugs as reported in wireviz#282 by enabling the user to select the proper method for computing equivalents that fits the current wire harness.
This was
linked to
issues
May 5, 2026
When rounding mm2 equivalent to specified number of digits, it could round up or down. Now, THICKER will round up and THINNER will round down.
sbennett18
reviewed
May 9, 2026
|
|
||
| @dataclass | ||
| class MatchDeviationPercentage: | ||
| """Match deviation limits in precentage for a poor and invalid match.""" |
There was a problem hiding this comment.
Minor typo precentage --> percentage
Collaborator
Author
There was a problem hiding this comment.
Thank you for reviewing and catching my typo!
I didn't expect much attention about this PR while it still is a draft, so your message was a nice surprise. 😄
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.
Avoid gauge equivalents bugs as reported in #282 by enabling the user to select the proper method for computing equivalents that fits the current wire harness.
The current implementation requires Python 3.10+. Either rewrite slightly to support older versions, or change the Wireviz required Python versions.
Find proper default values for the new options. Please test this branch and suggest default values that might be useful for most users.
Alternative 1:
Should probably rename
Cable.show_equivtoCable.gauge_equivfor consistency with the new options attribute and to improve code readability. In addition, it removes a conflict with a possible futurelength_equivattribute.Maybe consider also supporting
kcmil?