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

Verbose mode shows incoherent data regarding final result #76

Closed
bpetit opened this issue Apr 8, 2022 · 1 comment
Closed

Verbose mode shows incoherent data regarding final result #76

bpetit opened this issue Apr 8, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@bpetit
Copy link
Collaborator

bpetit commented Apr 8, 2022

Bug description

GWP manufacturing impact is 67 for 2 RAM sticks, but verbose shows 33 for 1 RAM stick.

{'impacts': {'adp': {'manufacture': 0.005,
                     'unit': 'kgSbeq',
                     'use': 'not implemented'},
             'gwp': {'manufacture': 67.0,
                     'unit': 'kgCO2eq',
                     'use': 'not implemented'},
             'pe': {'manufacture': 850.0,
                    'unit': 'MJ',
                    'use': 'not implemented'}},
 'verbose': {'capacity': {'input_value': 8,
                          'status': 'UNCHANGED',
                          'used_value': 8},
             'density': {'input_value': None,
                         'status': 'SET',
                         'used_value': 0.625},
             'impacts': {'adp': {'unit': 'kgSbeq', 'value': 0.0025},
                         'gwp': {'unit': 'kgCO2eq', 'value': 33.0},
                         'pe': {'unit': 'MJ', 'value': 420.0}},
             'manufacturer': {'input_value': 'Hynix/Hyundai',
                              'status': 'UNCHANGED',
                              'used_value': 'Hynix/Hyundai'},
             'model': {'input_value': 'HMT41GS6MFR8C-PB',
                       'status': 'UNCHANGED',
                       'used_value': 'HMT41GS6MFR8C-PB'},
             'units': 2}}

To Reproduce

Send this request :

{'capacity': 8,
 'manufacturer': 'Hynix/Hyundai',
 'model': 'HMT41GS6MFR8C-PB',
 'units': 2}

Expected behavior

Final impact of 2 ram sticks is equal to 2x (impact of 1 ram stick).

@bpetit bpetit added the bug Something isn't working label Apr 8, 2022
@da-ekchajzer
Copy link
Collaborator

da-ekchajzer commented May 5, 2022

@odelcroi I think it is related to roundit.
IMHO I think that it's a normal behavior.

Explanation through an example

Significant figure : 2
Impact of 1 ram stick : ram_stick_impact = 33,4

Round(ram_stick_impact) = 33
Round(2 * ram_stick_impact) = Round(2 * 33,4) = Round(66.8) = 67

This behavior is due to the fact that each value is rounded only after the last calculation to avoid any lost of information. We won't reuse a rounded value in a calculation.

@odelcroi, @bpetit does it make sense to you ? Should we change this behavior ?

@bpetit bpetit closed this as completed Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants