Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quirk in weight constructor #7

Open
afk11 opened this issue Feb 1, 2023 · 0 comments
Open

Quirk in weight constructor #7

afk11 opened this issue Feb 1, 2023 · 0 comments

Comments

@afk11
Copy link

afk11 commented Feb 1, 2023

I was testing this library out and tried rebuilding a Weight object from it's components (weightRange, weight, and format)

It looks like this line: https://github.com/rechner/py-aamva/blob/master/aamva/aamva.py#L1647 is incorrect and causes the weight field to use an approximated value when the exact weight was provided

Weight(5, 200, 'USA') => instead of weight being 200, it was 205 instead

-if weight_range is None:
+if weight is not None:

because when weight is provided, we really don't want the else case triggering, because instead of using the provided weight it calculates weight using the approximation method instead

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

No branches or pull requests

1 participant