Skip to content

Velocities backwards #4

@jrfoell

Description

@jrfoell

Separate issue, but it should be noted that this plugin requires the TimingAndEstimationPlugin: http://trac-hacks.org/wiki/TimingAndEstimationPlugin

I noticed that on a task I entered where I finished before the estimate, the velocity was below 1.0, and it should have been above. Fixed with this change:

diff --git a/evidence/user_ebs.py b/evidence/user_ebs.py
index 02fc196..7451572 100644
--- a/evidence/user_ebs.py
+++ b/evidence/user_ebs.py
@@ -38,11 +38,11 @@ class EvidenceSchedulingUser(Component):
         user = re.match(r'/ebs/user/([\w_][\d\w_]+)/?$', req.path_info).group(1)
         db = self.env.get_db_cnx()
         velocities, hist = get_estimation_history(db, user)
-        avg = float(sum(velocities) / len(velocities))
+        avg = float(len(velocities) / sum(velocities))
 
         latest = [
             {
-                'cont': "%.1f" % (hist[tick_id]['time_total'] / hist[tick_id]['time_estimated']),
+                'cont': "%.1f" % (hist[tick_id]['time_estimated'] / hist[tick_id]['time_total']),
                 'href' : req.href.ticket(tick_id),
                 'title' : 'ticket #%d - %s' % (tick_id, hist[tick_id]['title']),
                 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions