← Back to team overview

touch-packages team mailing list archive

[Bug 1430542] Re: Indicator doesn't use weighted average with different-sized batteries

 

Specification updated.
<https://wiki.ubuntu.com/Power?action=diff&rev2=69&rev1=68>

** Changed in: indicator-power (Ubuntu)
       Status: In Progress => Triaged

** Changed in: indicator-power (Ubuntu)
     Assignee: Matthew Paul Thomas (mpt) => (unassigned)

** Description changed:

  The indicator implements the spec:
  
-   https://wiki.ubuntu.com/Power#Handling_multiple_batteries
+   https://wiki.ubuntu.com/Power#Handling_multiple_batteries
  
  which states:
  
-   "Their percentages should be averaged."
+   "Their percentages should be averaged."
  
  Apparently this was taken to mean the simple arithmetic mean, and not
  the weighted average (by the capacity of each battery).
  
-   http://bazaar.launchpad.net/~indicator-applet-developers/indicator-
+   http://bazaar.launchpad.net/~indicator-applet-developers/indicator-
  power/trunk.15.04/view/head:/src/service.c#L1316
  
  shows:
  
-   const double percent = sum_percent / n_batteries;
+   const double percent = sum_percent / n_batteries;
  
  This means that if one battery is twice as large as another, then after
  that battery is discharged, 50% would be reported.  I'd expect 33%.
  
  The spec needs to be updated to be less ambiguous about the intended
  meaning of the word "average" and the code needs to be fixed.
+ 
+ <https://wiki.ubuntu.com/Power#multiple-batteries>: "Their percentages
+ should be averaged, weighted by the capacity of each."

** Description changed:

  The indicator implements the spec:
  
    https://wiki.ubuntu.com/Power#Handling_multiple_batteries
  
- which states:
+ which stated:
  
    "Their percentages should be averaged."
  
  Apparently this was taken to mean the simple arithmetic mean, and not
  the weighted average (by the capacity of each battery).
  
    http://bazaar.launchpad.net/~indicator-applet-developers/indicator-
  power/trunk.15.04/view/head:/src/service.c#L1316
  
  shows:
  
    const double percent = sum_percent / n_batteries;
  
  This means that if one battery is twice as large as another, then after
  that battery is discharged, 50% would be reported.  I'd expect 33%.
  
- The spec needs to be updated to be less ambiguous about the intended
- meaning of the word "average" and the code needs to be fixed.
- 
- <https://wiki.ubuntu.com/Power#multiple-batteries>: "Their percentages
- should be averaged, weighted by the capacity of each."
+ The code needs to be fixed to reflect the more precise use of the word
+ "average". <https://wiki.ubuntu.com/Power#multiple-batteries>: "Their
+ percentages should be averaged, weighted by the capacity of each."

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to indicator-power in Ubuntu.
https://bugs.launchpad.net/bugs/1430542

Title:
  Indicator doesn't use weighted average with different-sized batteries

Status in indicator-power package in Ubuntu:
  Triaged

Bug description:
  The indicator implements the spec:

    https://wiki.ubuntu.com/Power#Handling_multiple_batteries

  which stated:

    "Their percentages should be averaged."

  Apparently this was taken to mean the simple arithmetic mean, and not
  the weighted average (by the capacity of each battery).

    http://bazaar.launchpad.net/~indicator-applet-developers/indicator-
  power/trunk.15.04/view/head:/src/service.c#L1316

  shows:

    const double percent = sum_percent / n_batteries;

  This means that if one battery is twice as large as another, then
  after that battery is discharged, 50% would be reported.  I'd expect
  33%.

  The code needs to be fixed to reflect the more precise use of the word
  "average". <https://wiki.ubuntu.com/Power#multiple-batteries>: "Their
  percentages should be averaged, weighted by the capacity of each."

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/indicator-power/+bug/1430542/+subscriptions


References